diff --git a/src/lib/Hydra/Controller/Release.pm b/src/lib/Hydra/Controller/Release.pm index 3cd794e5..c4fe0798 100644 --- a/src/lib/Hydra/Controller/Release.pm +++ b/src/lib/Hydra/Controller/Release.pm @@ -47,24 +47,23 @@ sub edit : Chained('release') PathPart('edit') Args(0) { sub submit : Chained('release') PathPart('submit') Args(0) { my ($self, $c) = @_; - requireProjectOwner($c, $c->stash->{project}); - txn_do($c->model('DB')->schema, sub { - updateRelease($c, $c->stash->{release}); - }); - $c->res->redirect($c->uri_for($self->action_for("view"), - [$c->stash->{project}->name, $c->stash->{release}->name])); -} - - -sub delete : Chained('release') PathPart('delete') Args(0) { - my ($self, $c) = @_; - requireProjectOwner($c, $c->stash->{project}); - txn_do($c->model('DB')->schema, sub { - $c->stash->{release}->delete; - }); - $c->res->redirect($c->uri_for($c->controller('Project')->action_for('releases'), - [$c->stash->{project}->name])); -} - + requireProjectOwner($c, $c->stash->{project}); + + if ($c->request->params->{action} eq "delete") { + txn_do($c->model('DB')->schema, sub { + $c->stash->{release}->delete; + }); + $c->res->redirect($c->uri_for($c->controller('Project')->action_for('releases'), + [$c->stash->{project}->name])); + } else { + txn_do($c->model('DB')->schema, sub { + updateRelease($c, $c->stash->{release}); + }); + $c->res->redirect($c->uri_for($self->action_for("view"), + [$c->stash->{project}->name, $c->stash->{release}->name])); + } +} + + 1; diff --git a/src/root/edit-release.tt b/src/root/edit-release.tt index c8af301e..b1f3eb75 100644 --- a/src/root/edit-release.tt +++ b/src/root/edit-release.tt @@ -17,25 +17,25 @@ -

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

+

Release Members

-

+

+ +

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

+ +

+ + [% IF !create %] + + + [% END %] +

-[% IF !create %] - -
-

Delete this release

- - - - -[% END %] - [% END %]