Fix batch row status breakdown for Buefy themes

also, fix the "import batch from file" feature UI, per Buefy theme
This commit is contained in:
Lance Edgar 2020-03-02 14:38:06 -06:00
parent 2100f0461d
commit 2605f5ab79
5 changed files with 33 additions and 5 deletions

View file

@ -147,6 +147,7 @@ class BatchMasterView(MasterView):
return self.rattail_config.batch_filepath(batch.batch_key, batch.uuid, filename)
def template_kwargs_view(self, **kwargs):
use_buefy = self.get_use_buefy()
batch = kwargs['instance']
kwargs['batch'] = batch
kwargs['handler'] = self.handler
@ -164,6 +165,12 @@ class BatchMasterView(MasterView):
else:
kwargs['why_not_execute'] = self.handler.why_not_execute(batch)
kwargs['status_breakdown'] = self.make_status_breakdown(batch)
if use_buefy:
data = [{'title': title, 'count': count}
for title, count in kwargs['status_breakdown']]
Grid = self.get_grid_factory()
kwargs['status_breakdown_grid'] = Grid('batch_row_status_breakdown',
data, ['title', 'count'])
return kwargs
def make_status_breakdown(self, batch, rows=None, status_enum=None):