* Allow the description of a release member to be edited, and to

delete a release member.
This commit is contained in:
Eelco Dolstra 2009-10-26 12:04:12 +00:00
parent 578e37d55c
commit 1038e2ebee
3 changed files with 33 additions and 4 deletions

View file

@ -35,6 +35,14 @@ sub updateRelease {
{ name => $releaseName
, description => trim $c->request->params->{description}
});
$release->releasemembers->delete_all;
foreach my $param (keys %{$c->request->params}) {
next unless $param =~ /^member-(\d+)-description$/;
my $buildId = $1;
my $description = trim $c->request->params->{"member-$buildId-description"};
$release->releasemembers->create({ build => $buildId, description => $description });
}
}
@ -50,7 +58,7 @@ sub submit : Chained('release') PathPart('submit') Args(0) {
requireProjectOwner($c, $c->stash->{project});
if ($c->request->params->{action} eq "delete") {
if (($c->request->params->{action} || "") eq "delete") {
txn_do($c->model('DB')->schema, sub {
$c->stash->{release}->delete;
});

View file

@ -19,10 +19,27 @@
<h3>Release Members</h3>
<p><button type="button" class="add-member">Add a build</button></p>
<p><em>Note:</em> to add a build to this release, go to the builds
information page and click on “Add to release”.</p>
<p><em>Note:</em> to add a build to this release, you can also go to
the builds information page and click on “Add to release”.</p>
[% FOREACH m IN release.releasemembers %]
<div class="releaseMember">
<h4>Build [% m.build.id %] <button type="button" onclick='$(this).parents(".releaseMember").remove()'><img src="/static/images/failure.gif" alt="Delete input" /></button></h4>
<table class="layoutTable">
<tr>
<th>Label:</th>
<td><input type="text" class="string longString" name="member-[% m.build.id %]-description" [% HTML.attributes(value => m.description) %] /></td>
</tr>
</table>
</div>
[% END %]
<hr />
<p>
<button type="submit"><img alt="Apply" src="/static/images/success.gif" />[%IF create %]Create[% ELSE %]Apply changes[% END %]</button>

View file

@ -139,6 +139,10 @@ input.shortString {
width: 7em;
}
input.longString {
width: 40em;
}
select {
background-color: #fffff0;
}