MDL-64901 block_myoverview: admin settings to control available layouts
[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             {{#card}}{{#str}} card, block_myoverview {{/str}}{{/card}}
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     {{#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}}
47     </ul>
48 </div>