MDL-72275 timeline: Make time dropdown options display consistently
[moodle.git] / blocks / timeline / templates / nav-day-filter.mustache
blobaef88b54828de1f848f030b1e20a373390df6edb
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/>.
17 {{!
18     @template block_timeline/nav-day-filter
20     This template renders the day range selector for the timeline view.
22     Example context (json):
23     {}
25 <div data-region="day-filter" class="dropdown">
26     <button type="button" class="btn btn-outline-secondary dropdown-toggle icon-no-margin" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
27             aria-label="{{#str}} ariadayfilter, block_timeline {{/str}}" aria-controls="menudayfilter">
28         {{#pix}} i/duration {{/pix}}
29         <span class="sr-only" data-active-item-text>
30             {{#all}} {{#str}} all, core {{/str}} {{/all}}
31             {{#overdue}} {{#str}} overdue, block_timeline {{/str}} {{/overdue}}
32             {{#next7days}} {{#str}}next7days, block_timeline {{/str}} {{/next7days}}
33             {{#next30days}} {{#str}}next30days, block_timeline {{/str}} {{/next30days}}
34             {{#next3months}} {{#str}}next3months, block_timeline {{/str}} {{/next3months}}
35             {{#next6months}} {{#str}}next6months, block_timeline {{/str}} {{/next6months}}
36         </span>
37     </button>
38     <div id="menudayfilter" role="menu" class="dropdown-menu" data-show-active-item data-skip-active-class="true">
39         <a
40             class="dropdown-item"
41             href="#"
42             data-from="-14"
43             data-filtername="all"
44             {{#all}}aria-current="true"{{/all}}
45             aria-label="{{#str}} ariadayfilteroption, block_timeline, {{#str}} all, core {{/str}}{{/str}}"
46             role="menuitem"
47         >
48             {{#str}} all, core {{/str}}
49         </a>
50         <a
51             class="dropdown-item"
52             href="#"
53             data-from="-14"
54             data-to="0"
55             data-filtername="overdue"
56             {{#overdue}}aria-current="true"{{/overdue}}
57             aria-label="{{#str}} ariadayfilteroption, block_timeline, {{#str}} overdue, block_timeline {{/str}}{{/str}}"
58             role="menuitem"
59         >
60             {{#str}} overdue, block_timeline {{/str}}
61         </a>
62         <div class="dropdown-divider" role="separator"></div>
63         <h6 class="dropdown-header">{{#str}} duedate, block_timeline {{/str}}</h6>
64         <a
65             class="dropdown-item"
66             href="#"
67             data-from="0"
68             data-to="7"
69             data-filtername="next7days"
70             {{#next7days}}aria-current="true"{{/next7days}}
71             aria-label="{{#str}} ariadayfilteroption, block_timeline, {{#str}} next7days, block_timeline {{/str}}{{/str}}"
72             role="menuitem"
73         >
74             {{#str}} next7days, block_timeline {{/str}}
75         </a>
76         <a
77             class="dropdown-item"
78             href="#"
79             data-from="0"
80             data-to="30"
81             data-filtername="next30days"
82             {{#next30days}}aria-current="true"{{/next30days}}
83             aria-label="{{#str}} ariadayfilteroption, block_timeline, {{#str}} next30days, block_timeline {{/str}}{{/str}}"
84             role="menuitem"
85         >
86             {{#str}} next30days, block_timeline {{/str}}
87         </a>
88         <a
89             class="dropdown-item"
90             href="#"
91             data-from="0"
92             data-to="90"
93             data-filtername="next3months"
94             {{#next3months}}aria-current="true"{{/next3months}}
95             aria-label="{{#str}} ariadayfilteroption, block_timeline, {{#str}} next3months, block_timeline {{/str}}{{/str}}"
96             role="menuitem"
97         >
98             {{#str}} next3months, block_timeline {{/str}}
99         </a>
100         <a
101             class="dropdown-item"
102             href="#"
103             data-from="0"
104             data-to="180"
105             data-filtername="next6months"
106             {{#next6months}}aria-current="true"{{/next6months}}
107             aria-label="{{#str}} ariadayfilteroption, block_timeline, {{#str}} next6months, block_timeline {{/str}}{{/str}}"
108             role="menuitem"
109         >
110             {{#str}} next6months, block_timeline {{/str}}
111         </a>
112     </div>
113 </div>