diff --git a/src/Hydra/lib/Hydra/Controller/Root.pm b/src/Hydra/lib/Hydra/Controller/Root.pm index 8d35fb8f..59459703 100644 --- a/src/Hydra/lib/Hydra/Controller/Root.pm +++ b/src/Hydra/lib/Hydra/Controller/Root.pm @@ -286,6 +286,8 @@ sub updateReleaseSet { my $description = trim $c->request->params->{"job-$baseName-description"}; my $attrs = trim $c->request->params->{"job-$baseName-attrs"}; + die "Invalid job name: $name" unless $name =~ /^\w+$/; + $releaseSet->releasesetjobs->create( { job => $name , description => $description diff --git a/src/Hydra/root/edit-releaseset.tt b/src/Hydra/root/edit-releaseset.tt index 2b835935..387bd81e 100644 --- a/src/Hydra/root/edit-releaseset.tt +++ b/src/Hydra/root/edit-releaseset.tt @@ -4,6 +4,23 @@

Release Set [% curProject.name %]:[% releaseSet.name %]

+ +[% BLOCK renderJob %] + + + + + "$n") %] /> [% n %] + "$baseName-name", name => "$baseName-name", value => job.job) %] /> + "$baseName-description", name => "$baseName-description", value => job.description) %] /> + "$baseName-attrs", name => "$baseName-attrs", value => job.attrs) %] /> + +[% END %] + +
@@ -20,6 +37,7 @@
+ @@ -29,15 +47,12 @@ [% n = 0 %] [% FOREACH job IN jobs %] - - - - - - + [% INCLUDE renderJob baseName="job-$n" %] [% n = n + 1 %] [% END %] + + +
Primary job Job name Description
"$n") %] /> [% n %] "job-$n-name", value => job.job) %] /> "job-$n-description", value => job.description) %] /> "job-$n-attrs", value => job.attrs) %] />
@@ -46,4 +61,27 @@
+ + [% INCLUDE renderJob job="" id="job-template" baseName="job-template" %] +
+ + + + + [% END %]