diff --git a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm index c712a696..f000cbf9 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm @@ -29,7 +29,10 @@ sub getBuild { sub index :Path :Args(0) { my ( $self, $c ) = @_; $c->stash->{template} = 'index.tt'; - $c->stash->{builds} = [$c->model('DB::Builds')->all]; + $c->stash->{allBuilds} = [$c->model('DB::Builds')->all]; + # Get the latest build for each unique job. + # select * from builds as x where timestamp == (select max(timestamp) from builds where name == x.name); + $c->stash->{latestBuilds} = [$c->model('DB::Builds')->search(undef, {order_by => "name", where => "timestamp == (select max(timestamp) from builds where name == me.name)"})]; } @@ -44,7 +47,7 @@ sub build :Local { my $build = getBuild($c, $id); return error($c, "Build with ID $id doesn't exist.") if !defined $build; - + $c->stash->{template} = 'build.tt'; $c->stash->{build} = $build; $c->stash->{id} = $id; diff --git a/src/HydraFrontend/root/index.tt b/src/HydraFrontend/root/index.tt index 47266085..d9286c96 100644 --- a/src/HydraFrontend/root/index.tt +++ b/src/HydraFrontend/root/index.tt @@ -1,24 +1,23 @@ [% WRAPPER layout.tt title="Hydra Overview" %] [% USE date %] -
Id | Attribute name | Timestamp | Description | |
---|---|---|---|---|
- [% IF build.buildstatus == 0 %] - - [% ELSE %] - - [% END %] - | -[% build.id %] | -[% build.name %] | -[% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %] | -[% build.description %] | -
Number of builds: [% allBuilds.size %]
+ +Id | Attribute name | Timestamp | Description |
---|