{{!
    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 mod_casestudy/grading_navigation

    User navigation for case study grading

    Context variables required for this template:
    * currentsubmissionid - Current submission ID
    * casestudyid - Case study ID
    * cmid - Course module ID
    * currentindex - Current position (1-based)
    * totalcount - Total number of submissions
    * larrow - HTML for left arrow
    * rarrow - HTML for right arrow
}}
<div class="casestudy-user-navigation-wrapper" data-region="user-selector">
    <div class="d-flex align-items-center gap-2">
        <a href="#" data-action="previous-user" class="btn btn-secondary btn-sm"
           aria-label="{{#str}}previous{{/str}}"
           title="{{#str}}previous{{/str}}"
           {{#isfirst}}disabled{{/isfirst}}>{{{larrow}}}</a>

        <div class="flex-grow-1">
            <label for="id_change_user_select" class="sr-only">{{#str}}selectuser, mod_casestudy{{/str}}</label>
            <select id="id_change_user_select"
                    name="change_user_select"
                    data-action="change-user"
                    data-currentsubmissionid="{{currentsubmissionid}}"
                    data-casestudyid="{{casestudyid}}"
                    data-cmid="{{cmid}}"
                    class="form-control form-control-sm">
            </select>
            <small class="form-text text-muted">
                <span data-region="user-count-summary">{{#str}}xofy, mod_casestudy, {"x": "{{currentindex}}", "y": "{{totalcount}}"}{{/str}}</span>
            </small>
        </div>

        <a href="#" data-action="next-user" class="btn btn-secondary btn-sm"
           aria-label="{{#str}}next{{/str}}"
           title="{{#str}}next{{/str}}"
           {{#islast}}disabled{{/islast}}>{{{rarrow}}}</a>
    </div>
</div>
{{#js}}
require(['mod_casestudy/grading_navigation_simple'], function(GradingNav) {
    GradingNav.init('[data-region="user-selector"]', {{currentsubmissionid}}, {{cmid}}, {{casestudyid}});
});
{{/js}}
