{% extends 'form_div_layout.html.twig' %} {% from 'MopaBootstrapBundle::flash.html.twig' import flash %} {# legends & labels #} {% block form_legend %} {% endblock form_legend %} {% block generic_label %} {% spaceless %} {% if required %} {% set attr = attr|merge({'class': attr.class|default('') ~ ' required'}) %} {% endif %} {% set attr = attr|merge({'class': attr.class|default('') ~ ' control-label'}) %} {% endspaceless %} {% endblock %} {# renders a field label without span class, if e.g field has it#} {% block field_label_attr_aware_label %} {% spaceless %} {% if label_render %} {% set attr = label_attr|merge({'for': id}) %} {{ block('field_label') }} {% endif %} {% endspaceless %} {% endblock field_label_attr_aware_label %} {# Help #} {% block field_help %} {% if help_inline %}
{{ help_inline|trans|raw }}
{%endif %} {% if help_block %}{{ help_block|trans|raw }}
{%endif %} {% endblock field_help %} {% block field_widget_add_btn %} {% if widget_add_btn %} {% endif %} {% endblock field_widget_add_btn %} {% block field_widget_remove_btn %} {% if widget_remove_btn %} {% endif %} {% endblock field_widget_remove_btn %} {# Errors #} {% block form_errors %} {% spaceless %} {% if error_delay %} {% for child in form %} {% if loop.index == 1 %} {% if child.set('errors', errors) %}{% endif %} {% endif %} {% endfor %} {% else %} {# prevent deep nesting wrong context copy error #} {% from 'MopaBootstrapBundle::flash.html.twig' import flash %} {% for error in errors %} {{ flash('error', error.messageTemplate|trans(error.messageParameters, 'validators')) }} {% endfor %} {% endif %} {% endspaceless %} {% endblock form_errors %} {% block field_errors %} {% spaceless %} {% if errors|length > 0 %} {% for error in errors %} {{ error.messageTemplate|trans(error.messageParameters, 'validators') }}