From 1038e2ebee64d800bdf790d9459a32678a8e6108 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 26 Oct 2009 12:04:12 +0000 Subject: [PATCH] * Allow the description of a release member to be edited, and to delete a release member. --- src/lib/Hydra/Controller/Release.pm | 10 +++++++++- src/root/edit-release.tt | 23 ++++++++++++++++++++--- src/root/static/css/hydra.css | 4 ++++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/lib/Hydra/Controller/Release.pm b/src/lib/Hydra/Controller/Release.pm index c4fe0798..ba9f0e80 100644 --- a/src/lib/Hydra/Controller/Release.pm +++ b/src/lib/Hydra/Controller/Release.pm @@ -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; }); diff --git a/src/root/edit-release.tt b/src/root/edit-release.tt index b1f3eb75..63e29b51 100644 --- a/src/root/edit-release.tt +++ b/src/root/edit-release.tt @@ -19,10 +19,27 @@

Release Members

-

+

Note: to add a build to this release, go to the build’s + information page and click on “Add to release”.

-

Note: to add a build to this release, you can also go to - the build’s information page and click on “Add to release”.

+ [% FOREACH m IN release.releasemembers %] + +
+ +

Build [% m.build.id %]

+ + + + + + +
Label: m.description) %] />
+ +
+ + [% END %] + +

diff --git a/src/root/static/css/hydra.css b/src/root/static/css/hydra.css index 1fff771e..9d5c10db 100644 --- a/src/root/static/css/hydra.css +++ b/src/root/static/css/hydra.css @@ -139,6 +139,10 @@ input.shortString { width: 7em; } +input.longString { + width: 40em; +} + select { background-color: #fffff0; }