{% macro field_with_errors(field) %} {% if field.type == 'BooleanField' %} {{ checkbox_field_with_errors(field) }} {% else %} {{ field.label(class='label') }} {% if field.errors %}
{% else %}{{ field(class='input', **kwargs) }}
{% endif %} {% endif %} {% endmacro %} {% macro checkbox_field_with_errors(field) %} {% if field.errors %}{{ field(class='checkbox') }} {{ field.label(class='checkbox') }} {{ field.errors[0] }}
{% else %}{% endif %} {% endmacro %}