{% extends 'form_div_layout.html.twig' %} {# Buttons #} {% block button_attributes %} {% set attr = attr|merge({class: 'btn ' ~ attr.class | default("")}) %} {{ parent() }} {% endblock button_attributes %} {% block button_widget %} {% spaceless %} {% if label is empty %} {% set label = name|humanize %} {% endif %} {% endspaceless %} {% endblock button_widget %} {# Widgets #} {% block choice_widget_collapsed %} {% set attr = attr|merge({'class': attr.class|default('') ~ ' form-control'}) %} {% if not inline and horizontal %} {% if not label_render %} {% set horizontal_input_wrapper_class = horizontal_input_wrapper_class ~ ' ' ~ horizontal_label_offset_class %} {% endif %}
{{ help_block|trans({}, translation_domain)|raw }}
{%endif %} {% endspaceless %} {% endblock form_help %} {% block form_widget_add_btn %} {% spaceless %} {% if widget_add_btn|default(null) %} {% set button_type = 'add' %} {% set button_values = widget_add_btn %} {{ block('collection_button') }} {% endif %} {% endspaceless %} {% endblock form_widget_add_btn %} {% block form_widget_remove_btn %} {% spaceless %} {% if widget_remove_btn|default(null) %} {% set button_type = 'remove' %} {% set button_values = widget_remove_btn %} {{ block('collection_button') }} {% endif %} {% endspaceless %} {% endblock form_widget_remove_btn %} {% block collection_button %} {% if button_values.icon != "" %} {% endif %} {{ button_values.label|trans({}, translation_domain) }} {% endblock collection_button %} {% block label_asterisk %} {% if required %} {%- if render_required_asterisk %} *{% endif %} {% else %} {%- if render_optional_text %} {{ "(optional)"|trans({}, translation_domain) }}{% endif %} {% endif %} {% endblock label_asterisk %} {% block widget_addon %} {% spaceless %} {% set widget_addon_icon = widget_addon.icon is defined ? widget_addon.icon : null %} {{ (widget_addon.text|default(false) ? widget_addon.text|trans({}, translation_domain)|raw : mopa_bootstrap_icon(widget_addon_icon)) }} {% endspaceless %} {% endblock widget_addon %} {# 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 %} {% if errors|length > 0 %} {% if form.parent == null %} {% from 'MopaBootstrapBundle::flash.html.twig' import flash %} {% for error in errors %} {{ flash('danger', error.messagePluralization is null ? error.messageTemplate|trans(error.messageParameters, 'validators') : error.messageTemplate|transchoice(error.messagePluralization, error.messageParameters, 'validators') ) }} {% endfor %} {% else %} {% for error in errors %} {{ error.messagePluralization is null ? error.messageTemplate|trans(error.messageParameters, 'validators') : error.messageTemplate|transchoice(error.messagePluralization, error.messageParameters, 'validators') }}