From d32477f82bca6042ddccd6bbce1cc804927a89a9 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Mon, 27 Feb 2023 15:30:42 +0100 Subject: Separate name space for pagination --- templates/headers/_display_folders.html.ep | 2 +- templates/headers/_display_headers.html.ep | 4 ++-- templates/headers/_pagination1.html.ep | 10 +++++----- templates/headers/_pagination2.html.ep | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'templates') diff --git a/templates/headers/_display_folders.html.ep b/templates/headers/_display_folders.html.ep index 7f1612f..be5bdd9 100644 --- a/templates/headers/_display_folders.html.ep +++ b/templates/headers/_display_folders.html.ep @@ -21,7 +21,7 @@

- <%= l('[_1] of [_2] messages', $this_page->[1] - $this_page->[0], $total_items) %>\ + <%= l('[_1] of [_2] messages', $pgn->{this_page}[1] - $pgn->{this_page}[0], $pgn->{total_items}) %>\ <%= l(', [_1] new', $total_new_mails) if $total_new_mails > 0 =%> <%= l(' - mailbox size: [_1]', print_sizes10 $total_size) if $total_size %>

diff --git a/templates/headers/_display_headers.html.ep b/templates/headers/_display_headers.html.ep index 4dd36a1..ad60fc6 100644 --- a/templates/headers/_display_headers.html.ep +++ b/templates/headers/_display_headers.html.ep @@ -63,8 +63,8 @@ - % foreach my $msgnum ($first_item .. $last_item) { - % my $msg = $msgs->[$msgnum - $first_item]; + % foreach my $msgnum ($pgn->{first_item} .. $pgn->{last_item}) { + % my $msg = $msgs->[$msgnum - $pgn->{first_item}]; %= tag tr => (class => $msg->{unread} ? 'new-mail' : '') => (id => $msg->{message_handle}) => begin diff --git a/templates/headers/_pagination1.html.ep b/templates/headers/_pagination1.html.ep index 0e000f9..798f79f 100644 --- a/templates/headers/_pagination1.html.ep +++ b/templates/headers/_pagination1.html.ep @@ -1,7 +1,7 @@
- - - [<%= l('page [_1] of [_2]', $current_page+1, $total_pages) %>] - - + + + [<%= l('page [_1] of [_2]', $pgn->{current_page}+1, $pgn->{total_pages}) %>] + +
diff --git a/templates/headers/_pagination2.html.ep b/templates/headers/_pagination2.html.ep index 63e8f63..eef2abe 100644 --- a/templates/headers/_pagination2.html.ep +++ b/templates/headers/_pagination2.html.ep @@ -1,12 +1,12 @@
%= form_for '' => (class => 'pure-form') => begin - <%= l('first') . ' ' . l 'page' %> - <%= l('previous') . ' ' . l 'page' %> + <%= l('first') . ' ' . l 'page' %> + <%= l('previous') . ' ' . l 'page' %> [ %= label_for custompage => ucfirst l 'page' - %= number_field start => (id => 'custompage') => (size => 3) => (placeholder => $current_page+1) + %= number_field start => (id => 'custompage') => (size => 3) => (placeholder => $pgn->{current_page}+1) %= l 'of' - %= $total_pages + %= $pgn->{total_pages} ] % my $h = $c->req->query_params->to_hash; @@ -16,7 +16,7 @@ % } % } - <%= l('next') . ' ' . l 'page' %> - <%= l('last') . ' ' . l('page') %> + <%= l('next') . ' ' . l 'page' %> + <%= l('last') . ' ' . l('page') %> % end
-- cgit v1.2.3