From db68e005a6b55c24c24b252127e4d49ef7802f8b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 13 Nov 2008 09:48:10 +0000 Subject: [PATCH] --- .../lib/HydraFrontend/Controller/Root.pm | 2 ++ src/HydraFrontend/root/layout.tt | 29 +++++++++++++++---- src/HydraFrontend/root/project.tt | 19 ++++++++++++ 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm index 3948b8b6..925637f5 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm @@ -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']})]; diff --git a/src/HydraFrontend/root/layout.tt b/src/HydraFrontend/root/layout.tt index 77051835..6d87e91d 100644 --- a/src/HydraFrontend/root/layout.tt +++ b/src/HydraFrontend/root/layout.tt @@ -1,4 +1,11 @@ [% USE date -%] + +[% BLOCK makeLink %] +
  • + +
  • +[% END %] + @@ -28,9 +35,11 @@
  • Hydra
  • @@ -39,7 +48,15 @@
    Projects
    @@ -48,8 +65,8 @@
  • Admin
  • diff --git a/src/HydraFrontend/root/project.tt b/src/HydraFrontend/root/project.tt index 89fafd10..227c28ad 100644 --- a/src/HydraFrontend/root/project.tt +++ b/src/HydraFrontend/root/project.tt @@ -3,8 +3,13 @@

    Project [% curProject.name %]

    +

    Description: [% curProject.description %]

    + +

    Definition

    +[% IF curProject.jobsets.size > 0 %] + [% FOREACH jobset IN curProject.jobsets -%]

    Jobset [% jobset.name %]

    @@ -49,15 +54,29 @@ [% END -%] +[% ELSE %] + +

    No jobsets have been defined yet.

    + +[% END %] +

    Jobs

    +[% IF jobNames.size > 0 %] + +[% ELSE %] + +

    No builds have been performed or scheduled.

    + +[% END %] +

    Statistics