diff --git a/tailbone/templates/batch/handheld/index.mako b/tailbone/templates/batch/handheld/index.mako deleted file mode 100644 index 72096c98..00000000 --- a/tailbone/templates/batch/handheld/index.mako +++ /dev/null @@ -1,68 +0,0 @@ -## -*- coding: utf-8; -*- -<%inherit file="/batch/index.mako" /> - -<%def name="extra_javascript()"> - ${parent.extra_javascript()} - - - -<%def name="grid_tools()"> - % if request.has_perm('batch.handheld.execute_results'): - - % endif - - -${parent.body()} - - diff --git a/tailbone/templates/batch/index.mako b/tailbone/templates/batch/index.mako index 9fe16c87..049e4f8e 100644 --- a/tailbone/templates/batch/index.mako +++ b/tailbone/templates/batch/index.mako @@ -1,4 +1,71 @@ ## -*- coding: utf-8; -*- <%inherit file="/master/index.mako" /> +<%def name="extra_javascript()"> + ${parent.extra_javascript()} + % if master.results_executable and request.has_perm('{}.execute_results'.format(permission_prefix)): + + % endif + + +<%def name="grid_tools()"> + % if master.results_executable and request.has_perm('{}.execute_results'.format(permission_prefix)): + + % endif + + ${parent.body()} + +% if master.results_executable and master.has_execution_options(batch) and request.has_perm('{}.execute_results'.format(permission_prefix)): + +% endif diff --git a/tailbone/views/batch/core.py b/tailbone/views/batch/core.py index a83b4e73..c06937fa 100644 --- a/tailbone/views/batch/core.py +++ b/tailbone/views/batch/core.py @@ -68,6 +68,7 @@ class BatchMasterView(MasterView): edit_with_rows = False cloneable = False executable = True + results_executable = False supports_mobile = True mobile_filterable = True mobile_rows_viewable = True @@ -986,11 +987,12 @@ class BatchMasterView(MasterView): permission='{}.edit'.format(permission_prefix)) # execute (multiple) batch results - config.add_route('{}.execute_results'.format(route_prefix), '{}/execute-results'.format(url_prefix)) - config.add_view(cls, attr='execute_results', route_name='{}.execute_results'.format(route_prefix), - permission='{}.execute_multiple'.format(permission_prefix)) - config.add_tailbone_permission(permission_prefix, '{}.execute_multiple'.format(permission_prefix), - "Execute multiple {}".format(model_title_plural)) + if cls.results_executable: + config.add_route('{}.execute_results'.format(route_prefix), '{}/execute-results'.format(url_prefix)) + config.add_view(cls, attr='execute_results', route_name='{}.execute_results'.format(route_prefix), + permission='{}.execute_multiple'.format(permission_prefix)) + config.add_tailbone_permission(permission_prefix, '{}.execute_multiple'.format(permission_prefix), + "Execute multiple {}".format(model_title_plural)) class FileBatchMasterView(BatchMasterView): diff --git a/tailbone/views/handheld.py b/tailbone/views/handheld.py index c117c795..4487c6a3 100644 --- a/tailbone/views/handheld.py +++ b/tailbone/views/handheld.py @@ -79,6 +79,7 @@ class HandheldBatchView(FileBatchMasterView): url_prefix = '/batch/handheld' execution_options_schema = ExecutionOptions editable = False + results_executable = True model_row_class = model.HandheldBatchRow rows_creatable = False diff --git a/tailbone/views/labels/batch.py b/tailbone/views/labels/batch.py index cbd5af40..8df24ef0 100644 --- a/tailbone/views/labels/batch.py +++ b/tailbone/views/labels/batch.py @@ -49,6 +49,7 @@ class LabelBatchView(BatchMasterView): rows_editable = True rows_bulk_deletable = True cloneable = True + results_executable = True row_grid_columns = [ 'sequence',