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)
This commit is contained in:
Pablo Vazquez 2019-04-24 21:29:55 +02:00
parent 15d5ac687c
commit 8ba7122a01

View File

@ -4,9 +4,9 @@
| {% if field.type == 'BooleanField' %} | {% if field.type == 'BooleanField' %}
.checkbox .checkbox
label label(for='{{ field.name }}')
| {{ field(class='checkbox') }} | {{ field(class='checkbox') }}
label {{ field.name | undertitle }} label(for='{{ field.name }}') {{ _(field.name) | undertitle }}
| {% elif field.type == 'FieldList' %} | {% elif field.type == 'FieldList' %}
@ -29,7 +29,8 @@
| {% endfor %} | {% endfor %}
| {% else %} | {% else %}
| {{ field.label }} label(for='{{ field.name }}')
| {{ _(field.name) | undertitle }}
| {{ field(class='form-control') }} | {{ field(class='form-control') }}
| {% endif %} | {% endif %}