From dd12113eb26c9aeed6b9e7346a8499915b70c139 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra
Date: Thu, 15 Oct 2009 12:59:55 +0000
Subject: [PATCH] * Pass the page number in the URI query string.
---
src/lib/Hydra/Base/Controller/ListBuilds.pm | 4 ++--
src/root/all.tt | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/lib/Hydra/Base/Controller/ListBuilds.pm b/src/lib/Hydra/Base/Controller/ListBuilds.pm
index e10d45ce..f554803e 100644
--- a/src/lib/Hydra/Base/Controller/ListBuilds.pm
+++ b/src/lib/Hydra/Base/Controller/ListBuilds.pm
@@ -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;
diff --git a/src/root/all.tt b/src/root/all.tt
index 931686c7..69e3f41b 100644
--- a/src/root/all.tt
+++ b/src/root/all.tt
@@ -11,13 +11,13 @@ out of [% totalBuilds %] in order of descending timestamp.
[% INCLUDE renderBuildList %]
-[First]
+[First]
[% IF page > 1 %]
- [Prev]
+ [Prev]
[% END %]
[% IF page * resultsPerPage < totalBuilds %]
- [Next]
+ [Next]
[% END %]
-[Last]
+[Last]
[% END %]