* Pass the page number in the URI query string.
This commit is contained in:
parent
d109910453
commit
dd12113eb2
|
@ -47,11 +47,11 @@ sub errors : Chained('get_builds') PathPart Args(0) {
|
||||||
|
|
||||||
|
|
||||||
sub all : Chained('get_builds') PathPart {
|
sub all : Chained('get_builds') PathPart {
|
||||||
my ($self, $c, $page) = @_;
|
my ($self, $c) = @_;
|
||||||
|
|
||||||
$c->stash->{template} = 'all.tt';
|
$c->stash->{template} = 'all.tt';
|
||||||
|
|
||||||
$page = (defined $page ? int($page) : 1) || 1;
|
my $page = int($c->req->param('page')) || 1;
|
||||||
|
|
||||||
my $resultsPerPage = 50;
|
my $resultsPerPage = 50;
|
||||||
|
|
||||||
|
|
|
@ -11,13 +11,13 @@ out of [% totalBuilds %] in order of descending timestamp.</p>
|
||||||
|
|
||||||
[% INCLUDE renderBuildList %]
|
[% INCLUDE renderBuildList %]
|
||||||
|
|
||||||
[<a href="[% "$baseUri/1" %]">First</a>]
|
[<a href="[% "$baseUri?page=1" %]">First</a>]
|
||||||
[% IF page > 1 %]
|
[% IF page > 1 %]
|
||||||
[<a href="[% "$baseUri/"; (page - 1) %]">Prev</a>]
|
[<a href="[% "$baseUri?page="; (page - 1) %]">Prev</a>]
|
||||||
[% END %]
|
[% END %]
|
||||||
[% IF page * resultsPerPage < totalBuilds %]
|
[% IF page * resultsPerPage < totalBuilds %]
|
||||||
[<a href="[% "$baseUri/"; (page + 1) %]">Next</a>]
|
[<a href="[% "$baseUri?page="; (page + 1) %]">Next</a>]
|
||||||
[% END %]
|
[% END %]
|
||||||
[<a href="[% "$baseUri/"; (totalBuilds - 1) div resultsPerPage + 1 %]">Last</a>]
|
[<a href="[% "$baseUri?page="; (totalBuilds - 1) div resultsPerPage + 1 %]">Last</a>]
|
||||||
|
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
Loading…
Reference in a new issue