Allow showing all evaluations that contain a given build

This commit is contained in:
Eelco Dolstra
2013-02-21 18:49:57 +01:00
parent 6afe528570
commit c9ac7746b2
4 changed files with 26 additions and 5 deletions

View File

@ -559,7 +559,7 @@ sub clone_submit : Chained('build') PathPart('clone/submit') Args(0) {
}
sub get_info : Chained('build') PathPart('api/get-info') Args(0) {
sub get_info : Chained('build') PathPart('api/get-info') Args(0) {
my ($self, $c) = @_;
my $build = $c->stash->{build};
# !!! strip the json prefix
@ -571,4 +571,22 @@ sub get_info : Chained('build') PathPart('api/get-info') Args(0) {
}
sub get_info : Chained('build') PathPart('evals') Args(0) {
my ($self, $c) = @_;
$c->stash->{template} = 'evals.tt';
my $page = int($c->req->param('page') || "1") || 1;
my $resultsPerPage = 20;
my $evals = $c->stash->{build}->jobsetevals;
$c->stash->{page} = $page;
$c->stash->{resultsPerPage} = $resultsPerPage;
$c->stash->{total} = $evals->search({hasnewbuilds => 1})->count;
$c->stash->{evals} = getEvals($self, $c, $evals, ($page - 1) * $resultsPerPage, $resultsPerPage)
}
1;