diff --git a/tailbone/templates/reports/generated/delete.mako b/tailbone/templates/reports/generated/delete.mako new file mode 100644 index 00000000..0c994ad0 --- /dev/null +++ b/tailbone/templates/reports/generated/delete.mako @@ -0,0 +1,16 @@ +## -*- coding: utf-8; -*- +<%inherit file="/master/delete.mako" /> + +<%def name="modify_this_page_vars()"> + ${parent.modify_this_page_vars()} + + + + +${parent.body()} diff --git a/tailbone/views/master.py b/tailbone/views/master.py index 76f8967b..eb4ef1a5 100644 --- a/tailbone/views/master.py +++ b/tailbone/views/master.py @@ -2250,6 +2250,12 @@ class MasterView(View): """ return kwargs + def template_kwargs_delete(self, **kwargs): + """ + Method stub, so subclass can always invoke super() for it. + """ + return kwargs + def get_db_engines(self): """ Must return a dict (or even better, OrderedDict) which contains all diff --git a/tailbone/views/reports.py b/tailbone/views/reports.py index 21ef3a20..e2aa3db6 100644 --- a/tailbone/views/reports.py +++ b/tailbone/views/reports.py @@ -278,18 +278,30 @@ class ReportOutputView(ExportMasterView): url = self.get_action_url('download', report) return self.render_file_field(path, url=url) - def template_kwargs_view(self, **kwargs): - use_buefy = self.get_use_buefy() - if use_buefy: + def get_params_context(self, report): + params_data = [] + for name, value in (report.params or {}).items(): + params_data.append({ + 'key': name, + 'value': value, + }) + return params_data + def template_kwargs_view(self, **kwargs): + kwargs = super(ReportOutputView, self).template_kwargs_view(**kwargs) + + if self.get_use_buefy(): report = kwargs['instance'] - params_data = [] - for name, value in (report.params or {}).items(): - params_data.append({ - 'key': name, - 'value': value, - }) - kwargs['params_data'] = params_data + kwargs['params_data'] = self.get_params_context(report) + + return kwargs + + def template_kwargs_delete(self, **kwargs): + kwargs = super(ReportOutputView, self).template_kwargs_delete(**kwargs) + + if self.get_use_buefy(): + report = kwargs['instance'] + kwargs['params_data'] = self.get_params_context(report) return kwargs