From 08f3b7bf2ad3308411795589f33231e505abd490 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 8 Oct 2009 08:54:42 +0000 Subject: [PATCH] * Use isCurrent to determine the inactive jobs. --- src/lib/Hydra/Controller/Jobset.pm | 12 ++++++++++-- src/root/jobset.tt | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm index cd461696..4ddc0ef5 100644 --- a/src/lib/Hydra/Controller/Jobset.pm +++ b/src/lib/Hydra/Controller/Jobset.pm @@ -28,8 +28,16 @@ sub index : Chained('jobset') PathPart('') Args(0) { getBuildStats($c, scalar $c->stash->{jobset}->builds); - $c->stash->{activeJobs} = [$c->stash->{jobset}->builds->search({isCurrent => 1}, {select => ["job"], distinct => 1})]; - $c->stash->{inactiveJobs} = [$c->stash->{jobset}->jobs->search({active => 0})]; + $c->stash->{activeJobs} = [ + $c->stash->{jobset}->builds->search( + {isCurrent => 1}, + {select => ["job"], order_by => ["job"], distinct => 1} + )]; + $c->stash->{inactiveJobs} = [ + $c->stash->{jobset}->builds->search( + {}, + {select => ["job"], order_by => ["job"], group_by => ["job"], having => { 'sum(isCurrent)' => 0 }} + )]; } diff --git a/src/root/jobset.tt b/src/root/jobset.tt index 07c6f543..705c08bf 100644 --- a/src/root/jobset.tt +++ b/src/root/jobset.tt @@ -126,7 +126,7 @@
[% IF inactiveJobs.size == 0 %](none)[% END %] - [% FOREACH j IN inactiveJobs %] [% INCLUDE renderJobName project=project.name jobset=jobset.name job=j.name %] [% END %] + [% FOREACH j IN inactiveJobs %] [% INCLUDE renderJobName project=project.name jobset=jobset.name job=j.get_column('job') %] [% END %]