diff --git a/tailbone/templates/forms/util.mako b/tailbone/templates/forms/util.mako index cc3a5d2d..0b4f4012 100644 --- a/tailbone/templates/forms/util.mako +++ b/tailbone/templates/forms/util.mako @@ -9,6 +9,9 @@ % if isinstance(field.schema.typ, deform.FileData): class="file" % endif + % if form.has_helptext(field.name): + message="${form.render_helptext(field.name)}" + % endif % if error_messages: type="is-danger" :message='${form.messages_json(error_messages)|n}' diff --git a/tailbone/views/reports.py b/tailbone/views/reports.py index 2839c5b5..c9a14be7 100644 --- a/tailbone/views/reports.py +++ b/tailbone/views/reports.py @@ -401,6 +401,7 @@ class GenerateReport(View): } schema = colander.Schema() + helptext = {} for param in report_params: # make a new node of appropriate schema type @@ -420,10 +421,13 @@ class GenerateReport(View): if hasattr(param, 'default'): node.default = param.default + # set docstring + helptext[param.name] = param.helptext + schema.add(node) 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.cancel_url = self.request.route_url('generate_report')