{% use 'form_div_layout.html.twig' %} {# Buttons #} {% block button_attributes %} {% set attr = attr|merge({class: 'btn ' ~ attr.class | default("btn-default")}) %} {{ parent() }} {% endblock button_attributes %} {% block button_widget %} {% spaceless %} {% if label is empty %} {%- if label_format is defined and label_format is not empty -%} {% set label = label_format|replace({ '%name%': name, '%id%': id, }) %} {%- else -%} {% set label = name|humanize %} {%- endif -%} {% endif %} {% endspaceless %} {% endblock button_widget %} {% block button_row %} {% spaceless %} {% if button_offset is defined and button_offset is not empty %} {% set attr = attr|merge({'for': id, 'class': button_offset }) %}
{{ value }}
{% else %} {{ parent() }} {% endif %} {% if type != 'hidden' and ( widget_addon_prepend|default(null) is not null or widget_addon_append|default(null) is not null or widget_btn_prepend|default(null) is not null or widget_btn_append|default(null) is not null ) %} {% if widget_addon_append|default(null) is not null %} {% set widget_addon = widget_addon_append %} {{ block('widget_addon') }} {% endif %} {% if widget_btn_append|default(null) is not null %} {% set widget_btns = widget_btn_append %} {{ block('widget_btns') }} {% endif %}{{ help_block|trans({}, translation_domain)|raw }}
{%endif %} {% if help_block_tooltip.title %} {{ block('help_block_tooltip') }} {% endif %} {% if help_block_popover.title %} {{ block('help_block_popover') }} {% 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.wrapper_div is defined and widget_remove_btn.wrapper_div is not same as(false) %} {% endif %} {% endspaceless %} {% endblock form_widget_remove_btn %} {% block collection_button %} {% if button_values.icon is not null %} {{ mopa_bootstrap_icon(button_values.icon, button_values.icon_inverted|default(false)) }} {% endif %} {% if button_values.label is defined %} {{ button_values.label|trans({}, translation_domain) }} {% endif %} {% 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 %} {% set widget_addon_icon_inverted = widget_addon.icon_inverted is defined ? widget_addon.icon_inverted : false %} {{ (widget_addon.text|default(false) ? widget_addon.text|trans({}, translation_domain)|raw : mopa_bootstrap_icon(widget_addon_icon, widget_addon_icon_inverted)) }} {% endspaceless %} {% endblock widget_addon %} {% block widget_btns %} {% spaceless %} {% for widget_btn in widget_btns %} {% endfor %} {% endspaceless %} {% endblock widget_btns %} {# 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.message) }} {% endfor %} {% else %} {% for error in errors %} {{ error.message }}