Show helptext for params when generating new report
This commit is contained in:
parent
16a4fe1a4f
commit
4716545b7e
|
@ -9,6 +9,9 @@
|
||||||
% if isinstance(field.schema.typ, deform.FileData):
|
% if isinstance(field.schema.typ, deform.FileData):
|
||||||
class="file"
|
class="file"
|
||||||
% endif
|
% endif
|
||||||
|
% if form.has_helptext(field.name):
|
||||||
|
message="${form.render_helptext(field.name)}"
|
||||||
|
% endif
|
||||||
% if error_messages:
|
% if error_messages:
|
||||||
type="is-danger"
|
type="is-danger"
|
||||||
:message='${form.messages_json(error_messages)|n}'
|
:message='${form.messages_json(error_messages)|n}'
|
||||||
|
|
|
@ -401,6 +401,7 @@ class GenerateReport(View):
|
||||||
}
|
}
|
||||||
|
|
||||||
schema = colander.Schema()
|
schema = colander.Schema()
|
||||||
|
helptext = {}
|
||||||
for param in report_params:
|
for param in report_params:
|
||||||
|
|
||||||
# make a new node of appropriate schema type
|
# make a new node of appropriate schema type
|
||||||
|
@ -420,10 +421,13 @@ class GenerateReport(View):
|
||||||
if hasattr(param, 'default'):
|
if hasattr(param, 'default'):
|
||||||
node.default = param.default
|
node.default = param.default
|
||||||
|
|
||||||
|
# set docstring
|
||||||
|
helptext[param.name] = param.helptext
|
||||||
|
|
||||||
schema.add(node)
|
schema.add(node)
|
||||||
|
|
||||||
form = forms.Form(schema=schema, request=self.request,
|
form = forms.Form(schema=schema, request=self.request,
|
||||||
use_buefy=use_buefy)
|
use_buefy=use_buefy, helptext=helptext)
|
||||||
form.submit_label = "Generate this Report"
|
form.submit_label = "Generate this Report"
|
||||||
form.cancel_url = self.request.route_url('generate_report')
|
form.cancel_url = self.request.route_url('generate_report')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue