Revision ef32afed
Von Moritz Bunkus vor mehr als 12 Jahren hinzugefügt
templates/webpages/common/paginate.html | ||
---|---|---|
1 | 1 |
[%- USE T8 %] |
2 |
<span class='paginate'> |
|
2 |
[%- MACRO build_url BLOCK %] |
|
3 |
[%- IF base_url %] |
|
4 |
[%- base_url %]&page=[% page %] |
|
5 |
[%- ELSE %] |
|
6 |
[% url_maker('page' => page) %] |
|
7 |
[%- END %] |
|
8 |
[%- END %] |
|
3 | 9 |
[%- IF pages.max > 1 %] |
4 |
[%- IF pages.cur > 1 %]<a class='paginate-prev' href='[% base_url _ "&page=" _ (pages.cur - 1) %]'>« [% 'prev' | $T8 %]</a> [% ELSE %]<b>«</b> [% END %] |
|
10 |
<span class='paginate'> |
|
11 |
[%- IF pages.cur > 1 %]<a class='paginate-prev' href='[% build_url(page=pages.cur - 1) %]'>« [% 'prev' | $T8 %]</a> [% ELSE %]<b>«</b> [% END %] |
|
5 | 12 |
[%- FOR p = pages.common %] |
6 | 13 |
[%- NEXT UNLESS p.visible %] |
7 |
[%- IF p.active %]<a class='paginate-page' href="[% base_url _ "&page=" _ p.page %]">[% p.page %]</a> [% ELSE %]<b>[% p.page %]</b> [%- END %]
|
|
14 |
[%- IF p.active %]<a class='paginate-page' href="[% build_url(page=p.page) %]">[% p.page %]</a> [% ELSE %]<b>[% p.page %]</b> [%- END %]
|
|
8 | 15 |
[%- END %] |
9 |
[%- IF pages.cur < pages.max %]<a class='paginate-next' href='[% base_url _ "&page=" _ (pages.cur + 1) %]'>[% 'next' | $T8 %] »</a>[% ELSE %]<b>»</b>[%- END %] |
|
16 |
[%- IF pages.cur < pages.max %]<a class='paginate-next' href='[% build_url(page=pages.cur + 1) %]'>[% 'next' | $T8 %] »</a>[% ELSE %]<b>»</b>[%- END %] |
|
17 |
</span> |
|
10 | 18 |
[%- END %] |
Auch abrufbar als: Unified diff
Controller-Helfer zum Paginaten von Listen