MDL-51177 core: Ignore built files in stylelint
[moodle.git] / lib / templates / paged_content_paging_dropdown.mustache
blobd065d39745e866e6de66fbe3ff34246bc20714b8
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 core/paged_content_paging_dropdown
20     This template renders the bootstrap style dropdown menu to control
21     paged content.
23     Example context (json):
24     {
25         "options": [
26             {
27                 "itemcount": 25,
28                 "content": "25",
29                 "active": true
30             },
31             {
32                 "itemcount": 25,
33                 "content": "50"
34             },
35             {
36                 "itemcount": 50,
37                 "content": "100"
38             }
39         ]
40     }
42 <div class="dropdown m-b-1"
43     id="paging-dropdown-{{uniqid}}"
44     data-region="paging-dropdown-container">
46     <button class="btn btn-secondary dropdown-toggle"
47         type="button"
48         id="dropdown-menu-button-{{uniqid}}"
49         data-region="dropdown-toggle"
50         data-toggle="dropdown"
51         aria-haspopup="true"
52         aria-expanded="false">
54         {{#options}}
55             {{#active}}
56                 {{{content}}}
57             {{/active}}
58         {{/options}}
59     </button>
60     <div class="dropdown-menu" aria-labelledby="dropdown-menu-button-{{uniqid}}">
61         {{#options}}
62             {{> core/paged_content_paging_dropdown_item }}
63         {{/options}}
64         {{< core/paged_content_paging_dropdown_item }}
65             {{$itemcount}}0{{/itemcount}}
66             {{$content}}{{#str}} all {{/str}}{{/content}}
67         {{/ core/paged_content_paging_dropdown_item }}
68     </div>
69 </div>
70 {{#js}}
71 require(['jquery', 'core/paged_content_paging_dropdown'], function($, PagingControl) {
72     var root = $('#paging-dropdown-{{uniqid}}');
73     PagingControl.init(root);
74 });
75 {{/js}}