4 pagination_control.mas - make an HTML pagination control using a L<Data::Page>
10 subroutine ref that takes one argument, the page number, and returns a
15 L<Data::Page>-compliant pager. For example, this might come from a
16 L<DBIx::Class::ResultSet> via C<$rs->pager>.
27 % if( $pager->previous_page || $pager->next_page ) {
28 <div class="paginate_nav">
29 % if( $pager->previous_page ) {
30 <a class="paginate_nav" href="<% $link_maker->($pager->previous_page) %>"><</a>
32 % for my $page ( $pagelink_first .. $pagelink_last ) {
33 % if( $pager->current_page == $page ) {
34 <span class="paginate_nav_currpage paginate_nav"><% $page %></span>
36 <a class="paginate_nav" href="<% $link_maker->($page) %>"><% $page %></a>
39 % if( $pager->next_page ) {
40 <a class="paginate_nav" href="<% $link_maker->($pager->next_page) %>">></a>
46 my $pagelink_first = $pager->current_page - 6;
47 $pagelink_first = $pager->first_page if $pagelink_first < $pager->first_page;
48 my $pagelink_last = $pager->current_page + 5;
49 $pagelink_last = $pager->last_page if $pagelink_last > $pager->last_page;