From 08798f3c07e68e1330b75281328b1ed5a3ca992d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 28 Oct 2008 15:34:29 +0000 Subject: [PATCH] * Some jQuery / CSS hackery. --- .../lib/HydraFrontend/Controller/Root.pm | 8 +++++ src/HydraFrontend/root/hydra.css | 28 +++++++++++++++++- src/HydraFrontend/root/index.tt | 29 ++++++++++++------- src/HydraFrontend/root/job.tt | 12 ++++++++ src/HydraFrontend/root/layout.tt | 10 +++++++ src/HydraFrontend/root/short-build-info.tt | 15 ++++++++++ 6 files changed, 90 insertions(+), 12 deletions(-) create mode 100644 src/HydraFrontend/root/job.tt create mode 100644 src/HydraFrontend/root/short-build-info.tt diff --git a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm index f000cbf9..365a6fe1 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm @@ -36,6 +36,14 @@ sub index :Path :Args(0) { } +sub job :Local { + my ( $self, $c, $jobName ) = @_; + $c->stash->{template} = 'job.tt'; + $c->stash->{jobName} = $jobName; + $c->stash->{builds} = [$c->model('DB::Builds')->search({name => $jobName}, {order_by => "timestamp DESC"})]; +} + + sub default :Path { my ( $self, $c ) = @_; error($c, "Page not found."); diff --git a/src/HydraFrontend/root/hydra.css b/src/HydraFrontend/root/hydra.css index ca2e6948..28474860 100644 --- a/src/HydraFrontend/root/hydra.css +++ b/src/HydraFrontend/root/hydra.css @@ -150,4 +150,30 @@ span.error-msg { pre.buildlog { border: 1px solid black; padding: 0.3em; -} \ No newline at end of file +} + + +/* Sortable tables */ + +table.tablesorter { + text-align: left; + +} +table.tablesorter thead tr .header { + background-image: url(/static/js/tablesorter/themes/blue/bg.gif); + background-repeat: no-repeat; + background-position: center right; + cursor: pointer; +} + +table.tablesorter thead tr .headerSortUp { + background-image: url(/static/js/tablesorter/themes/blue/asc.gif); +} + +table.tablesorter thead tr .headerSortDown { + background-image: url(/static/js/tablesorter/themes/blue/desc.gif); +} + +table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp { + background-color: #ffe000; +} diff --git a/src/HydraFrontend/root/index.tt b/src/HydraFrontend/root/index.tt index d9286c96..41da1a36 100644 --- a/src/HydraFrontend/root/index.tt +++ b/src/HydraFrontend/root/index.tt @@ -1,24 +1,31 @@ [% WRAPPER layout.tt title="Hydra Overview" %] -[% USE date %]

Job status

- - - [% FOREACH build IN latestBuilds -%] - [% INCLUDE "short-build-info.tt" %] - [% END -%] +
IdAttribute nameTimestampDescription
+ + + + + [% FOREACH build IN latestBuilds -%] + [% INCLUDE "short-build-info.tt" %] + [% END -%] +
IdJobTimestampDescription

All builds

Number of builds: [% allBuilds.size %]

- - - [% FOREACH build IN allBuilds -%] - [% INCLUDE "short-build-info.tt" %] - [% END -%] +
IdAttribute nameTimestampDescription
+ + + + + [% FOREACH build IN allBuilds -%] + [% INCLUDE "short-build-info.tt" %] + [% END -%] +
#JobTimestampDescription
[% END %] diff --git a/src/HydraFrontend/root/job.tt b/src/HydraFrontend/root/job.tt new file mode 100644 index 00000000..33932347 --- /dev/null +++ b/src/HydraFrontend/root/job.tt @@ -0,0 +1,12 @@ +[% WRAPPER layout.tt title="Hydra Overview" %] + +

All builds for job [% jobName %]

+ + + + [% FOREACH build IN builds -%] + [% INCLUDE "short-build-info.tt" %] + [% END -%] +
IdJobTimestampDescription
+ +[% END %] diff --git a/src/HydraFrontend/root/layout.tt b/src/HydraFrontend/root/layout.tt index 8197c94f..ca2da4d9 100644 --- a/src/HydraFrontend/root/layout.tt +++ b/src/HydraFrontend/root/layout.tt @@ -8,6 +8,16 @@ [% title %] + + + diff --git a/src/HydraFrontend/root/short-build-info.tt b/src/HydraFrontend/root/short-build-info.tt new file mode 100644 index 00000000..e8f1a43b --- /dev/null +++ b/src/HydraFrontend/root/short-build-info.tt @@ -0,0 +1,15 @@ +[% USE date %] + + + + [% IF build.buildstatus == 0 %] + + [% ELSE %] + + [% END %] + + [% build.id %] + [% build.name %] + [% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %] + [% build.description %] +