* Urgh. `-' had special significance in HTML form parameters...

This commit is contained in:
Eelco Dolstra 2009-03-19 15:41:33 +00:00
parent af1e60a043
commit 163f3de2fa
2 changed files with 6 additions and 4 deletions

View file

@ -151,8 +151,8 @@ sub updateProject {
, nixexprinput => $nixExprInput
});
} else { # it's an existing jobset
$jobset = ($project->jobsets->search({name => $baseName}))[0];
die unless defined $jobset;
my $oldName = trim $c->request->params->{"jobset-$baseName-oldName"};
$jobset = ($project->jobsets->search({name => $oldName}))[0] or die;
$jobset->update(
{ name => $jobsetName, description => $description
, nixexprpath => $nixExprPath, nixexprinput => $nixExprInput });

View file

@ -67,6 +67,8 @@
<div class="jobset[% IF edit %] jobset-edit[% END %]" id="[% "jobset-$baseName" %]">
<input type="hidden" [% HTML.attributes(name => "jobset-$baseName-oldName", value => jobset.name) %] />
<h3>
[% IF edit %]<button type="button" onclick='$(this).parents(".jobset").remove()'><img src="/static/images/failure.gif" alt="Delete value" /></button>[% END %]
[% IF jobset %]Jobset <tt>[% jobset.name %]</tt>[% ELSE %]New jobset[% END %]
@ -250,8 +252,8 @@
</script>
[% END %]
[% FOREACH jobset IN project.jobsets -%]
[% INCLUDE renderJobset jobset=jobset baseName=jobset.name %]
[% n = 0; FOREACH jobset IN project.jobsets -%]
[% INCLUDE renderJobset jobset=jobset baseName="e$n"; n = n + 1 %]
[% END -%]
[% ELSE %]