{{!
    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/>.

    Edwiser RemUI
    @package theme_remui
    @copyright (c) 2023 WisdmLabs (https://wisdmlabs.com/)
    @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
}}
{{!
    @template block_myoverview/nav-grouping-selector

    This template renders grouping dropdown.

    Example context (json):
    {
        "allincludinghidden": false,
        "all": true,
        "inprogress": false,
        "future": false,
        "past": false,
        "favourites": false,
        "hidden": false,
        "displaygroupingallincludinghidden": false,
        "displaygroupingall": true,
        "displaygroupinginprogress": true,
        "displaygroupingfuture": true,
        "displaygroupingpast": true,
        "displaygroupingfavourites": true,
        "displaygroupinghidden": true,
        "displaygroupingselector": true
    }
}}
{{#displaygroupingselector}}
<ul class="nav nav-tabs p-0" role="menu" data-show-active-item data-skip-active-class="true" data-active-item-text
    aria-labelledby="groupingdropdown">
    {{#displaygroupingallincludinghidden}}
    <li class="nav-item">
        <a class="nav-link" href="#" data-filter="grouping" data-value="allincludinghidden"
            data-pref="allincludinghidden"
            aria-label="{{#str}} aria:allcoursesincludinghidden, block_myoverview {{/str}}"
            aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#allincludinghidden}}aria-current="true"
            {{/allincludinghidden}} title="{{#str}} allincludinghidden, block_myoverview {{/str}}">
            {{#str}} allincludinghidden, block_myoverview {{/str}}
        </a>
    </li>
    {{/displaygroupingallincludinghidden}}
    {{#displaygroupingall}}
    <li class="nav-item">
        <a class="nav-link" href="#" data-filter="grouping" data-value="all" data-pref="all"
            aria-label="{{#str}} aria:allcourses, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}"
            role="menuitem" {{#all}}aria-current="true" {{/all}} title="{{#str}} all, block_myoverview {{/str}}">
            {{#str}} all, block_myoverview {{/str}}
        </a>
    </li>
    {{/displaygroupingall}}
    {{#displaygroupinginprogress}}
    <li class="nav-item">
        <a class="nav-link" href="#" data-filter="grouping" data-value="inprogress" data-pref="inprogress"
            aria-label="{{#str}} aria:inprogress, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}"
            role="menuitem" {{#inprogress}}aria-current="true" {{/inprogress}} title="{{#str}} inprogress, block_myoverview {{/str}}">
            {{#str}} inprogress, block_myoverview {{/str}}
        </a>
    </li>
    {{/displaygroupinginprogress}}
    {{#displaygroupingfuture}}
    <li class="nav-item">
        <a class="nav-link" href="#" data-filter="grouping" data-value="future" data-pref="future"
            aria-label="{{#str}} aria:future, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}"
            role="menuitem" {{#future}}aria-current="true" {{/future}} title="{{#str}} future, block_myoverview {{/str}}">
            {{#str}} future, block_myoverview {{/str}}
        </a>
    </li>
    {{/displaygroupingfuture}}
    {{#displaygroupingpast}}
    <li class="nav-item">
        <a class="nav-link" href="#" data-filter="grouping" data-value="past" data-pref="past"
            aria-label="{{#str}} aria:past, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}"
            role="menuitem" {{#past}}aria-current="true" {{/past}} title="{{#str}} past, block_myoverview {{/str}}">
            {{#str}} past, block_myoverview {{/str}}
        </a>
    </li>
    {{/displaygroupingpast}}
    {{#displaygroupingcustomfield}}
    {{#customfieldvalues}}
    <li class="nav-item">
        <a class="nav-link" href="#" data-filter="grouping" data-value="customfield" data-pref="customfield"
            data-customfieldvalue="{{value}}" aria-label="{{#str}}aria:customfield, block_myoverview, {{name}}{{/str}}"
            aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#active}}aria-current="true" {{/active}} title="{{name}}">
            {{name}}
        </a>
    </li>
    {{/customfieldvalues}}
    {{/displaygroupingcustomfield}}
    {{#displaygroupingfavourites}}
    <li class="nav-item">
        <a class="nav-link" href="#" data-filter="grouping" data-value="favourites" data-pref="favourites"
            aria-label="{{#str}} aria:favourites, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}"
            role="menuitem" {{#favourites}}aria-current="true" {{/favourites}} title="{{#str}} favourites, block_myoverview {{/str}}">
            {{#str}} favourites, block_myoverview {{/str}}
        </a>
        {{/displaygroupingfavourites}}
        {{#displaygroupinghidden}}
    <li class="nav-item">
        <a class="nav-link" href="#" data-filter="grouping" data-value="hidden" data-pref="hidden"
            aria-label="{{#str}} aria:hiddencourses, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}"
            role="menuitem" {{#hidden}}aria-current="true" {{/hidden}} title="{{#str}} hiddencourses, block_myoverview {{/str}}">
            {{#str}} hiddencourses, block_myoverview {{/str}}
        </a>
    </li>
    {{/displaygroupinghidden}}
</ul>

{{/displaygroupingselector}}
