From f816a5a28d6fd248ff98876c406e4c35dd8e3d38 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 7 Mar 2010 11:38:39 +0000 Subject: [PATCH] * Only include the system type in URLs if there are multiple jobs with the same name. --- src/lib/Hydra/Controller/View.pm | 4 ++++ src/root/view-result.tt | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Controller/View.pm b/src/lib/Hydra/Controller/View.pm index ca3dd2f0..5857bd75 100644 --- a/src/lib/Hydra/Controller/View.pm +++ b/src/lib/Hydra/Controller/View.pm @@ -162,6 +162,10 @@ sub result : Chained('view') PathPart('') { my $result = getViewResult($primaryBuild, $c->stash->{jobs}); $c->stash->{result} = $result; + my %jobNames; + $jobNames{$_->{job}->job}++ foreach @{$result->{jobs}}; + $c->stash->{jobNames} = \%jobNames; + if (scalar @args == 1 && $args[0] eq "release") { requireProjectOwner($c, $c->stash->{project}); diff --git a/src/root/view-result.tt b/src/root/view-result.tt index 413aa771..53f5a9e1 100644 --- a/src/root/view-result.tt +++ b/src/root/view-result.tt @@ -27,7 +27,9 @@ [% IF j.build.resultInfo.buildstatus == 0 %] [% IF j.build.buildproducts %] - [% INCLUDE renderProductList build=j.build latestRoot=['/view' project.name view.name 'latest' "${j.job.job}-${j.build.system}"] %] + [% p = jobNames.${j.job.job} > 1 ? "-${j.build.system}" : ""; + INCLUDE renderProductList build=j.build latestRoot=['/view' project.name view.name 'latest' "${j.job.job}${p}"] + %] [% ELSE %]

Succeeded.

[% END %]