{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template report_myfeedback/modal

    This template renders a modal to enter feedback.

    Example context (json):
    {
        "actionurl": "/report/myfeedback/reflectivenotes.php",
        "formid": "notesform",
        "gradeid": "gradeid",
        "instanceid": "instance1",
        "modalid": "Abs2",
        "submitbtnid": "submitnotes",
        "submitbtntext": "Submit",
        "textid": "notename",
        "title": "Add feedback",
        "userformid": "user_id",
        "userformname": "userid"
    }

}}
<div class="modal fade" id="{{modalid}}" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="{{modalid}}ModalLabel">{{title}}</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <form method="POST" id="{{formid}}" action="{{{actionurl}}}">
                    <input type="hidden" name="sesskey" value="{{globals.config.sesskey}}" />
                    <textarea id="{{textid}}" class="autoexpand" name="{{textid}}" wrap="hard" rows="4" data-min-rows="4"></textarea>
                    <input type="hidden" name="{{gradeid}}" id="{{gradeid}}" value="" />
                    <input type="hidden" name="{{instanceid}}" id="{{instanceid}}" value="" />
                    <input type="hidden" name="{{userformname}}" id="{{userformid}}" value="" />
                    <input type="submit" id="{{submitbtnid}}" value="{{submitbtntext}}" />
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
