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
|
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):
|
def get_db_engines(self):
|
||||||
"""
|
"""
|
||||||
Must return a dict (or even better, OrderedDict) which contains all
|
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)
|
url = self.get_action_url('download', report)
|
||||||
return self.render_file_field(path, url=url)
|
return self.render_file_field(path, url=url)
|
||||||
|
|
||||||
def template_kwargs_view(self, **kwargs):
|
def get_params_context(self, report):
|
||||||
use_buefy = self.get_use_buefy()
|
|
||||||
if use_buefy:
|
|
||||||
|
|
||||||
report = kwargs['instance']
|
|
||||||
params_data = []
|
params_data = []
|
||||||
for name, value in (report.params or {}).items():
|
for name, value in (report.params or {}).items():
|
||||||
params_data.append({
|
params_data.append({
|
||||||
'key': name,
|
'key': name,
|
||||||
'value': value,
|
'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
|
return kwargs
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue