pgc-www/templates/_page-navigation.html.ep
barnold 3c2dd9eac5 A few paging changes...
Pass the items name (plural) into the page nav partial.
Simplify what's shown if there's no more than one pageful of items.
2022-09-19 13:39:11 +01:00

28 lines
704 B
Plaintext

<p/>
Showing <%= $pager->entries_on_this_page %> <%= $items_name || "items" %>
of
<%= commify($pager->total_entries) =%>
% if ($pager->total_entries <= rpp) {
.
<% } else { %>
on page <%= commify($pager->current_page) %>
of <%= commify($pager->last_page) %>.
<br/>
<%= link_to url_with(page_number => 1) => begin %>◄ First<% end %>
% if (my $prev = $pager->previous_page) {
<%= link_to url_with(page_number => $prev) => begin %>◄ Prev<% end %>
% } else {
◄ Prev
% }
% if (my $next = $pager->next_page) {
<%= link_to url_with(page_number => $next) => begin %>Next ►<% end %>
% } else {
Next ►
% }
<%= link_to url_with(page_number => $pager->last_page) => begin %>Last ►<% end %>
% }