This commit is contained in:
Eelco Dolstra 2008-11-13 00:01:19 +00:00
parent cd06b6c97d
commit 0f03c796e7
4 changed files with 12 additions and 6 deletions

View file

@ -47,11 +47,12 @@ sub project :Local {
my ( $self, $c, $projectName ) = @_; my ( $self, $c, $projectName ) = @_;
$c->stash->{template} = 'project.tt'; $c->stash->{template} = 'project.tt';
$c->stash->{projects} = [$c->model('DB::Projects')->search({}, {order_by => 'displayname'})];
(my $project) = $c->model('DB::Projects')->search({ name => $projectName }); (my $project) = $c->model('DB::Projects')->search({ name => $projectName });
return error($c, "Project <tt>$projectName</tt> doesn't exist.") if !defined $project; return error($c, "Project <tt>$projectName</tt> doesn't exist.") if !defined $project;
$c->stash->{project} = $project; $c->stash->{curProject} = $project;
$c->model('DB::Builds')->search({project => $projectName}, {join => 'resultInfo', select => {sum => 'starttime'}});
$c->stash->{finishedBuilds} = $c->model('DB::Builds')->search( $c->stash->{finishedBuilds} = $c->model('DB::Builds')->search(
{project => $projectName, finished => 1}); {project => $projectName, finished => 1});
@ -97,9 +98,13 @@ sub default :Path {
sub build :Local { sub build :Local {
my ( $self, $c, $id ) = @_; my ( $self, $c, $id ) = @_;
$c->stash->{projects} = [$c->model('DB::Projects')->search({}, {order_by => 'displayname'})];
my $build = getBuild($c, $id); my $build = getBuild($c, $id);
return error($c, "Build with ID $id doesn't exist.") if !defined $build; return error($c, "Build with ID $id doesn't exist.") if !defined $build;
$c->stash->{curProject} = $build->project;
$c->stash->{template} = 'build.tt'; $c->stash->{template} = 'build.tt';
$c->stash->{build} = $build; $c->stash->{build} = $build;
$c->stash->{id} = $id; $c->stash->{id} = $id;

View file

@ -150,6 +150,7 @@ td.buildfarmMainColumn {
pre.buildlog { pre.buildlog {
border: 1px solid black; border: 1px solid black;
padding: 0.3em; padding: 0.3em;
white-space: pre-wrap;
} }
ul.productList { ul.productList {

View file

@ -39,7 +39,7 @@
<div class="title">Projects</div> <div class="title">Projects</div>
<ul> <ul>
[% FOREACH project IN projects %] [% FOREACH project IN projects %]
<li><div class="title"><a href="[% c.uri_for('/project' project.name) %]">[% project.displayname %]</a></div></li> <li [% IF curProject.name == project.name %]class="active"[% END %]><div class="title"><a href="[% c.uri_for('/project' project.name) %]">[% project.displayname %]</a></div></li>
[% END %] [% END %]
</ul> </ul>
</li> </li>

View file

@ -1,11 +1,11 @@
[% WRAPPER layout.tt title="Hydra Overview" %] [% WRAPPER layout.tt title="Hydra Overview" %]
<h1>Project <tt>[% project.name %]</tt></h1> <h1>Project <tt>[% curProject.name %]</tt></h1>
<h2>Definition</h2> <h2>Definition</h2>
[% FOREACH jobset IN project.jobsets -%] [% FOREACH jobset IN curProject.jobsets -%]
<h3>Jobset <tt>[% jobset.name %]</tt></h3> <h3>Jobset <tt>[% jobset.name %]</tt></h3>
@ -54,7 +54,7 @@
<ul> <ul>
[% FOREACH jobName IN jobNames -%] [% FOREACH jobName IN jobNames -%]
<li><a href="[% c.uri_for('/job' project.name jobName.attrname) %]"><tt>[% jobName.attrname %]</tt></a></li> <li><a href="[% c.uri_for('/job' curProject.name jobName.attrname) %]"><tt>[% jobName.attrname %]</tt></a></li>
[% END %] [% END %]
</ul> </ul>