diff --git a/tailbone/static/js/tailbone.batch.js b/tailbone/static/js/tailbone.batch.js new file mode 100644 index 00000000..d45fccfc --- /dev/null +++ b/tailbone/static/js/tailbone.batch.js @@ -0,0 +1,44 @@ + +/************************************************************ + * + * tailbone.batch.js + * + * Common logic for view/edit batch pages + * + ************************************************************/ + + +$(function() { + + $('.newgrid-wrapper').gridwrapper(); + + $('#execute-batch').click(function() { + if (has_execution_options) { + $('#execution-options-dialog').dialog({ + title: "Execution Options", + width: 500, + height: 300, + modal: true, + buttons: [ + { + text: "Execute", + click: function(event) { + $(event.target).button('option', 'label', "Executing, please wait...").button('disable'); + $('form[name="batch-execution"]').submit(); + } + }, + { + text: "Cancel", + click: function() { + $(this).dialog('close'); + } + } + ] + }); + } else { + $(this).button('option', 'label', "Executing, please wait...").button('disable'); + $('form[name="batch-execution"]').submit(); + } + }); + +}); diff --git a/tailbone/templates/newbatch/edit.mako b/tailbone/templates/newbatch/edit.mako index 436793a7..f448e085 100644 --- a/tailbone/templates/newbatch/edit.mako +++ b/tailbone/templates/newbatch/edit.mako @@ -4,10 +4,12 @@ <%def name="head_tags()"> ${parent.head_tags()} ${h.javascript_link(request.static_url('tailbone:static/js/jquery.ui.tailbone.js'))} + ${h.javascript_link(request.static_url('tailbone:static/js/tailbone.batch.js'))}