{{!
    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 core_grades/cellmenu

    This template renders action menu for a given cell.
    Example context (json):
    {
        "editurl": "<a class='dropdown-item' aria-label='Edit grade' role='menuitem' href='grade/edit/tree/grade.php?courseid=13&itemid=608&userid=85&gpr_type=report&gpr_plugin=grader&gpr_courseid=13'>Edit grade</a>",
        "hideurl": "<a class='dropdown-item' aria-label='Hide' role='menuitem' href='grade/edit/tree/action.php?id=13&sesskey=sMAOMLAAN5&eid=n608u85&gpr_type=report&gpr_plugin=grader&gpr_courseid=13&action=hide'>Hide</a>",
        "reporturl0": "<a class='dropdown-item' aria-label='Single view for this user' role='menuitem' href='grade/report/singleview/index.php?id=13&amp;itemid=39&amp;item=user&amp;gpr_type=report&amp;gpr_plugin=grader&amp;gpr_courseid=13'>Single view for this user</a>",
        "reporturl1": "<a class='dropdown-item' aria-label='User report' role='menuitem' href='grade/report/user/index.php?userid=39&amp;id=13&amp;gpr_type=report&amp;gpr_plugin=grader&amp;gpr_courseid=13'>User report</a>",
        "ascendingurl": "<a class='dropdown-item' aria-label='Ascending' role='menuitem' href='index.php?id=13&amp;sortitemid=email&amp;sort=asc&amp;gpr_type=report&amp;gpr_plugin=grader&amp;gpr_courseid=13'>Ascending</a>",
        "descendingurl": "<a class='dropdown-item' aria-label='Descending' role='menuitem' href='index.php?id=13&amp;sortitemid=email&amp;sort=desc&amp;gpr_type=report&amp;gpr_plugin=grader&amp;gpr_courseid=13'>Descending</a>",
        "ascendingfirstnameurl": "<a class='dropdown-item' aria-label='Ascending' role='menuitem' href='index.php?id=13&amp;sortitemid=firstname&amp;sort=asc&amp;gpr_type=report&amp;gpr_plugin=grader&amp;gpr_courseid=13'>Ascending</a>",
        "descendingfirstnameurl": "<a class='dropdown-item' aria-label='Descending' role='menuitem' href='index.php?id=13&amp;sortitemid=firstname&amp;sort=desc&amp;gpr_type=report&amp;gpr_plugin=grader&amp;gpr_courseid=13'>Descending</a>",
        "ascendinglastnameurl": "<a class='dropdown-item' aria-label='Ascending' role='menuitem' href='index.php?id=13&amp;sortitemid=lastname&amp;sort=asc&amp;gpr_type=report&amp;gpr_plugin=grader&amp;gpr_courseid=13'>Ascending</a>",
        "descendinglastnameurl": "<a class='dropdown-item' aria-label='Descending' role='menuitem' href='index.php?id=13&amp;sortitemid=lastname&amp;sort=desc&amp;gpr_type=report&amp;gpr_plugin=grader&amp;gpr_courseid=13'>Descending</a>",
        "viewfeedbackurl": "<a href='#' class='dropdown-item' aria-label='View feedback' role='menuitem'>View feedback</a>",
        "divider1": "true",
        "divider2": "true",
        "datatype": "item",
        "dataid": "123",
        "columncollapse": "<a class='dropdown-item' data-hider='hide' aria-label='Collapse' role='menuitem' href='#'>Collapse</a>"
    }
}}
<div class="action-menu moodle-actionmenu grader" data-collapse="menu">
    <div class="dropdown">
        <button class="btn btn-link btn-icon icon-size-3 cellmenubtn"
            type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
                {{#databoundary}}data-boundary="{{databoundary}}"{{/databoundary}}
                {{#datatype}}data-type="{{datatype}}"{{/datatype}}
                {{#dataid}}data-id="{{dataid}}"{{/dataid}}>
            <div title="{{#str}} cellactions, gradereport_grader {{/str}}" aria-hidden="true">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
                    <path fill="currentColor" d="M13 12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12C11 11.4477 11.4477 11 12 11C12.5523 11 13 11.4477 13 12Z"></path>
                    <path fill="currentColor" d="M13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8C11 7.44772 11.4477 7 12 7C12.5523 7 13 7.44772 13 8Z"></path>
                    <path fill="currentColor" d="M13 16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16C11 15.4477 11.4477 15 12 15C12.5523 15 13 15.4477 13 16Z"></path>
                </svg>
            </div>
            <span class="sr-only">{{#str}} cellactions, gradereport_grader {{/str}}</span>
        </button>

        <div role="menu" class="dropdown-menu">
            {{#editurl}}{{{editurl}}}{{/editurl}}
            {{#editcalculationurl}}{{{editcalculationurl}}}{{/editcalculationurl}}
            {{#reporturl0}}{{{reporturl0}}}{{/reporturl0}}
            {{#reporturl1}}{{{reporturl1}}}{{/reporturl1}}
            {{#advancedgradingurl}}{{{advancedgradingurl}}}{{/advancedgradingurl}}
            {{#gradesonlyurl}}{{{gradesonlyurl}}}{{/gradesonlyurl}}
            {{#aggregatesonlyurl}}{{{aggregatesonlyurl}}}{{/aggregatesonlyurl}}
            {{#fullmodeurl}}{{{fullmodeurl}}}{{/fullmodeurl}}
            {{#deleteurl}}{{{deleteurl}}}{{/deleteurl}}
            {{#duplicateurl}}{{{duplicateurl}}}{{/duplicateurl}}
            {{#gradeanalysisurl}}{{{gradeanalysisurl}}}{{/gradeanalysisurl}}
            {{#divider1}}
                <div class="dropdown-divider" role="separator"></div>
            {{/divider1}}
            {{#ascendingfirstnameurl}}
            <div role="group" aria-label="{{#str}} sortbyfirstname, core_grades {{/str}}">
                <h6 class="dropdown-header">{{#str}} firstname, moodle {{/str}}</h6>
                {{{ascendingfirstnameurl}}}
                {{{descendingfirstnameurl}}}
            </div>
            <div role="group" aria-label="{{#str}} sortbylastname, core_grades {{/str}}">
                <h6 class="dropdown-header">{{#str}} lastname, moodle {{/str}}</h6>
                {{{ascendinglastnameurl}}}
                {{{descendinglastnameurl}}}
            </div>
            {{/ascendingfirstnameurl}}
            {{#ascendingurl}}
                {{{ascendingurl}}}
                {{{descendingurl}}}
            {{/ascendingurl}}
            {{#divider2}}
                <div class="dropdown-divider" role="separator"></div>
            {{/divider2}}
            {{#hideurl}}{{{hideurl}}}{{/hideurl}}
            {{#lockurl}}{{{lockurl}}}{{/lockurl}}
            {{#columncollapse}}{{{columncollapse}}}{{/columncollapse}}
            {{#resetweightsurl}}{{{resetweightsurl}}}{{/resetweightsurl}}
            {{#viewfeedbackurl}}{{{viewfeedbackurl}}}{{/viewfeedbackurl}}
        </div>
    </div>
</div>
