MDL-63352 block_timeline: Persist user preference on timeline
[moodle.git] / blocks / timeline / templates / nav-view-selector.mustache
CommitLineData
1e44de35
RW
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_timeline/nav-view-selector
19
20 This template renders the timeline sort selector.
21
22 Example context (json):
23 {}
24}}
25<div data-region="view-selector" class="btn-group">
26 <button type="button" class="btn btn-outline-secondary dropdown-toggle icon-no-margin" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
27 {{#pix}} i/filter {{/pix}}
28 <span class="sr-only">
9e95193e
P
29 {{#sorttimelinecourses}}<span data-active-item-text>{{/sorttimelinecourses}}{{#str}} ariaviewselector, block_timeline{{/str}}{{#sorttimelinecourses}}</span>{{/sorttimelinecourses}}
30 {{#sorttimelinedates}}<span data-active-item-text>{{/sorttimelinedates}}{{#str}} sortbydates, block_timeline {{/str}}{{#sorttimelinedates}}</span>{{/sorttimelinedates}}
1e44de35
RW
31 </span>
32 </button>
9e95193e 33 <div role="menu" class="dropdown-menu dropdown-menu-right list-group hidden" data-show-active-item data-skip-active-class="true" >
1e44de35 34 <a
9e95193e 35 class="dropdown-item {{#sorttimelinedates}}active{{/sorttimelinedates}}"
1e44de35
RW
36 href="#view_dates_{{uniqid}}"
37 data-toggle="tab"
9e95193e 38 data-filtername="sortbydates"
1e44de35
RW
39 aria-label="{{#str}} ariaviewselectoroption, block_timeline, {{#str}} sortbydates, block_timeline {{/str}}{{/str}}"
40 >
41 {{#str}} sortbydates, block_timeline {{/str}}
42 </a>
43 <a
9e95193e 44 class="dropdown-item {{#sorttimelinecourses}}active{{/sorttimelinecourses}}"
1e44de35
RW
45 href="#view_courses_{{uniqid}}"
46 data-toggle="tab"
9e95193e 47 data-filtername="sortbycourses"
1e44de35
RW
48 aria-label="{{#str}} ariaviewselectoroption, block_timeline, {{#str}} sortbycourses, block_timeline {{/str}}{{/str}}"
49 >
50 {{#str}} sortbycourses, block_timeline {{/str}}
51 </a>
52 </div>
53</div>