diff --git a/src/lib/Hydra/Controller/Project.pm b/src/lib/Hydra/Controller/Project.pm index 65d4e0ee..e46e1e73 100644 --- a/src/lib/Hydra/Controller/Project.pm +++ b/src/lib/Hydra/Controller/Project.pm @@ -14,7 +14,7 @@ sub project : Chained('/') PathPart('project') CaptureArgs(1) { or notFound($c, "Project $projectName doesn't exist."); $c->stash->{project} = $project; - $c->stash->{jobsets} = [$project->jobsets->search({},{ order_by => "name" })]; + } @@ -26,6 +26,15 @@ sub view : Chained('project') PathPart('') Args(0) { #getBuildStats($c, scalar $c->stash->{project}->builds); $c->stash->{views} = [$c->stash->{project}->views->all]; + $c->stash->{jobsets} = [$c->stash->{project}->jobsets->search({}, + { order_by => "name" + , "+select" => [ + "(SELECT COUNT(*) FROM Builds AS a NATURAL JOIN BuildSchedulingInfo WHERE me.project = a.project AND me.name = a.jobset AND a.isCurrent = 1 )" + , "(SELECT COUNT(*) FROM Builds AS a NATURAL JOIN BuildResultInfo WHERE me.project = a.project AND me.name = a.jobset AND buildstatus <> 0 AND a.isCurrent = 1 )" + , "(SELECT COUNT(*) FROM Builds AS a NATURAL JOIN BuildResultInfo WHERE me.project = a.project AND me.name = a.jobset AND buildstatus = 0 AND a.isCurrent = 1 )" + ] + , "+as" => ["nrscheduled", "nrfailed", "nrsucceeded"] + })]; } diff --git a/src/root/project.tt b/src/root/project.tt index 03f4f96c..867e09bd 100644 --- a/src/root/project.tt +++ b/src/root/project.tt @@ -1,6 +1,5 @@ [% WRAPPER layout.tt title=(edit ? (create ? "New Project" : "Editing Project ‘$project.name’") : "Project ‘$project.name’") %] [% PROCESS common.tt %] - [% IF create %]
Id | Description | Last evaluated | @@ -40,9 +40,20 @@ [% FOREACH j IN jobsets %]||
---|---|---|---|---|
+ [% IF j.get_column('nrscheduled') > 0 %] + + [% ELSIF j.get_column('nrfailed') == 0 %] + + [% ELSIF j.get_column('nrfailed') > 0 && j.get_column('nrsucceeded') > 0 %] + + [% ELSE %] + + [% END %] + | [% INCLUDE renderJobsetName project = project.name jobset = j.name %] | [% HTML.escape(j.description) %] | -[% INCLUDE renderDateTime timestamp = j.lastcheckedtime %] | +[% INCLUDE renderDateTime timestamp = j.lastcheckedtime %] |