TMP2FRIWXSSLCWOODKHRCVVCF26O7IXGB5KERZNOL5P5L26SHKMQC
$releaseSet->releasesetjobs->delete_all;
foreach my $param (keys %{$c->request->params}) {
next unless $param =~ /^job-(\d+)-name$/;
my $baseName = $1;
my $name = trim $c->request->params->{"job-$baseName-name"};
my $description = trim $c->request->params->{"job-$baseName-description"};
my $attrs = trim $c->request->params->{"job-$baseName-attrs"};
$releaseSet->releasesetjobs->create(
{ job => $name
, description => $description
, attrs => $attrs
, isprimary => $c->request->params->{"primary"} eq $baseName
});
}
die "There must be one primary job." if $releaseSet->releasesetjobs->search({isprimary => 1})->count != 1;
</table>
<table class="tablesorter">
<thead>
<tr>
<th>Primary job</th>
<th>Job name</th>
<th>Description</th>
<th>Constraint</th>
</tr>
</thead>
<tbody>
[% n = 0 %]
[% FOREACH job IN jobs %]
<tr>
<td><input type="radio" name="primary" [% IF job.isprimary %]
checked="checked" [% END %] [% HTML.attributes(value => "$n") %] /> [% n %]</td>
<td><input type="text" class="string" [% HTML.attributes(name => "job-$n-name", value => job.job) %] /></td>
<td><input type="text" class="string" [% HTML.attributes(name => "job-$n-description", value => job.description) %] /></td>
<td><input type="text" class="string" [% HTML.attributes(name => "job-$n-attrs", value => job.attrs) %] /></td>
</tr>
[% n = n + 1 %]
[% END %]
</tbody>