From c95e2dbb062b5ea8e87764d67250d1b1dfcab430 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 14 Oct 2017 14:14:24 -0700 Subject: [PATCH] Add "download row results as CSV" feature to master view --- tailbone/templates/batch/view.mako | 3 -- tailbone/templates/master/view.mako | 3 ++ tailbone/views/batch/core.py | 56 ++++------------------------- tailbone/views/master.py | 56 +++++++++++++++++++++++++++++ tailbone/views/master2.py | 2 +- 5 files changed, 67 insertions(+), 53 deletions(-) diff --git a/tailbone/templates/batch/view.mako b/tailbone/templates/batch/view.mako index 9dbe3180..13ba7ecb 100644 --- a/tailbone/templates/batch/view.mako +++ b/tailbone/templates/batch/view.mako @@ -40,9 +40,6 @@ <%def name="context_menu_items()"> ${parent.context_menu_items()} - % if master.rows_downloadable and request.has_perm('{}.csv'.format(permission_prefix)): -
  • ${h.link_to("Download row data as CSV", url('{}.csv'.format(route_prefix), uuid=batch.uuid))}
  • - % endif % if master.cloneable and request.has_perm('{}.clone'.format(permission_prefix)):
  • ${h.link_to("Clone as new batch", url('{}.clone'.format(route_prefix), uuid=batch.uuid))}
  • % endif diff --git a/tailbone/templates/master/view.mako b/tailbone/templates/master/view.mako index b6946a75..547d70ae 100644 --- a/tailbone/templates/master/view.mako +++ b/tailbone/templates/master/view.mako @@ -61,6 +61,9 @@ % if master.cloneable and request.has_perm('{}.clone'.format(permission_prefix)):
  • ${h.link_to("Clone this as new {}".format(model_title), url('{}.clone'.format(route_prefix), uuid=instance.uuid))}
  • % endif + % if master.rows_downloadable_csv and request.has_perm('{}.row_results_csv'.format(permission_prefix)): +
  • ${h.link_to("Download row results as CSV", url('{}.row_results_csv'.format(route_prefix), uuid=instance.uuid))}
  • + % endif