Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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_bar
19
 
20
    This template renders the bootstrap style paging bar to control a paged
21
    content section.
22
 
23
    Example context (json):
24
    {
25
        "showitemsperpageselector": true,
26
        "itemsperpage": [
27
            { "value": 5, "active": false },
28
            { "value": 10, "active": true },
29
            { "value": 15, "active": false }
30
        ],
31
        "previous": true,
32
        "next": true,
33
        "first": true,
34
        "last": true,
35
        "activepagenumber": 1,
36
        "pages": [
37
            {
38
                "url": "#",
39
                "page": "1",
40
                "active": true
41
            },
42
            {
43
                "url": "#",
44
                "page": "2"
45
            }
46
        ]
47
    }
48
}}
49
<div
50
    data-region="paging-control-container"
51
    class="d-flex"
52
>
53
    {{#showitemsperpageselector}}
54
        <div
55
            id="paging-control-limit-container-{{uniqid}}"
56
            data-region="paging-control-limit-container"
57
            class="d-inline-flex align-items-center"
58
            title="{{#str}} show {{/str}}"
59
        >
60
 
61
                <button
62
                    type="button"
63
                    class="btn btn-sm btn-outline-secondary dropdown-toggle"
64
                    data-toggle="dropdown"
65
                    aria-haspopup="true"
66
                    aria-expanded="false"
67
                    data-action="limit-toggle"
68
                    {{#arialabels.itemsperpage}}
69
                        aria-label="{{.}}"
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}}
74
                >
75
                    <svg class="mr-2" width="24" height="24" fill="none" viewBox="0 0 24 24">
76
                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19.25 12C19.25 13 17.5 18.25 12 18.25C6.5 18.25 4.75 13 4.75 12C4.75 11 6.5 5.75 12 5.75C17.5 5.75 19.25 11 19.25 12Z"></path>
77
                        <circle cx="12" cy="12" r="2.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle>
78
                    </svg>
79
                    {{#itemsperpage}}
80
                        {{#active}}
81
                            {{#value}}{{.}}{{/value}}
82
                            {{^value}}{{#str}} all, core {{/str}}{{/value}}
83
                        {{/active}}
84
                    {{/itemsperpage}}
85
                </button>
86
                <div
87
                    role="menu"
88
                    class="dropdown-menu"
89
                    data-show-active-item
90
                    data-skip-active-class="true"
91
                    {{#arialabels.itemsperpagecomponents}}
92
                        data-active-item-button-aria-label-components="{{.}}"
93
                    {{/arialabels.itemsperpagecomponents}}
94
                    {{^arialabels.itemsperpagecomponents}}
95
                        data-active-item-button-aria-label-components="pagedcontentpagingbaritemsperpage, core"
96
                    {{/arialabels.itemsperpagecomponents}}
97
                >
98
                    {{#itemsperpage}}
99
                        <a
100
                            class="dropdown-item {{#active}}active{{/active}}"
101
                            href="#"
102
                            data-limit="{{value}}"
103
                            role="menuitem"
104
                            {{#active}}aria-current="true"{{/active}}
105
                        >
106
                            {{#value}}{{.}}{{/value}}
107
                            {{^value}}{{#str}} all, core {{/str}}{{/value}}
108
                        </a>
109
                    {{/itemsperpage}}
110
                </div>
111
 
112
        </div>
113
    {{/showitemsperpageselector}}
114
 
115
    <nav
116
        id="{{$pagingbarid}}paging-bar-{{uniqid}}{{/pagingbarid}}"
117
        class="{{#showitemsperpageselector}}ml-auto{{/showitemsperpageselector}}"
118
        data-region="paging-bar"
119
        data-ignore-control-while-loading="{{ignorecontrolwhileloading}}"
120
        data-hide-control-on-single-page="{{hidecontrolonsinglepage}}"
121
        {{#activepagenumber}}
122
            data-active-page-number="{{.}}"
123
        {{/activepagenumber}}
124
        {{^activepagenumber}}
125
            data-active-page-number="1"
126
        {{/activepagenumber}}
127
        {{#itemsperpage}}
128
            {{#active}}
129
                data-items-per-page="{{value}}"
130
            {{/active}}
131
        {{/itemsperpage}}
132
        {{#arialabels.paginationnav}}
133
            aria-label="{{.}}"
134
        {{/arialabels.paginationnav}}
135
        {{^arialabels.paginationnav}}
136
            aria-label="{{#str}} pagedcontentnavigation, core {{/str}}"
137
        {{/arialabels.paginationnav}}
138
        {{#arialabels.paginationnavitemcomponents}}
139
            data-aria-label-components-pagination-item="{{.}}"
140
        {{/arialabels.paginationnavitemcomponents}}
141
        {{^arialabels.paginationnavitemcomponents}}
142
            data-aria-label-components-pagination-item="pagedcontentnavigationitem, core"
143
        {{/arialabels.paginationnavitemcomponents}}
144
        {{#arialabels.paginationactivenavitemcomponents}}
145
            data-aria-label-components-pagination-active-item="{{.}}"
146
        {{/arialabels.paginationactivenavitemcomponents}}
147
        {{^arialabels.paginationactivenavitemcomponents}}
148
            data-aria-label-components-pagination-active-item="pagedcontentnavigationactiveitem, core"
149
        {{/arialabels.paginationactivenavitemcomponents}}
150
        {{#barsize}}
151
            data-bar-size="{{.}}"
152
        {{/barsize}}
153
    >
154
 
155
        <ul class="pagination">
156
            {{#previous}}
157
                {{< core/paged_content_paging_bar_item }}
158
                    {{$linkattributes}}aria-label="{{#str}}previouspage{{/str}}"{{/linkattributes}}
159
                    {{$item-content}}
160
                        <span class="icon-no-margin dir-rtl-hide" aria-hidden="true">{{#pix}} i/previous, core {{/pix}}</span>
161
                        <span class="icon-no-margin dir-ltr-hide" aria-hidden="true">{{#pix}} i/next, core {{/pix}}</span>
162
                    {{/item-content}}
163
                    {{$attributes}}data-control="previous"{{/attributes}}
164
                {{/ core/paged_content_paging_bar_item }}
165
            {{/previous}}
166
            {{#first}}
167
                {{< core/paged_content_paging_bar_item }}
168
                    {{$linkattributes}}aria-label="{{#str}}firstpage{{/str}}"{{/linkattributes}}
169
                    {{$item-content}}
170
                        {{#str}}first{{/str}}
171
                    {{/item-content}}
172
                    {{$attributes}}data-control="first"{{/attributes}}
173
                {{/ core/paged_content_paging_bar_item }}
174
            {{/first}}
175
            {{#barsize}}
176
                {{< core/paged_content_paging_bar_item }}
177
                    {{$linkattributes}}aria-hidden="true"{{/linkattributes}}
178
                    {{$item-content}}
179
                        &hellip;
180
                    {{/item-content}}
181
                    {{$attributes}}data-dots="beginning"{{/attributes}}
182
                {{/ core/paged_content_paging_bar_item }}
183
            {{/barsize}}
184
            {{#pages}}
185
                {{< core/paged_content_paging_bar_item }}
186
                    {{$attributes}}data-page="true"{{/attributes}}
187
                {{/ core/paged_content_paging_bar_item }}
188
            {{/pages}}
189
            {{#barsize}}
190
                {{< core/paged_content_paging_bar_item }}
191
                    {{$linkattributes}}aria-hidden="true"{{/linkattributes}}
192
                    {{$item-content}}
193
                        &hellip;
194
                    {{/item-content}}
195
                    {{$attributes}}data-dots="ending"{{/attributes}}
196
                {{/ core/paged_content_paging_bar_item }}
197
            {{/barsize}}
198
            {{#last}}
199
                {{< core/paged_content_paging_bar_item }}
200
                    {{$linkattributes}}aria-label="{{#str}}lastpage{{/str}}"{{/linkattributes}}
201
                    {{$item-content}}
202
                        {{#str}}last{{/str}}
203
                    {{/item-content}}
204
                    {{$attributes}}data-control="last"{{/attributes}}
205
                {{/ core/paged_content_paging_bar_item }}
206
            {{/last}}
207
            {{#next}}
208
                {{< core/paged_content_paging_bar_item }}
209
                    {{$linkattributes}}aria-label="{{#str}}nextpage{{/str}}"{{/linkattributes}}
210
                    {{$item-content}}
211
                        <span class="icon-no-margin dir-rtl-hide" aria-hidden="true">{{#pix}} i/next, core {{/pix}}</span>
212
                        <span class="icon-no-margin dir-ltr-hide" aria-hidden="true">{{#pix}} i/previous, core {{/pix}}</span>
213
                    {{/item-content}}
214
                    {{$attributes}}data-control="next"{{/attributes}}
215
                {{/ core/paged_content_paging_bar_item }}
216
            {{/next}}
217
        </ul>
218
    </nav>
219
</div>