forked from lix-project/hydra
* 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 {
|
||||
my ($self, $c, $page) = @_;
|
||||
my ($self, $c) = @_;
|
||||
|
||||
$c->stash->{template} = 'all.tt';
|
||||
|
||||
$page = (defined $page ? int($page) : 1) || 1;
|
||||
my $page = int($c->req->param('page')) || 1;
|
||||
|
||||
my $resultsPerPage = 50;
|
||||
|
||||
|
|
|
@ -11,13 +11,13 @@ out of [% totalBuilds %] in order of descending timestamp.</p>
|
|||
|
||||
[% INCLUDE renderBuildList %]
|
||||
|
||||
[<a href="[% "$baseUri/1" %]">First</a>]
|
||||
[<a href="[% "$baseUri?page=1" %]">First</a>]
|
||||
[% IF page > 1 %]
|
||||
[<a href="[% "$baseUri/"; (page - 1) %]">Prev</a>]
|
||||
[<a href="[% "$baseUri?page="; (page - 1) %]">Prev</a>]
|
||||
[% END %]
|
||||
[% IF page * resultsPerPage < totalBuilds %]
|
||||
[<a href="[% "$baseUri/"; (page + 1) %]">Next</a>]
|
||||
[<a href="[% "$baseUri?page="; (page + 1) %]">Next</a>]
|
||||
[% END %]
|
||||
[<a href="[% "$baseUri/"; (totalBuilds - 1) div resultsPerPage + 1 %]">Last</a>]
|
||||
[<a href="[% "$baseUri?page="; (totalBuilds - 1) div resultsPerPage + 1 %]">Last</a>]
|
||||
|
||||
[% END %]
|
||||
|
|
Loading…
Reference in a new issue