{% extends 'bootstrap_3_layout.html.twig' %} {# ATTENTION: when changing anything in this file, check if the changes need to be applied to form-theme-horizontal.html.twig as well #} {% block form_errors %} {% apply spaceless %} {% if errors|length > 0 %} {% endif %} {% endapply %} {% endblock form_errors %} {% block widget_attributes %} {% set types = form.vars.block_prefixes %} {% set _class = '' %} {% if 'checkbox' in types %} {% set _class = ' checkbox' %} {% elseif 'radio' in types%} {% set _class = ' radio' %} {% endif%} {# % else %} {% set _class = ' form-control' %} {% endif %#} {% if attr.class is defined %} {% set class = attr.class ~ _class %} {% else %} {% set class = _class %} {% endif %} {% if 'checkbox' not in types and 'form-control' not in class %} {% set class = class ~ ' form-control' %} {% endif %} {% set attr = attr|merge({'class' : class}) %} {{ parent () }} {% endblock widget_attributes %} {% block choice_widget_expanded %} {% apply spaceless %}
{% for child in form %} {{ form_widget(child) }} {% endfor %}
{% endapply %} {% endblock choice_widget_expanded %} {% block choice_widget_collapsed %} {% for att, val in attr %} {% if att == 'class' %} {% set att = val ~ ' form-control' %} {% endif %} {% endfor %} {{ parent() }} {% endblock %} {% block checkbox_widget %}
{% apply spaceless %} {% if not compound %} {% set label_attr = label_attr|merge({'for': id}) %} {% endif %} {% if required %} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %} {% endif %} {% if label is not same as(false) and label is empty %} {% set label = name|humanize %} {% endif %} {% if label is not same as(false) %} {{ label|trans({}, translation_domain) }} {% endif %} {% endapply %}
{% endblock checkbox_widget %} {% block radio_widget %}
{% apply spaceless %} {% if not compound %} {% set label_attr = label_attr|merge({'for': id}) %} {% endif %} {% if required %} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %} {% endif %} {% if label is not same as(false) and label is empty %} {% set label = name|humanize %} {% endif %} {% if label is not same as(false) %} {{ label|trans({}, translation_domain) }} {% endif %} {% endapply %}
{% endblock radio_widget %} {% block date_widget %} {% if widget == 'single_text' %}
{% if type is not defined or type != 'date' %} {% if attr.class is defined %} {% set class = attr.class ~ ' timepicker' %} {% else %} {% set class = ' timepicker' %} {% endif %} {% set attr = attr|merge({'class' : class, 'data-datepickerenable':'on'}) %} {% endif %} {{ block('form_widget_simple') }}
{% else %} {% set date_pattern = '
' ~ date_pattern ~ '
'|raw %} {{ date_pattern|replace({ '{{ year }}' : '
{{ year }}
', '{{ month }}' : '
{{ month }}
', '{{ day }}' : '
{{ day }}
', })|raw|replace({ '{{ year }}': form_widget(form.year), '{{ month }}': form_widget(form.month), '{{ day }}': form_widget(form.day), })|raw }} {% endif %} {% endblock %} {% block time_widget %} {% if widget == 'single_text' %}
{% if type is not defined or type != 'time' %} {% if attr.class is defined %} {% set class = attr.class ~ ' timepicker' %} {% else %} {% set class = ' timepicker' %} {% endif %} {% set attr = attr|merge({'class' : class, 'data-timepicker':'on'}) %} {% endif %} {{ block('form_widget_simple') }}
{% else %} {{ parent() }} {% endif %} {% endblock %} {% block datetime_widget -%} {%- if widget == 'single_text' -%}
{{- parent() -}}
{%- else -%} {{- parent() -}} {%- endif -%} {%- endblock datetime_widget %} {% block tel_widget -%}
{% set icon = 'phone' %} {% if 'icon' in attr|keys %} {% set icon = attr.icon %} {% endif %}
{{- parent() -}}
{%- endblock tel_widget %} {% block url_widget -%}
{{- parent() -}}
{%- endblock url_widget %}