diff --git a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm index 866e044c..baf2c1d2 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm @@ -36,9 +36,21 @@ sub index :Path :Args(0) { } +sub project :Local { + my ( $self, $c, $projectName ) = @_; + $c->stash->{template} = 'project.tt'; + (my $project) = $c->model('DB::Projects')->search({ name => $projectName }); + return error($c, "Project $projectName doesn't exist.") if !defined $project; + $c->stash->{project} = $project; + $c->stash->{jobNames} = + [$c->model('DB::Builds')->search({project => $projectName}, {select => [{distinct => 'attrname'}], as => ['attrname']})]; +} + + sub job :Local { my ( $self, $c, $project, $jobName ) = @_; $c->stash->{template} = 'job.tt'; + $c->stash->{projectName} = $project; $c->stash->{jobName} = $jobName; $c->stash->{builds} = [$c->model('DB::Builds')->search({project => $project, attrName => $jobName}, {order_by => "timestamp DESC"})]; } diff --git a/src/HydraFrontend/root/build.tt b/src/HydraFrontend/root/build.tt index 95460ae9..e3a2e50c 100644 --- a/src/HydraFrontend/root/build.tt +++ b/src/HydraFrontend/root/build.tt @@ -13,7 +13,7 @@
Id | Project | Job | System | Timestamp | Description | [% build.id %] | [% build.project %] | -[% build.jobset %]:[% build.attrname %] | +[% build.attrname %] | [% build.system %] | [% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %] | [% build.description %] |
---|