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:
parent
2100f0461d
commit
2605f5ab79
5 changed files with 33 additions and 5 deletions
|
@ -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):
|
||||
|
|
|
@ -818,10 +818,11 @@ class MasterView(View):
|
|||
delete=False, schema=None, importer_host_title=None):
|
||||
|
||||
handler = handler_factory(self.rattail_config)
|
||||
use_buefy = self.get_use_buefy()
|
||||
|
||||
if not schema:
|
||||
schema = forms.SimpleFileImport().bind(request=self.request)
|
||||
form = forms.Form(schema=schema, request=self.request)
|
||||
form = forms.Form(schema=schema, request=self.request, use_buefy=use_buefy)
|
||||
form.save_label = "Upload"
|
||||
form.cancel_url = self.get_index_url()
|
||||
if form.validate(newstyle=True):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue