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/paging_bar
|
|
|
19 |
|
|
|
20 |
This template renders the horizontal bar with page links, e.g.
|
|
|
21 |
| « | 1 | 2 | 3 | » |
|
|
|
22 |
|
|
|
23 |
Example context (json):
|
|
|
24 |
{
|
|
|
25 |
"previous": null,
|
|
|
26 |
"next": {
|
|
|
27 |
"page": 2,
|
|
|
28 |
"url": "./page.php?p=1"
|
|
|
29 |
},
|
|
|
30 |
"first": null,
|
|
|
31 |
"last": {
|
|
|
32 |
"page": 100,
|
|
|
33 |
"url": "./page.php?p=99"
|
|
|
34 |
},
|
|
|
35 |
"label": "Page",
|
|
|
36 |
"pages": [
|
|
|
37 |
{
|
|
|
38 |
"page": 1,
|
|
|
39 |
"active": true,
|
|
|
40 |
"url": null
|
|
|
41 |
},
|
|
|
42 |
{
|
|
|
43 |
"page": 2,
|
|
|
44 |
"active": false,
|
|
|
45 |
"url": "./page.php?p=1"
|
|
|
46 |
}
|
|
|
47 |
],
|
|
|
48 |
"haspages": true,
|
|
|
49 |
"pagesize": 10
|
|
|
50 |
}
|
|
|
51 |
}}
|
|
|
52 |
{{#haspages}}
|
|
|
53 |
<nav aria-label="{{label}}" class="pagination pagination-centered justify-content-center">
|
|
|
54 |
<ul class="pagination " data-page-size="{{pagesize}}">
|
|
|
55 |
{{#previous}}
|
|
|
56 |
<li class="page-item" data-page-number="{{page}}">
|
|
|
57 |
<a href="{{url}}" class="page-link" aria-label="{{# str }} previouspage, moodle {{/ str }}">
|
|
|
58 |
<span aria-hidden="true">«</span>
|
|
|
59 |
<span class="sr-only">{{#str}}previouspage, moodle{{/str}}</span>
|
|
|
60 |
</a>
|
|
|
61 |
</li>
|
|
|
62 |
{{/previous}}
|
|
|
63 |
{{#first}}
|
|
|
64 |
<li class="page-item" data-page-number="{{page}}">
|
|
|
65 |
<a href="{{url}}" class="page-link">{{page}}</a>
|
|
|
66 |
</li>
|
|
|
67 |
<li class="page-item disabled" data-page-number="{{page}}">
|
|
|
68 |
<span class="page-link">…</span>
|
|
|
69 |
</li>
|
|
|
70 |
{{/first}}
|
|
|
71 |
{{#pages}}
|
|
|
72 |
<li class="page-item {{#active}}active{{/active}}" data-page-number="{{page}}">
|
|
|
73 |
<a href="{{#url}}{{.}}{{/url}}{{^url}}#{{/url}}" class="page-link">
|
|
|
74 |
{{page}}
|
|
|
75 |
{{#active}}
|
|
|
76 |
<span class="sr-only">{{#str}}currentinparentheses, theme_universe{{/str}}</span>
|
|
|
77 |
{{/active}}
|
|
|
78 |
</a>
|
|
|
79 |
</li>
|
|
|
80 |
{{/pages}}
|
|
|
81 |
{{#last}}
|
|
|
82 |
<li class="page-item disabled" data-page-number="{{page}}">
|
|
|
83 |
<span class="page-link">…</span>
|
|
|
84 |
</li>
|
|
|
85 |
<li class="page-item" data-page-number="{{page}}">
|
|
|
86 |
<a href="{{url}}" class="page-link">{{page}}</a>
|
|
|
87 |
</li>
|
|
|
88 |
{{/last}}
|
|
|
89 |
{{#next}}
|
|
|
90 |
<li class="page-item" data-page-number="{{page}}">
|
|
|
91 |
<a href="{{url}}" class="page-link" aria-label="{{# str }} nextpage, moodle {{/ str }}">
|
|
|
92 |
<span aria-hidden="true">»</span>
|
|
|
93 |
<span class="sr-only">{{#str}}nextpage, moodle{{/str}}</span>
|
|
|
94 |
</a>
|
|
|
95 |
</li>
|
|
|
96 |
{{/next}}
|
|
|
97 |
</ul>
|
|
|
98 |
</nav>
|
|
|
99 |
{{/haspages}}
|