Add support for executing batch with options, via mobile

This commit is contained in:
Lance Edgar 2018-02-22 11:20:12 -06:00
parent 0a165c5b93
commit 3d79f9fd7d
3 changed files with 38 additions and 13 deletions

View file

@ -0,0 +1,10 @@
## -*- coding: utf-8; -*-
<%inherit file="/mobile/base.mako" />
<%def name="title()">${index_title} &raquo; ${instance_title} &raquo; Execute</%def>
<%def name="page_title()">${h.link_to(index_title, index_url)} &raquo; ${h.link_to(instance_title, instance_url)} &raquo; Execute</%def>
<div class="form-wrapper">
${form.render()|n}
</div><!-- form-wrapper -->

View file

@ -28,9 +28,13 @@ ${parent.body()}
% endif
% endif
% if batch.complete and master.mobile_executable and request.has_perm('{}.execute'.format(permission_prefix)):
${h.form(url('mobile.{}.execute'.format(route_prefix), uuid=batch.uuid))}
${h.csrf_token(request)}
${h.submit('submit', "Execute Batch")}
${h.end_form()}
% if master.has_execution_options(batch):
${h.link_to("Execute Batch", url('mobile.{}.execute'.format(route_prefix), uuid=batch.uuid), class_='ui-btn ui-corner-all')}
% else:
${h.form(url('mobile.{}.execute'.format(route_prefix), uuid=batch.uuid))}
${h.csrf_token(request)}
${h.submit('submit', "Execute Batch")}
${h.end_form()}
% endif
% endif
% endif