MDL-69156 backup: correct behaviour of course copy idnumber field.
[moodle.git] / blocks / myoverview / templates / nav-grouping-selector.mustache
1 {{!
2     This file is part of Moodle - http://moodle.org/
4     Moodle is free software: you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation, either version 3 of the License, or
7     (at your option) any later version.
9     Moodle is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
14     You should have received a copy of the GNU General Public License
15     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16 }}
17 {{!
18     @template block_myoverview/nav-grouping-selector
20     This template renders grouping dropdown.
22     Example context (json):
23     {
24         "allincludinghidden": false,
25         "all": true,
26         "inprogress": false,
27         "future": false,
28         "past": false,
29         "favourites": false,
30         "hidden": false,
31         "displaygroupingallincludinghidden": false,
32         "displaygroupingall": true,
33         "displaygroupinginprogress": true,
34         "displaygroupingfuture": true,
35         "displaygroupingpast": true,
36         "displaygroupingfavourites": true,
37         "displaygroupinghidden": true,
38         "displaygroupingselector": true
39     }
40 }}
41 {{#displaygroupingselector}}
42 <div class="dropdown mb-1 mr-auto">
43     <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}}">
44         {{#pix}} i/filter {{/pix}}
45         <span class="d-sm-inline-block" data-active-item-text>
46             {{#allincludinghidden}}{{#str}} allincludinghidden, block_myoverview {{/str}}{{/allincludinghidden}}
47             {{#all}}{{#str}} all, block_myoverview {{/str}}{{/all}}
48             {{#inprogress}}{{#str}} inprogress, block_myoverview {{/str}}{{/inprogress}}
49             {{#future}}{{#str}} future, block_myoverview {{/str}}{{/future}}
50             {{#past}}{{#str}} past, block_myoverview {{/str}}{{/past}}
51             {{#favourites}}{{#str}} favourites, block_myoverview {{/str}}{{/favourites}}
52             {{#hidden}}{{#str}} hiddencourses, block_myoverview {{/str}}{{/hidden}}
53             {{selectedcustomfield}}
54         </span>
55     </button>
56     <ul class="dropdown-menu" data-show-active-item data-active-item-text aria-labelledby="groupingdropdown">
57         {{#displaygroupingallincludinghidden}}
58         <li>
59             <a class="dropdown-item {{#allincludinghidden}}active{{/allincludinghidden}}" href="#" data-filter="grouping" data-value="allincludinghidden" data-pref="allincludinghidden" aria-label="{{#str}} aria:allcoursesincludinghidden, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}">
60                 {{#str}} allincludinghidden, block_myoverview {{/str}}
61             </a>
62         </li>
63         {{/displaygroupingallincludinghidden}}
64         {{#displaygroupingall}}
65         <li class="dropdown-divider" role="presentation">
66             <span class="filler">&nbsp;</span>
67         </li>
68         <li>
69             <a class="dropdown-item {{#all}}active{{/all}}" href="#" data-filter="grouping" data-value="all" data-pref="all" aria-label="{{#str}} aria:allcourses, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}">
70                 {{#str}} all, block_myoverview {{/str}}
71             </a>
72         </li>
73         {{/displaygroupingall}}
74         {{#displaygroupinginprogress}}
75         <li class="dropdown-divider" role="presentation">
76             <span class="filler">&nbsp;</span>
77         </li>
78         <li>
79             <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}}">
80                 {{#str}} inprogress, block_myoverview {{/str}}
81             </a>
82         </li>
83         {{/displaygroupinginprogress}}
84         {{#displaygroupingfuture}}
85             {{^displaygroupinginprogress}}
86             <li class="dropdown-divider" role="presentation">
87                 <span class="filler">&nbsp;</span>
88             </li>
89             {{/displaygroupinginprogress}}
90         <li>
91             <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}}">
92                 {{#str}} future, block_myoverview {{/str}}
93             </a>
94         </li>
95         {{/displaygroupingfuture}}
96         {{#displaygroupingpast}}
97             {{^displaygroupinginprogress}}
98                 {{^displaygroupingfuture}}
99                 <li class="dropdown-divider" role="presentation">
100                     <span class="filler">&nbsp;</span>
101                 </li>
102                 {{/displaygroupingfuture}}
103             {{/displaygroupinginprogress}}
104         <li>
105             <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}}">
106                 {{#str}} past, block_myoverview {{/str}}
107             </a>
108         </li>
109         {{/displaygroupingpast}}
110         {{#displaygroupingcustomfield}}
111             <li class="dropdown-divider" role="presentation">
112                 <span class="filler">&nbsp;</span>
113             </li>
114             {{#customfieldvalues}}
115                 <li>
116                     <a class="dropdown-item {{#active}}active{{/active}}" href="#" data-filter="grouping"
117                        data-value="customfield" data-pref="customfield" data-customfieldvalue="{{value}}"
118                        aria-label="{{#str}}aria:customfield, block_myoverview, {{name}}{{/str}}"
119                        aria-controls="courses-view-{{uniqid}}">
120                         {{name}}
121                     </a>
122                 </li>
123             {{/customfieldvalues}}
124         {{/displaygroupingcustomfield}}
125         {{#displaygroupingfavourites}}
126         <li class="dropdown-divider" role="presentation">
127             <span class="filler">&nbsp;</span>
128         </li>
129         <li>
130             <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}}">
131                 {{#str}} favourites, block_myoverview {{/str}}
132             </a>
133         {{/displaygroupingfavourites}}
134         {{#displaygroupinghidden}}
135         <li class="dropdown-divider" role="presentation">
136             <span class="filler">&nbsp;</span>
137         </li>
138         <li>
139             <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}}">
140                 {{#str}} hiddencourses, block_myoverview {{/str}}
141             </a>
142         </li>
143         {{/displaygroupinghidden}}
144     </ul>
145 </div>
146 {{/displaygroupingselector}}
147 {{^displaygroupingselector}}
148 <div class="mb-1 mr-auto">
149     <span class="filler">&nbsp;</span>
150 </div>
151 {{/displaygroupingselector}}