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/>.
18 @template core/paged_content_paging_bar
20 This template renders the bootstrap style paging bar to control a paged
23 Example context (json):
25 "showitemsperpageselector": true,
27 { "value": 5, "active": false },
28 { "value": 10, "active": true },
29 { "value": 15, "active": false }
35 "activepagenumber": 1,
50 data-region="paging-control-container"
53 {{#showitemsperpageselector}}
55 id="paging-control-limit-container-{{uniqid}}"
56 data-region="paging-control-limit-container"
57 class="d-inline-flex align-items-center"
59 <span class="mr-1">{{#str}} show {{/str}}</span>
60 <div class="btn-group">
63 class="btn btn-outline-secondary dropdown-toggle"
64 data-toggle="dropdown"
67 data-action="limit-toggle"
68 {{#arialabels.itemsperpage}}
70 {{/arialabels.itemsperpage}}
71 {{^arialabels.itemsperpage}}
72 aria-label="{{#str}} pagedcontentpagingbaritemsperpage, core, {{#itemsperpage}}{{#active}}{{#value}}{{.}}{{/value}}{{^value}}{{#str}} all, core {{/str}}{{/value}}{{/active}}{{/itemsperpage}}{{/str}}"
73 {{/arialabels.itemsperpage}}
77 {{#value}}{{.}}{{/value}}
78 {{^value}}{{#str}} all, core {{/str}}{{/value}}
86 data-skip-active-class="true"
87 {{#arialabels.itemsperpagecomponents}}
88 data-active-item-button-aria-label-components="{{.}}"
89 {{/arialabels.itemsperpagecomponents}}
90 {{^arialabels.itemsperpagecomponents}}
91 data-active-item-button-aria-label-components="pagedcontentpagingbaritemsperpage, core"
92 {{/arialabels.itemsperpagecomponents}}
96 class="dropdown-item {{#active}}active{{/active}}"
98 data-limit="{{value}}"
100 {{#active}}aria-current="true"{{/active}}
102 {{#value}}{{.}}{{/value}}
103 {{^value}}{{#str}} all, core {{/str}}{{/value}}
109 {{/showitemsperpageselector}}
112 id="{{$pagingbarid}}paging-bar-{{uniqid}}{{/pagingbarid}}"
113 class="{{#showitemsperpageselector}}ml-auto{{/showitemsperpageselector}}"
114 data-region="paging-bar"
115 data-ignore-control-while-loading="{{ignorecontrolwhileloading}}"
116 data-hide-control-on-single-page="{{hidecontrolonsinglepage}}"
117 {{#activepagenumber}}
118 data-active-page-number="{{.}}"
119 {{/activepagenumber}}
120 {{^activepagenumber}}
121 data-active-page-number="1"
122 {{/activepagenumber}}
125 data-items-per-page="{{value}}"
128 {{#arialabels.paginationnav}}
130 {{/arialabels.paginationnav}}
131 {{^arialabels.paginationnav}}
132 aria-label="{{#str}} pagedcontentnavigation, core {{/str}}"
133 {{/arialabels.paginationnav}}
134 {{#arialabels.paginationnavitemcomponents}}
135 data-aria-label-components-pagination-item="{{.}}"
136 {{/arialabels.paginationnavitemcomponents}}
137 {{^arialabels.paginationnavitemcomponents}}
138 data-aria-label-components-pagination-item="pagedcontentnavigationitem, core"
139 {{/arialabels.paginationnavitemcomponents}}
140 {{#arialabels.paginationactivenavitemcomponents}}
141 data-aria-label-components-pagination-active-item="{{.}}"
142 {{/arialabels.paginationactivenavitemcomponents}}
143 {{^arialabels.paginationactivenavitemcomponents}}
144 data-aria-label-components-pagination-active-item="pagedcontentnavigationactiveitem, core"
145 {{/arialabels.paginationactivenavitemcomponents}}
147 data-bar-size="{{.}}"
151 <ul class="pagination mb-0">
153 {{< core/paged_content_paging_bar_item }}
154 {{$linkattributes}}aria-label="{{#str}}previouspage{{/str}}"{{/linkattributes}}
156 <span class="icon-no-margin dir-rtl-hide" aria-hidden="true">{{#pix}} i/previous, core {{/pix}}</span>
157 <span class="icon-no-margin dir-ltr-hide" aria-hidden="true">{{#pix}} i/next, core {{/pix}}</span>
159 {{$attributes}}data-control="previous"{{/attributes}}
160 {{/ core/paged_content_paging_bar_item }}
163 {{< core/paged_content_paging_bar_item }}
164 {{$linkattributes}}aria-label="{{#str}}firstpage{{/str}}"{{/linkattributes}}
166 {{#str}}first{{/str}}
168 {{$attributes}}data-control="first"{{/attributes}}
169 {{/ core/paged_content_paging_bar_item }}
172 {{< core/paged_content_paging_bar_item }}
173 {{$linkattributes}}aria-hidden="true"{{/linkattributes}}
177 {{$attributes}}data-dots="beginning"{{/attributes}}
178 {{/ core/paged_content_paging_bar_item }}
181 {{< core/paged_content_paging_bar_item }}
182 {{$attributes}}data-page="true"{{/attributes}}
183 {{/ core/paged_content_paging_bar_item }}
186 {{< core/paged_content_paging_bar_item }}
187 {{$linkattributes}}aria-hidden="true"{{/linkattributes}}
191 {{$attributes}}data-dots="ending"{{/attributes}}
192 {{/ core/paged_content_paging_bar_item }}
195 {{< core/paged_content_paging_bar_item }}
196 {{$linkattributes}}aria-label="{{#str}}lastpage{{/str}}"{{/linkattributes}}
200 {{$attributes}}data-control="last"{{/attributes}}
201 {{/ core/paged_content_paging_bar_item }}
204 {{< core/paged_content_paging_bar_item }}
205 {{$linkattributes}}aria-label="{{#str}}nextpage{{/str}}"{{/linkattributes}}
207 <span class="icon-no-margin dir-rtl-hide" aria-hidden="true">{{#pix}} i/next, core {{/pix}}</span>
208 <span class="icon-no-margin dir-ltr-hide" aria-hidden="true">{{#pix}} i/previous, core {{/pix}}</span>
210 {{$attributes}}data-control="next"{{/attributes}}
211 {{/ core/paged_content_paging_bar_item }}