forked from lix-project/hydra
* Align the apply/delete buttons.
This commit is contained in:
parent
7e81fbd56a
commit
f984eed77b
|
@ -47,23 +47,22 @@ 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});
|
||||
|
||||
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]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -17,25 +17,25 @@
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<p><em>Note:</em> to add a build to this release, go to the build’s
|
||||
information page and click on “Add to release”.</p>
|
||||
<h3>Release Members</h3>
|
||||
|
||||
<p><button type="submit"><img src="/static/images/success.gif" />[%IF create %]Create[% ELSE %]Apply changes[% END %]</button></p>
|
||||
<p><button type="button" class="add-member">Add a build</button></p>
|
||||
|
||||
</form>
|
||||
|
||||
[% IF !create %]
|
||||
|
||||
<form action="[% c.uri_for('/release' project.name release.name 'delete') %]" method="post">
|
||||
<p><a id="delete-release" type="submit"><img src="/static/images/failure.gif" />Delete this release</button></p>
|
||||
</form>
|
||||
<p><em>Note:</em> to add a build to this release, you can also go to
|
||||
the build’s information page and click on “Add to release”.</p>
|
||||
|
||||
<p>
|
||||
<button type="submit"><img alt="Apply" src="/static/images/success.gif" />[%IF create %]Create[% ELSE %]Apply changes[% END %]</button>
|
||||
[% IF !create %]
|
||||
<button id="delete-release" type="submit" name="action" value="delete"><img alt="Delete" src="/static/images/failure.gif" />Delete this release</button>
|
||||
<script type="text/javascript">
|
||||
$("#delete-release").click(function() {
|
||||
return confirm("Are you sure you want to delete this release?");
|
||||
});
|
||||
</script>
|
||||
|
||||
[% END %]
|
||||
[% END %]
|
||||
</p>
|
||||
|
||||
</form>
|
||||
|
||||
[% END %]
|
||||
|
|
Loading…
Reference in a new issue