From 2605f5ab793ab0c10bee490ae6deb2910582ddd9 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 2 Mar 2020 14:38:06 -0600 Subject: [PATCH] Fix batch row status breakdown for Buefy themes also, fix the "import batch from file" feature UI, per Buefy theme --- tailbone/grids/core.py | 5 ++++- tailbone/templates/batch/view.mako | 10 +++++++++- tailbone/templates/grids/b-table.mako | 13 +++++++++++-- tailbone/views/batch/core.py | 7 +++++++ tailbone/views/master.py | 3 ++- 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/tailbone/grids/core.py b/tailbone/grids/core.py index ba988689..2593ed4c 100644 --- a/tailbone/grids/core.py +++ b/tailbone/grids/core.py @@ -966,7 +966,9 @@ class Grid(object): return self.render_complete(template=template, **kwargs) - def render_buefy_table_element(self, template='/grids/b-table.mako', data_prop='gridData', **kwargs): + def render_buefy_table_element(self, template='/grids/b-table.mako', + data_prop='gridData', empty_labels=False, + **kwargs): """ This is intended for ad-hoc "small" grids with static data. Renders just a ```` element instead of the typical "full" grid. @@ -974,6 +976,7 @@ class Grid(object): context = dict(kwargs) context['grid'] = self context['data_prop'] = data_prop + context['empty_labels'] = empty_labels if 'grid_columns' not in context: context['grid_columns'] = self.get_buefy_columns() diff --git a/tailbone/templates/batch/view.mako b/tailbone/templates/batch/view.mako index aacc756c..1f1fd4f6 100644 --- a/tailbone/templates/batch/view.mako +++ b/tailbone/templates/batch/view.mako @@ -108,7 +108,9 @@

Row Status Breakdown

- % if status_breakdown: + % if use_buefy: + ${status_breakdown_grid.render_buefy_table_element(data_prop='statusBreakdownData', empty_labels=True)|n} + % elif status_breakdown:
% for i, (status, count) in enumerate(status_breakdown): @@ -197,6 +199,12 @@ <%def name="modify_this_page_vars()"> ${parent.modify_this_page_vars()} + + % if not batch.executed and request.has_perm('{}.execute'.format(permission_prefix)):