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

@ -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;

View file

@ -112,7 +112,7 @@
<th>Part of:</th>
<td>
<a href="[% c.uri_for(c.controller('JobsetEval').action_for('view'), [eval.id]) %]">evaluation [% eval.id %]</a>
[% IF nrEvals > 1 +%] (and [% nrEvals - 1 %] others)[% END %]
[% IF nrEvals > 1 +%] (and <a href="[% c.uri_for('/build' build.id 'evals') %]">[% nrEvals - 1 %] others</a>)[% END %]
</td>
</tr>
[% END %]

View file

@ -384,7 +384,7 @@ BLOCK renderEvals %]
<table class="tablesorter table table-condensed table-striped">
<thead>
<tr>
[% IF !jobset %]
[% IF !jobset && !build %]
<th>Jobset</th>
[% END %]
<th>#</th>
@ -398,7 +398,7 @@ BLOCK renderEvals %]
eval = e.eval;
link = c.uri_for(c.controller('JobsetEval').action_for('view'), [eval.id]) %]
<tr class="clickable" onclick="window.location = '[% link %]'">
[% IF !jobset %]
[% IF !jobset && !build %]
<td>[% INCLUDE renderFullJobsetName project=eval.get_column('project') jobset=eval.get_column('jobset') %]</td>
[% END %]
<td><a href="[% link %]">[% eval.id %]</a></td>

View file

@ -1,4 +1,7 @@
[% WRAPPER layout.tt title=(jobset ? "Evaluations of jobset $project.name:$jobset.name" : "Latest evaluations") %]
[% WRAPPER layout.tt title=
(build ? "Evaluations containing build $build.id" :
jobset ? "Evaluations of jobset $project.name:$jobset.name" :
"Latest evaluations") %]
[% PROCESS common.tt %]
<p>Showing evaluations [% (page - 1) * resultsPerPage + 1 %] - [%