MDL-64901 block_myoverview: admin settings to control available layouts
[moodle.git] / blocks / myoverview / templates / nav-display-selector.mustache
CommitLineData
e4b4b9e7
BB
1{{!
2 This file is part of Moodle - http://moodle.org/
3
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.
8
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.
13
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
19
20 This template renders display dropdown.
21
22 Example context (json):
3cfff885
BB
23 {
24 "cards": true,
25 "list": false,
26 "summary": false
27 }
e4b4b9e7 28}}
5cac5fa4 29<div class="dropdown mb-1">
e4b4b9e7
BB
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}}">
3cfff885 32 {{#pix}} a/view_icon_active {{/pix}}
4fd6b770 33 <span class="d-sm-inline-block" data-active-item-text>
5f59a4c0 34 {{#card}}{{#str}} card, block_myoverview {{/str}}{{/card}}
3cfff885
BB
35 {{#list}}{{#str}} list, block_myoverview {{/str}}{{/list}}
36 {{#summary}}{{#str}} summary, block_myoverview {{/str}}{{/summary}}
37 </span>
e4b4b9e7
BB
38 </button>
39 <ul class="dropdown-menu" data-show-active-item aria-labelledby="displaydropdown">
5f59a4c0
TD
40 {{#layouts}}
41 <li>
42 <a class="dropdown-item {{#active}}active{{/active}}" href="#" data-display-option="display" data-value="{{id}}" data-pref="{{id}}" aria-label="{{arialabel}}" aria-controls="courses-view-{{uniqid}}">
43 {{name}}
44 </a>
45 </li>
46 {{/layouts}}
e4b4b9e7 47 </ul>
3cfff885 48</div>