20 lines
521 B
HTML
20 lines
521 B
HTML
{% macro generate_fields(form) -%}
|
|
{% for field in form %}
|
|
{% if field.type != 'CSRFTokenField' %}
|
|
<div class="form-group{%if field.errors %} has-error{% endif %}">
|
|
{{ field.label }}
|
|
{% if field.type in ('StringField', 'PasswordField') %}
|
|
{{ field(class='form-control') }}
|
|
{% else %}
|
|
{{ field() }}
|
|
{% endif %}
|
|
{% for error in field.errors %}
|
|
<span class="help-block">{{ error }}</span>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
{{ field() }}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{%- endmacro %}
|