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):
43 <nav aria-label="{{label}}"
44 id="{{$pagingbarid}}paging-bar-{{uniqid}}{{/pagingbarid}}"
45 data-region="paging-bar"
46 data-items-per-page="{{itemsperpage}}">
48 <ul class="pagination">
50 {{< core/paged_content_paging_bar_item }}
52 <span aria-hidden="true">«</span>
53 <span class="sr-only">{{#str}}previous{{/str}}</span>
55 {{$attributes}}data-control="previous"{{/attributes}}
56 {{/ core/paged_content_paging_bar_item }}
59 {{< core/paged_content_paging_bar_item }}
61 <span aria-hidden="true">{{#str}}first{{/str}}</span>
62 <span class="sr-only">{{#str}}first{{/str}}</span>
64 {{$attributes}}data-control="first"{{/attributes}}
65 {{/ core/paged_content_paging_bar_item }}
68 {{< core/paged_content_paging_bar_item }}
69 {{$attributes}}data-page="true"{{/attributes}}
70 {{/ core/paged_content_paging_bar_item }}
73 {{< core/paged_content_paging_bar_item }}
75 <span aria-hidden="true">{{#str}}last{{/str}}</span>
76 <span class="sr-only">{{#str}}last{{/str}}</span>
78 {{$attributes}}data-control="last"{{/attributes}}
79 {{/ core/paged_content_paging_bar_item }}
82 {{< core/paged_content_paging_bar_item }}
84 <span aria-hidden="true">»</span>
85 <span class="sr-only">{{#str}}next{{/str}}</span>
87 {{$attributes}}data-control="next"{{/attributes}}
88 {{/ core/paged_content_paging_bar_item }}
93 require(['jquery', 'core/paged_content_paging_bar'], function($, PagingControl) {
94 var root = $('#{{$pagingbarid}}paging-bar-{{uniqid}}{{/pagingbarid}}');
95 PagingControl.init(root);