This commit is contained in:
Eelco Dolstra 2008-11-13 09:48:10 +00:00
parent 8c6760cecc
commit db68e005a6
3 changed files with 44 additions and 6 deletions

View file

@ -14,6 +14,7 @@ __PACKAGE__->config->{namespace} = '';
sub begin :Private {
my ( $self, $c ) = @_;
$c->stash->{projects} = [$c->model('DB::Projects')->search({}, {order_by => 'displayname'})];
$c->stash->{curUri} = $c->request->uri;
}
@ -75,6 +76,7 @@ sub project :Local {
{project => $projectName},
{join => 'resultInfo', select => {sum => 'stoptime - starttime'}, as => ['sum']})
->first->get_column('sum');
$c->stash->{totalBuildTime} = 0 unless defined $c->stash->{totalBuildTime};
$c->stash->{jobNames} =
[$c->model('DB::Builds')->search({project => $projectName}, {select => [{distinct => 'attrname'}], as => ['attrname']})];

View file

@ -1,4 +1,11 @@
[% USE date -%]
[% BLOCK makeLink %]
<li [% IF curUri == uri %]class="active"[% END %]>
<div class="title"><a href="[% uri %]">[% title %]</a></div>
</li>
[% END %]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@ -28,9 +35,11 @@
<li class="section">
<div class="title">Hydra</div>
<ul>
<li><div class="title"><a href="/">Overview</a></div></li>
<li><div class="title"><a href="/queue">Queue</a></div></li>
<li><div class="title"><a href="/latest">Latest builds</a></div></li>
[% INCLUDE makeLink uri = c.uri_for('/') title = "Overview" %]
[% INCLUDE makeLink uri = c.uri_for('/queue') title = "Queue" %]
[% INCLUDE makeLink uri = c.uri_for('/latest') title = "Latest builds" %]
[% INCLUDE makeLink uri = c.uri_for('/all') title = "All builds" %]
[% INCLUDE makeLink uri = c.uri_for('/search') title = "Search builds" %]
</ul>
</li>
</ul>
@ -39,7 +48,15 @@
<div class="title">Projects</div>
<ul>
[% FOREACH project IN projects %]
<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>
[% IF curProject.name == project.name %]
<li class="active">
<div class="title"><a href="[% c.uri_for('/project' project.name) %]">[% project.displayname %]</a></div>
</li>
[% ELSE %]
<li>
<div class="title"><a href="[% c.uri_for('/project' project.name) %]">[% project.displayname %]</a></div>
</li>
[% END %]
[% END %]
</ul>
</li>
@ -48,8 +65,8 @@
<li class="section">
<div class="title">Admin</div>
<ul>
<li><div class="title"><a href="/">Users</a></div></li>
<li><div class="title"><a href="/">Release definitions</a></div></li>
[% INCLUDE makeLink uri = c.uri_for('/users') title = "Users" %]
[% INCLUDE makeLink uri = c.uri_for('/create-project') title = "Create a project" %]
</ul>
</li>
</ul>

View file

@ -3,8 +3,13 @@
<h1>Project <tt>[% curProject.name %]</tt></h1>
<p><strong>Description:</strong> [% curProject.description %]</p>
<h2>Definition</h2>
[% IF curProject.jobsets.size > 0 %]
[% FOREACH jobset IN curProject.jobsets -%]
<h3>Jobset <tt>[% jobset.name %]</tt></h3>
@ -49,15 +54,29 @@
[% END -%]
[% ELSE %]
<p>No jobsets have been defined yet.</p>
[% END %]
<h2>Jobs</h2>
[% IF jobNames.size > 0 %]
<ul>
[% FOREACH jobName IN jobNames -%]
<li><a href="[% c.uri_for('/job' curProject.name jobName.attrname) %]"><tt>[% jobName.attrname %]</tt></a></li>
[% END %]
</ul>
[% ELSE %]
<p>No builds have been performed or scheduled.</p>
[% END %]
<h2>Statistics</h2>