ce8555b1a0492b526812751761a403fbbb2b78c4
[moodle.git] / blocks / myoverview / templates / nav-display-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-display-selector
20     This template renders display dropdown.
22     Example context (json):
23     {
24         "cards": true,
25         "list": false,
26         "summary": false
27     }
28 }}
29 <div class="dropdown mb-1">
30     <button id="displaydropdown" type="button" class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
31     aria-label="{{#str}} aria:displaydropdown, block_myoverview {{/str}}">
32         {{#pix}} a/view_icon_active {{/pix}}
33         <span class="d-sm-inline-block" data-active-item-text>
34             {{#cards}}{{#str}} card, block_myoverview {{/str}}{{/cards}}
35             {{#list}}{{#str}} list, block_myoverview {{/str}}{{/list}}
36             {{#summary}}{{#str}} summary, block_myoverview {{/str}}{{/summary}}
37         </span>
38     </button>
39     <ul class="dropdown-menu" data-show-active-item aria-labelledby="displaydropdown">
40         <li>
41             <a class="dropdown-item {{#cards}}active{{/cards}}" href="#" data-display-option="display" data-value="cards" data-pref="cards" aria-label="{{#str}} aria:card, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}">
42             {{#str}} card, block_myoverview {{/str}}
43             </a>
44         </li>
45         <li>
46             <a class="dropdown-item {{#list}}active{{/list}}" href="#" data-display-option="display" data-value="list" data-pref="list" aria-label="{{#str}} aria:list, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}">
47             {{#str}} list, block_myoverview {{/str}}
48             </a>
49         </li>
50         <li>
51             <a class="dropdown-item {{#summary}}active{{/summary}}" href="#" data-display-option="display" data-value="summary" data-pref="summary" aria-label="{{#str}} aria:summary, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}">
52             {{#str}} summary, block_myoverview {{/str}}
53             </a>
54         </li>
55     </ul>
56 </div>