diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-03-16 18:01:06 +0100 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-03-16 18:01:06 +0100 |
commit | 41a0a69ba25b46797b8fbc93a2035ed257b72999 (patch) | |
tree | 6aefa4c49a6f29dd55cb1bed82c60bbc5b96804d /templates/displayheaders/_pagination3.html.ep | |
parent | 0203fba6502916e4a6f63433fb7a26e8eff42c85 (diff) |
changed pagination appearance
Diffstat (limited to 'templates/displayheaders/_pagination3.html.ep')
-rw-r--r-- | templates/displayheaders/_pagination3.html.ep | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/templates/displayheaders/_pagination3.html.ep b/templates/displayheaders/_pagination3.html.ep new file mode 100644 index 0000000..fe573ce --- /dev/null +++ b/templates/displayheaders/_pagination3.html.ep @@ -0,0 +1,27 @@ +% my $make_link_num = begin +% my ($txt, $to) = @_; +%= link_to $txt => url_with->query({start => $to}) => (class => (param('start')//0) == $to ? 'current' : '') +% end + +% my $nbh = begin +% my $num = $pgn->{total_pages} > 5 ? 5 : $pgn->{total_pages}; +% my $start = $pgn->{current_page}-2 < 0 ? 0 : $pgn->{current_page}-2; +% if ($start+$num > $pgn->{total_pages}) { $start = $pgn->{total_pages}-$num } + +% for ($start..$start+$num-1) { + <li> +%= $make_link_num->($_+1 => $_*$pgn->{page_size}) + </li> +% } +% end + +<nav> + <ul class="pagination-box"> + <li> + %= $c->_paginate->make_link('Prev' => 'prev_page') + </li> + %= $nbh->() + <li> + %= $c->_paginate->make_link('Next' => 'next_page') + </ul> +</nav> |