From 8ba7122a01f5eab7e3e23432515c71c3e5840ceb Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Wed, 24 Apr 2019 21:29:55 +0200 Subject: [PATCH] Forms: Use own label element for fields instead of wtforms. This way we can do two things: * Tag the field for translation * Use a filter (like undertitle for nicer labels) --- src/templates/_macros/_node_edit_form.pug | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/templates/_macros/_node_edit_form.pug b/src/templates/_macros/_node_edit_form.pug index 672f913d..4935f127 100644 --- a/src/templates/_macros/_node_edit_form.pug +++ b/src/templates/_macros/_node_edit_form.pug @@ -4,9 +4,9 @@ | {% if field.type == 'BooleanField' %} .checkbox - label + label(for='{{ field.name }}') | {{ field(class='checkbox') }} - label {{ field.name | undertitle }} + label(for='{{ field.name }}') {{ _(field.name) | undertitle }} | {% elif field.type == 'FieldList' %} @@ -29,7 +29,8 @@ | {% endfor %} | {% else %} - | {{ field.label }} + label(for='{{ field.name }}') + | {{ _(field.name) | undertitle }} | {{ field(class='form-control') }} | {% endif %}