summaryrefslogtreecommitdiff
path: root/lib/JWebmail/Plugin/Paginate.pm
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-03-16 18:01:06 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2023-03-16 18:01:06 +0100
commit41a0a69ba25b46797b8fbc93a2035ed257b72999 (patch)
tree6aefa4c49a6f29dd55cb1bed82c60bbc5b96804d /lib/JWebmail/Plugin/Paginate.pm
parent0203fba6502916e4a6f63433fb7a26e8eff42c85 (diff)
changed pagination appearance
Diffstat (limited to 'lib/JWebmail/Plugin/Paginate.pm')
-rw-r--r--lib/JWebmail/Plugin/Paginate.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/JWebmail/Plugin/Paginate.pm b/lib/JWebmail/Plugin/Paginate.pm
index 1a48ed3..9b39617 100644
--- a/lib/JWebmail/Plugin/Paginate.pm
+++ b/lib/JWebmail/Plugin/Paginate.pm
@@ -78,12 +78,21 @@ sub paginate {
return $start, $end;
}
+sub make_link {
+ my ($c, $txt, $to) = @_;
+
+ return $c->link_to(
+ $txt => $c->url_with->query({start => $c->stash('pgn')->{$to}[0]}),
+ class => ($c->param('start')//0) == $c->stash('pgn')->{$to}[0] ? 'disabled' : '',
+ );
+}
sub register {
my ($self, $app, $conf) = @_;
$conf //= {};
$app->helper(paginate => \&paginate);
+ $app->helper('_paginate.make_link' => \&make_link);
}