[Rt-commit] rt branch, 4.0/mobile-ui-next-page-fix, created. rt-4.0.1-127-ga23c4ed
Jason May
jasonmay at bestpractical.com
Tue Jul 26 18:24:22 EDT 2011
The branch, 4.0/mobile-ui-next-page-fix has been created
at a23c4ed7b610f9d6da85bf7267dae800e2c5b675 (commit)
- Log -----------------------------------------------------------------
commit a23c4ed7b610f9d6da85bf7267dae800e2c5b675
Author: Jason May <jasonmay at bestpractical.com>
Date: Tue Jul 26 18:13:40 2011 -0400
Only show the next page if the total doesn't exceed rows * pages
diff --git a/share/html/m/_elements/ticket_list b/share/html/m/_elements/ticket_list
index 711158e..f06cc7e 100644
--- a/share/html/m/_elements/ticket_list
+++ b/share/html/m/_elements/ticket_list
@@ -52,9 +52,12 @@ $query => ''
$page => 1
</%args>
<%init>
+
+my $rows = 10;
+
my $collection = RT::Tickets->new($session{'CurrentUser'});
$collection->FromSQL($query);
-$collection->RowsPerPage(10);
+$collection->RowsPerPage($rows);
$collection->GotoPage($page-1);
# XXX: ->{'order_by'} is hacky, but there is no way to check if
# collection is ordered or not
@@ -105,7 +108,9 @@ loc("Found [quant,_1,ticket]",$collection->Count) &>
% }
Page <%$page%>
+% if ($collection->CountAll > $page * $rows) {
<a href="<%RT->Config->Get('WebPath')%>/m/tickets/search?page=<%$page+1%>&query=<%$query%>&order=<%$order%>&order_by=<%$order_by%>">Next</a>
+% }
</div>
</&>
</&>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list