diff --git a/src/lib/Hydra/Controller/Project.pm b/src/lib/Hydra/Controller/Project.pm index 8cdd912b..d9f686a3 100644 --- a/src/lib/Hydra/Controller/Project.pm +++ b/src/lib/Hydra/Controller/Project.pm @@ -26,6 +26,8 @@ sub view : Chained('project') PathPart('') Args(0) { $c->stash->{views} = [$c->stash->{project}->views->all]; $c->stash->{jobsets} = [jobsetOverview($c, $c->stash->{project})]; + $c->stash->{releases} = [$c->stash->{project}->releases->search({}, + {order_by => ["timestamp DESC"]})]; } @@ -235,14 +237,6 @@ sub create_view : Chained('project') PathPart('create-view') Args(0) { } -sub releases : Chained('project') PathPart('releases') Args(0) { - my ($self, $c) = @_; - $c->stash->{template} = 'releases.tt'; - $c->stash->{releases} = [$c->stash->{project}->releases->search({}, - {order_by => ["timestamp DESC"]})]; -} - - sub create_release : Chained('project') PathPart('create-release') Args(0) { my ($self, $c) = @_; requireProjectOwner($c, $c->stash->{project}); diff --git a/src/lib/Hydra/Controller/Release.pm b/src/lib/Hydra/Controller/Release.pm index 322dd417..665de3bc 100644 --- a/src/lib/Hydra/Controller/Release.pm +++ b/src/lib/Hydra/Controller/Release.pm @@ -66,7 +66,7 @@ sub submit : Chained('release') PathPart('submit') Args(0) { txn_do($c->model('DB')->schema, sub { $c->stash->{release}->delete; }); - $c->res->redirect($c->uri_for($c->controller('Project')->action_for('releases'), + $c->res->redirect($c->uri_for($c->controller('Project')->action_for('view'), [$c->stash->{project}->name])); } else { txn_do($c->model('DB')->schema, sub { diff --git a/src/root/project.tt b/src/root/project.tt index 4dd8fcae..5dafa589 100644 --- a/src/root/project.tt +++ b/src/root/project.tt @@ -4,6 +4,7 @@
@@ -108,6 +109,44 @@ +This project has no releases yet.
+ + [% ELSE %] + +This project has made the following releases:
+ +Name | +Date | +
---|---|
[% release.name %] | +[% INCLUDE renderDateTime timestamp = release.timestamp %] | +
This project has no releases yet.
- -[% ELSE %] - -This project has made the following releases:
- -Name | -Date | -
---|---|
[% release.name %] | -[% INCLUDE renderDateTime timestamp = release.timestamp %] | -