* Align the apply/delete buttons.

This commit is contained in:
Eelco Dolstra 2009-10-26 10:35:59 +00:00
parent 7e81fbd56a
commit f984eed77b
2 changed files with 35 additions and 36 deletions

View file

@ -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;

View file

@ -17,25 +17,25 @@
</tr>
</table>
<p><em>Note:</em> to add a build to this release, go to the builds
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>
<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>
<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 %]
</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>
<script type="text/javascript">
$("#delete-release").click(function() {
return confirm("Are you sure you want to delete this release?");
});
</script>
[% END %]
[% END %]