You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

83 lines
4.3 KiB

{{!
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 block_myoverview/nav-grouping-selector
This template renders grouping dropdown.
Example context (json):
{
"all": true,
"inprogress": false,
"future": false,
"past": false
}
}}
<div class="dropdown mb-1 mr-auto">
<button id="groupingdropdown" type="button" class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="{{#str}} aria:groupingdropdown, block_myoverview {{/str}}">
{{#pix}} i/filter {{/pix}}
<span class="d-sm-inline-block" data-active-item-text>
{{#all}}{{#str}} allexcepthidden, block_myoverview {{/str}}{{/all}}
{{#inprogress}}{{#str}} inprogress, block_myoverview {{/str}}{{/inprogress}}
{{#future}}{{#str}} future, block_myoverview {{/str}}{{/future}}
{{#past}}{{#str}} past, block_myoverview {{/str}}{{/past}}
{{#favourites}}{{#str}} favourites, block_myoverview {{/str}}{{/favourites}}
{{#hidden}}{{#str}} hiddencourses, block_myoverview {{/str}}{{/hidden}}
</span>
</button>
<ul class="dropdown-menu" data-show-active-item data-active-item-text aria-labelledby="groupingdropdown">
<li>
<a class="dropdown-item {{#all}}active{{/all}}" href="#" data-filter="grouping" data-value="all" data-pref="all" aria-label="{{#str}} aria:allcoursesexcepthidden, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}">
{{#str}} allexcepthidden, block_myoverview {{/str}}
</a>
</li>
<li class="dropdown-divider" role="presentation">
<span class="filler">&nbsp;</span>
</li>
<li>
<a class="dropdown-item {{#inprogress}}active{{/inprogress}}" href="#" data-filter="grouping" data-value="inprogress" data-pref="inprogress" aria-label="{{#str}} aria:inprogress, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}">
{{#str}} inprogress, block_myoverview {{/str}}
</a>
</li>
<li>
<a class="dropdown-item {{#future}}active{{/future}}" href="#" data-filter="grouping" data-value="future" data-pref="future" aria-label="{{#str}} aria:future, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}">
{{#str}} future, block_myoverview {{/str}}
</a>
</li>
<li>
<a class="dropdown-item {{#past}}active{{/past}}" href="#" data-filter="grouping" data-value="past" data-pref="past" aria-label="{{#str}} aria:past, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}">
{{#str}} past, block_myoverview {{/str}}
</a>
</li>
<li class="dropdown-divider" role="presentation">
<span class="filler">&nbsp;</span>
</li>
<li>
<a class="dropdown-item {{#favourites}}active{{/favourites}}" href="#" data-filter="grouping" data-value="favourites" data-pref="favourites" aria-label="{{#str}} aria:favourites, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}">
{{#str}} favourites, block_myoverview {{/str}}
</a>
</li>
<li class="dropdown-divider" role="presentation">
<span class="filler">&nbsp;</span>
</li>
<li>
<a class="dropdown-item {{#hidden}}active{{/hidden}}" href="#" data-filter="grouping" data-value="hidden" data-pref="hidden" aria-label="{{#str}} aria:hiddencourses, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}">
{{#str}} hiddencourses, block_myoverview {{/str}}
</a>
</li>
</ul>
</div>