Disable delete button by default, when clicked
This commit is contained in:
parent
7e3d47aa5c
commit
1327b886fc
|
@ -3,6 +3,20 @@
|
|||
|
||||
<%def name="title()">Delete ${model_title}: ${instance_title}</%def>
|
||||
|
||||
<%def name="head_tags()">
|
||||
${parent.head_tags()}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
$('#confirm-delete').click(function() {
|
||||
$(this).button('disable').button('option', 'label', "Deleting, please wait...");
|
||||
$(this).parents('form').submit();
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
<li>${h.link_to("Back to {}".format(model_title_plural), url(route_prefix))}</li>
|
||||
% if master.viewable and request.has_perm('{}.view'.format(permission_prefix)):
|
||||
|
@ -19,11 +33,12 @@
|
|||
<%def name="confirmation()">
|
||||
<br />
|
||||
<p>Are you sure about this?</p>
|
||||
<br />
|
||||
|
||||
${h.form(request.current_route_url())}
|
||||
<div class="buttons">
|
||||
<button type="button" onclick="$(this).parents('form').submit();">Yes, please DELETE this record forever!</button>
|
||||
<a class="button" href="${form.cancel_url}">Whoops, nevermind...</a>
|
||||
<button type="button" id="confirm-delete">Yes, please DELETE this data forever!</button>
|
||||
</div>
|
||||
${h.end_form()}
|
||||
</%def>
|
||||
|
@ -32,7 +47,8 @@
|
|||
${self.context_menu_items()}
|
||||
</ul>
|
||||
|
||||
<p>You are about to delete the following ${model_title} record:</p>
|
||||
<br />
|
||||
<p>You are about to delete the following ${model_title} and all associated data:</p>
|
||||
|
||||
<div class="form-wrapper">
|
||||
${form.render()|n}
|
||||
|
|
Loading…
Reference in a new issue