| 1 |
efrain |
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 core/paged_content_paging_dropdown
|
|
|
19 |
|
|
|
20 |
This template renders the bootstrap style dropdown menu to control
|
|
|
21 |
paged content.
|
|
|
22 |
|
|
|
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 |
}
|
|
|
41 |
}}
|
|
|
42 |
<div class="dropdown mb-1"
|
|
|
43 |
id="paging-dropdown-{{uniqid}}"
|
|
|
44 |
data-region="paging-dropdown-container">
|
|
|
45 |
|
|
|
46 |
<button class="btn btn-secondary dropdown-toggle"
|
|
|
47 |
id="paging-dropdown-menu-button-{{uniqid}}"
|
|
|
48 |
type="button"
|
|
|
49 |
data-region="dropdown-toggle"
|
|
|
50 |
data-toggle="dropdown"
|
|
|
51 |
aria-haspopup="true"
|
|
|
52 |
aria-expanded="false">
|
|
|
53 |
|
|
|
54 |
{{#options}}
|
|
|
55 |
{{#active}}
|
|
|
56 |
{{{content}}}
|
|
|
57 |
{{/active}}
|
|
|
58 |
{{/options}}
|
|
|
59 |
</button>
|
|
|
60 |
<div class="dropdown-menu" aria-labelledby="paging-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>
|