{% use "form_div_layout.html.twig" %} {# Widgets #} {% block textarea_widget -%} {% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control')|trim}) %} {{- parent() -}} {%- endblock textarea_widget %} {% block money_widget -%} {% set prepend = not (money_pattern starts with '{{') %} {% set append = not (money_pattern ends with '}}') %} {% if prepend or append %}
{% if prepend %} {{ money_pattern|replace({ '{{ widget }}':''}) }} {% endif %} {{- block('form_widget_simple') -}} {% if append %} {{ money_pattern|replace({ '{{ widget }}':''}) }} {% endif %}
{% else %} {{- block('form_widget_simple') -}} {% endif %} {%- endblock money_widget %} {% block percent_widget -%}
{{- block('form_widget_simple') -}} %
{%- endblock percent_widget %} {% block datetime_widget -%} {%- if widget == 'single_text' -%} {{- block('form_widget_simple') -}} {%- else -%} {% set attr = attr|merge({class: (attr.class|default('') ~ ' form-inline')|trim}) -%}
{{- form_errors(form.date) -}} {{- form_errors(form.time) -}} {{- form_widget(form.date, { datetime: true } ) -}} {{- form_widget(form.time, { datetime: true } ) -}}
{%- endif -%} {%- endblock datetime_widget %} {% block date_widget -%} {%- if widget == 'single_text' -%} {{- block('form_widget_simple') -}} {%- else -%} {%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-inline')|trim}) -%} {%- if datetime is not defined or not datetime -%}
{%- endif %} {{- date_pattern|replace({ '{{ year }}': form_widget(form.year), '{{ month }}': form_widget(form.month), '{{ day }}': form_widget(form.day), })|raw -}} {%- if datetime is not defined or not datetime -%}
{%- endif -%} {%- endif -%} {%- endblock date_widget %} {% block time_widget -%} {%- if widget == 'single_text' -%} {{- block('form_widget_simple') -}} {%- else -%} {%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-inline')|trim}) -%} {%- if datetime is not defined or false == datetime -%}
{%- endif -%} {{- form_widget(form.hour) }}{% if with_minutes %}:{{ form_widget(form.minute) }}{% endif %}{% if with_seconds %}:{{ form_widget(form.second) }}{% endif %} {%- if datetime is not defined or false == datetime -%}
{%- endif -%} {%- endif -%} {%- endblock time_widget %} {%- block dateinterval_widget -%} {%- if widget == 'single_text' -%} {{- block('form_widget_simple') -}} {%- else -%} {%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-inline')|trim}) -%}
{{- form_errors(form) -}}
{%- if with_years %}{% endif -%} {%- if with_months %}{% endif -%} {%- if with_weeks %}{% endif -%} {%- if with_days %}{% endif -%} {%- if with_hours %}{% endif -%} {%- if with_minutes %}{% endif -%} {%- if with_seconds %}{% endif -%} {%- if with_years %}{% endif -%} {%- if with_months %}{% endif -%} {%- if with_weeks %}{% endif -%} {%- if with_days %}{% endif -%} {%- if with_hours %}{% endif -%} {%- if with_minutes %}{% endif -%} {%- if with_seconds %}{% endif -%}
{{ form_label(form.years) }}{{ form_label(form.months) }}{{ form_label(form.weeks) }}{{ form_label(form.days) }}{{ form_label(form.hours) }}{{ form_label(form.minutes) }}{{ form_label(form.seconds) }}
{{ form_widget(form.years) }}{{ form_widget(form.months) }}{{ form_widget(form.weeks) }}{{ form_widget(form.days) }}{{ form_widget(form.hours) }}{{ form_widget(form.minutes) }}{{ form_widget(form.seconds) }}
{%- if with_invert %}{{ form_widget(form.invert) }}{% endif -%}
{%- endif -%} {%- endblock dateinterval_widget -%} {% block choice_widget_collapsed -%} {%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control')|trim}) -%} {{- parent() -}} {%- endblock choice_widget_collapsed %} {% block choice_widget_expanded -%} {%- if '-inline' in label_attr.class|default('') -%} {%- for child in form %} {{- form_widget(child, { parent_label_class: label_attr.class|default(''), translation_domain: choice_translation_domain, }) -}} {% endfor -%} {%- else -%}
{%- for child in form %} {{- form_widget(child, { parent_label_class: label_attr.class|default(''), translation_domain: choice_translation_domain, }) -}} {%- endfor -%}
{%- endif -%} {%- endblock choice_widget_expanded %} {# Labels #} {% block choice_label -%} {# remove the checkbox-inline and radio-inline class, it's only useful for embed labels #} {%- set label_attr = label_attr|merge({class: label_attr.class|default('')|replace({'checkbox-inline': '', 'radio-inline': ''})|trim}) -%} {{- block('form_label') -}} {% endblock choice_label %} {% block checkbox_label -%} {{- block('checkbox_radio_label') -}} {%- endblock checkbox_label %} {% block radio_label -%} {{- block('checkbox_radio_label') -}} {%- endblock radio_label %} {# Rows #} {% block button_row -%}
{{- form_widget(form) -}}
{%- endblock button_row %} {% block choice_row -%} {%- set force_error = true -%} {{- block('form_row') -}} {%- endblock choice_row %} {% block date_row -%} {%- set force_error = true -%} {{- block('form_row') -}} {%- endblock date_row %} {% block time_row -%} {%- set force_error = true -%} {{- block('form_row') -}} {%- endblock time_row %} {% block datetime_row -%} {%- set force_error = true -%} {{- block('form_row') -}} {%- endblock datetime_row %}