Add progress indicator to batch execution.
Also disable Execute button immediately when clicked.
This commit is contained in:
parent
e01e323d3e
commit
6c5eec7981
2 changed files with 80 additions and 5 deletions
|
@ -1,3 +1,27 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="/batch/crud.mako" />
|
||||
|
||||
<%def name="head_tags()">
|
||||
${parent.head_tags()}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('#execute-batch').click(function() {
|
||||
$(this).button('option', 'label', "Executing, please wait...").button('disable');
|
||||
location.href = '${url('{0}.execute'.format(route_prefix), uuid=batch.uuid)}';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
<%def name="buttons()">
|
||||
<div class="buttons">
|
||||
% if not form.readonly and batch.refreshable:
|
||||
${h.submit('save-refresh', "Save & Refresh Data")}
|
||||
% endif
|
||||
% if not batch.executed and request.has_perm('{0}.execute'.format(permission_prefix)):
|
||||
<button type="button" id="execute-batch"${'' if execute_enabled else ' disabled="disabled"'}>${execute_title}</button>
|
||||
% endif
|
||||
</div>
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue