This commit is contained in:
Eelco Dolstra 2008-11-05 03:25:48 +00:00
parent 8378d57ba2
commit 621ce1ee64
5 changed files with 17 additions and 8 deletions

View file

@ -32,15 +32,15 @@ sub index :Path :Args(0) {
$c->stash->{allBuilds} = [$c->model('DB::Builds')->all];
# Get the latest build for each unique job.
# select * from builds as x where timestamp == (select max(timestamp) from builds where jobName == x.jobName);
$c->stash->{latestBuilds} = [$c->model('DB::Builds')->search(undef, {order_by => "jobName", where => "timestamp == (select max(timestamp) from builds where jobName == me.jobName)"})];
$c->stash->{latestBuilds} = [$c->model('DB::Builds')->search(undef, {order_by => "project, attrName", where => "timestamp == (select max(timestamp) from builds where project == me.project and attrName == me.attrName)"})];
}
sub job :Local {
my ( $self, $c, $jobName ) = @_;
my ( $self, $c, $project, $jobName ) = @_;
$c->stash->{template} = 'job.tt';
$c->stash->{jobName} = $jobName;
$c->stash->{builds} = [$c->model('DB::Builds')->search({jobName => $jobName}, {order_by => "timestamp DESC"})];
$c->stash->{builds} = [$c->model('DB::Builds')->search({project => $project, attrName => $jobName}, {order_by => "timestamp DESC"})];
}

View file

@ -10,9 +10,17 @@
<th>Build ID:</th>
<td>[% build.id %]</td>
</tr>
<tr>
<th>Project:</th>
<td><tt>[% build.project %]</tt></td>
</tr>
<tr>
<th>Jobset:</th>
<td><tt>[% build.jobset %]</tt></td>
</tr>
<tr>
<th>Job name:</th>
<td>[% build.jobname %]</td>
<td><tt>[% build.attrname %]</tt></td>
</tr>
<tr>
<th>Description:</th>

View file

@ -6,7 +6,7 @@
<table class="tablesorter">
<thead>
<tr><th></th><th>#</th><th>Job</th><th>Timestamp</th><th>Description</th></tr>
<tr><th></th><th>#</th><th>Project</th><th>Job</th><th>Timestamp</th><th>Description</th></tr>
</thead>
<tbody>
[% FOREACH build IN latestBuilds -%]
@ -21,7 +21,7 @@
<table class="tablesorter">
<thead>
<tr><th></th><th>#</th><th>Job</th><th>Timestamp</th><th>Description</th></tr>
<tr><th></th><th>#</th><th>Project</th><th>Job</th><th>Timestamp</th><th>Description</th></tr>
</thead>
<tbody>
[% FOREACH build IN allBuilds -%]

View file

@ -3,7 +3,7 @@
<h1>All builds for job <tt>[% jobName %]</tt></h1>
<table>
<tr><th></th><th>Id</th><th>Job</th><th>Timestamp</th><th>Description</th></tr>
<tr><th></th><th>Id</th><th>Project</th><th>Job</th><th>Timestamp</th><th>Description</th></tr>
[% FOREACH build IN builds -%]
[% INCLUDE "short-build-info.tt" %]
[% END -%]

View file

@ -9,7 +9,8 @@
[% END %]
</td>
<td><a href="[% c.uri_for('/build' build.id) %]">[% build.id %]</a></td>
<td><a href="[% c.uri_for('/job' build.jobname) %]"><tt>[% build.jobname %]</tt></a></td>
<td><a href="[% c.uri_for('/project' build.project) %]"><tt>[% build.project %]</tt></a></td>
<td><a href="[% c.uri_for('/job' build.project build.attrname) %]"><tt>[% build.jobset %]:[% build.attrname %]</tt></a></td>
<td>[% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %]</td>
<td>[% build.description %]</td>
</tr>