[Jifty-commit] r7439 - jifty/trunk/share/web/templates/_elements

Jifty commits jifty-commit at lists.jifty.org
Tue Aug 25 02:48:29 EDT 2009


Author: sartak
Date: Tue Aug 25 02:48:28 2009
New Revision: 7439

Added:
   jifty/trunk/share/web/templates/_elements/paging

Log:
Steal paging template from hiveminder

Added: jifty/trunk/share/web/templates/_elements/paging
==============================================================================
--- (empty file)
+++ jifty/trunk/share/web/templates/_elements/paging	Tue Aug 25 02:48:28 2009
@@ -0,0 +1,32 @@
+<%args>
+$collection
+$page => 1
+$per_page => 15
+$argument => 'page'
+</%args>
+% if ($collection->count != 0) {
+<div class="page-nav">
+Page <span class="page-numbers">
+% my $last = $collection->pager->last_page;
+
+% my $last_num = 0;
+% foreach my $goto_page (1 ..  $last) {
+% # only show page numbers that are: 1, (within 3 of the current page), last
+% next if (($goto_page > 1) && ($goto_page < $last) && (abs($goto_page-$page) > 2));
+% if ( ($goto_page - $last_num) > 1) { 
+&hellip;
+% } 
+<span class="page-number <%$goto_page == $page ? 'current' : ''%>"><% Jifty->web->link( label => $goto_page, onclick => { args => { $argument => $goto_page } } ) %></span>
+% $last_num = $goto_page;
+% }
+
+% if ($collection->pager->previous_page) {
+<span class="prev-page"><% Jifty->web->link( label => "Back", class => "prev", onclick => { args => { $argument => $collection->pager->previous_page } } ) %></span>
+% }
+
+% if ($collection->pager->next_page) {
+<span class="next-page"><% Jifty->web->link( label => "Next", class => "next", onclick => { args => { $argument => $collection->pager->next_page } } ) %></span>
+% }
+</span>
+</div>
+% }


More information about the Jifty-commit mailing list