Fix params field when deleting a report
This commit is contained in:
parent
197d3de74a
commit
6f62f141d2
16
tailbone/templates/reports/generated/delete.mako
Normal file
16
tailbone/templates/reports/generated/delete.mako
Normal file
|
@ -0,0 +1,16 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/master/delete.mako" />
|
||||
|
||||
<%def name="modify_this_page_vars()">
|
||||
${parent.modify_this_page_vars()}
|
||||
<script type="text/javascript">
|
||||
|
||||
% if params_data is not Undefined:
|
||||
${form.component_studly}Data.paramsData = ${json.dumps(params_data)|n}
|
||||
% endif
|
||||
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
|
||||
${parent.body()}
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
||||
report = kwargs['instance']
|
||||
def get_params_context(self, report):
|
||||
params_data = []
|
||||
for name, value in (report.params or {}).items():
|
||||
params_data.append({
|
||||
'key': name,
|
||||
'value': value,
|
||||
})
|
||||
kwargs['params_data'] = params_data
|
||||
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']
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue