forked from lix-project/hydra
This commit is contained in:
parent
8c6760cecc
commit
db68e005a6
|
@ -14,6 +14,7 @@ __PACKAGE__->config->{namespace} = '';
|
||||||
sub begin :Private {
|
sub begin :Private {
|
||||||
my ( $self, $c ) = @_;
|
my ( $self, $c ) = @_;
|
||||||
$c->stash->{projects} = [$c->model('DB::Projects')->search({}, {order_by => 'displayname'})];
|
$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},
|
{project => $projectName},
|
||||||
{join => 'resultInfo', select => {sum => 'stoptime - starttime'}, as => ['sum']})
|
{join => 'resultInfo', select => {sum => 'stoptime - starttime'}, as => ['sum']})
|
||||||
->first->get_column('sum');
|
->first->get_column('sum');
|
||||||
|
$c->stash->{totalBuildTime} = 0 unless defined $c->stash->{totalBuildTime};
|
||||||
|
|
||||||
$c->stash->{jobNames} =
|
$c->stash->{jobNames} =
|
||||||
[$c->model('DB::Builds')->search({project => $projectName}, {select => [{distinct => 'attrname'}], as => ['attrname']})];
|
[$c->model('DB::Builds')->search({project => $projectName}, {select => [{distinct => 'attrname'}], as => ['attrname']})];
|
||||||
|
|
|
@ -1,4 +1,11 @@
|
||||||
[% USE date -%]
|
[% 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"?>
|
<?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">
|
<!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">
|
<li class="section">
|
||||||
<div class="title">Hydra</div>
|
<div class="title">Hydra</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><div class="title"><a href="/">Overview</a></div></li>
|
[% INCLUDE makeLink uri = c.uri_for('/') title = "Overview" %]
|
||||||
<li><div class="title"><a href="/queue">Queue</a></div></li>
|
[% INCLUDE makeLink uri = c.uri_for('/queue') title = "Queue" %]
|
||||||
<li><div class="title"><a href="/latest">Latest builds</a></div></li>
|
[% 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>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -39,7 +48,15 @@
|
||||||
<div class="title">Projects</div>
|
<div class="title">Projects</div>
|
||||||
<ul>
|
<ul>
|
||||||
[% FOREACH project IN projects %]
|
[% 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 %]
|
[% END %]
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
@ -48,8 +65,8 @@
|
||||||
<li class="section">
|
<li class="section">
|
||||||
<div class="title">Admin</div>
|
<div class="title">Admin</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><div class="title"><a href="/">Users</a></div></li>
|
[% INCLUDE makeLink uri = c.uri_for('/users') title = "Users" %]
|
||||||
<li><div class="title"><a href="/">Release definitions</a></div></li>
|
[% INCLUDE makeLink uri = c.uri_for('/create-project') title = "Create a project" %]
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -3,8 +3,13 @@
|
||||||
<h1>Project <tt>[% curProject.name %]</tt></h1>
|
<h1>Project <tt>[% curProject.name %]</tt></h1>
|
||||||
|
|
||||||
|
|
||||||
|
<p><strong>Description:</strong> [% curProject.description %]</p>
|
||||||
|
|
||||||
|
|
||||||
<h2>Definition</h2>
|
<h2>Definition</h2>
|
||||||
|
|
||||||
|
[% IF curProject.jobsets.size > 0 %]
|
||||||
|
|
||||||
[% FOREACH jobset IN curProject.jobsets -%]
|
[% FOREACH jobset IN curProject.jobsets -%]
|
||||||
|
|
||||||
<h3>Jobset <tt>[% jobset.name %]</tt></h3>
|
<h3>Jobset <tt>[% jobset.name %]</tt></h3>
|
||||||
|
@ -49,15 +54,29 @@
|
||||||
|
|
||||||
[% END -%]
|
[% END -%]
|
||||||
|
|
||||||
|
[% ELSE %]
|
||||||
|
|
||||||
|
<p>No jobsets have been defined yet.</p>
|
||||||
|
|
||||||
|
[% END %]
|
||||||
|
|
||||||
|
|
||||||
<h2>Jobs</h2>
|
<h2>Jobs</h2>
|
||||||
|
|
||||||
|
[% IF jobNames.size > 0 %]
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
[% FOREACH jobName IN jobNames -%]
|
[% FOREACH jobName IN jobNames -%]
|
||||||
<li><a href="[% c.uri_for('/job' curProject.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>
|
||||||
|
|
||||||
|
[% ELSE %]
|
||||||
|
|
||||||
|
<p>No builds have been performed or scheduled.</p>
|
||||||
|
|
||||||
|
[% END %]
|
||||||
|
|
||||||
|
|
||||||
<h2>Statistics</h2>
|
<h2>Statistics</h2>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue