This commit is contained in:
Eelco Dolstra 2008-11-06 23:17:46 +00:00
parent 2324218ecd
commit d5a0f6e145
5 changed files with 20 additions and 4 deletions

View file

@ -36,9 +36,21 @@ sub index :Path :Args(0) {
}
sub project :Local {
my ( $self, $c, $projectName ) = @_;
$c->stash->{template} = 'project.tt';
(my $project) = $c->model('DB::Projects')->search({ name => $projectName });
return error($c, "Project <tt>$projectName</tt> doesn't exist.") if !defined $project;
$c->stash->{project} = $project;
$c->stash->{jobNames} =
[$c->model('DB::Builds')->search({project => $projectName}, {select => [{distinct => 'attrname'}], as => ['attrname']})];
}
sub job :Local {
my ( $self, $c, $project, $jobName ) = @_;
$c->stash->{template} = 'job.tt';
$c->stash->{projectName} = $project;
$c->stash->{jobName} = $jobName;
$c->stash->{builds} = [$c->model('DB::Builds')->search({project => $project, attrName => $jobName}, {order_by => "timestamp DESC"})];
}

View file

@ -13,7 +13,7 @@
</tr>
<tr>
<th>Project:</th>
<td><tt>[% build.project %]</tt></td>
<td><a href="[% c.uri_for('/project' build.project) %]"><tt>[% build.project %]</tt></a></td>
</tr>
<tr>
<th>Jobset:</th>
@ -21,7 +21,7 @@
</tr>
<tr>
<th>Job name:</th>
<td><tt>[% build.attrname %]</tt></td>
<td><a href="[% c.uri_for('/job' build.project build.attrname) %]"><tt>[% build.attrname %]</tt></a></td>
</tr>
<tr>
<th>Description:</th>

View file

@ -177,3 +177,7 @@ table.tablesorter thead tr .headerSortDown {
table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
background-color: #ffe000;
}
table.tablesorter thead tr th {
padding-right: 1.5em;
}

View file

@ -1,6 +1,6 @@
[% WRAPPER layout.tt title="Hydra Overview" %]
<h1>All builds for job <tt>[% jobName %]</tt></h1>
<h1>All builds for job <tt>[% projectName %]:[% jobName %]</tt></h1>
<table>
<tr><th></th><th>Id</th><th>Project</th><th>Job</th><th>System</th><th>Timestamp</th><th>Description</th></tr>

View file

@ -10,7 +10,7 @@
</td>
<td><a href="[% c.uri_for('/build' build.id) %]">[% build.id %]</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><a href="[% c.uri_for('/job' build.project build.attrname) %]"><tt>[% build.attrname %]</tt></a></td>
<td><tt>[% build.system %]</tt></td>
<td>[% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %]</td>
<td>[% build.description %]</td>