{% extends 'form_div_layout.html.twig' %} {% block widget_attributes %} {% if attr.class is defined %} {% set class = attr.class ~ ' form-control' %} {% else %} {% set class = 'form-control' %} {% endif %} {% set attr = attr|merge({'class' : class}) %} {{ parent () }} {% endblock widget_attributes %} {% block choice_widget_expanded %} {% spaceless %}
{% for child in form %} {{ form_widget(child) }} {% endfor %}
{% endspaceless %} {% endblock choice_widget_expanded %} {% block choice_widget_collapsed %} {% set attr = attr|merge({'class' : 'form-control'}) %} {{ parent() }} {% endblock %} {% block checkbox_widget %}
{% 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 empty %} {% set label = name|humanize %} {% endif %} {% if label is not sameas(false) %} {{ label|trans({}, translation_domain) }} {% endif %} {% endspaceless %}
{% endblock checkbox_widget %} {% block radio_widget %}
{% 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 empty %} {% set label = name|humanize %} {% endif %} {% if label is not sameas(false) %} {{ label|trans({}, translation_domain) }} {% endif %} {% endspaceless %}
{% endblock radio_widget %} {% block date_widget %} {% if widget == 'single_text' %}
{% if attr.class is defined %} {% set class = attr.class ~ ' timepicker' %} {% else %} {% set class = ' timepicker' %} {% endif %} {% set attr = attr|merge({'class' : class, 'data-datepicker':'on'}) %} {{ 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 attr.class is defined %} {% set class = attr.class ~ ' timepicker' %} {% else %} {% set class = ' timepicker' %} {% endif %} {% set attr = attr|merge({'class' : class, 'data-timepicker':'on'}) %} {{ block('form_widget_simple') }}
{% else %} {{ parent() }} {% endif %} {% endblock %} {% block form_row %} {% set types = form.vars.block_prefixes %} {% if 'checkbox' in types or 'radio' in types %}
{{ form_widget(form) }} {{ form_errors(form) }}
{% else %}
{{ form_label(form) }} {{ form_widget(form) }} {{ form_errors(form) }}
{% endif %} {% endblock %} {% block form_label %} {% if help is defined %}   {% endif %} {{ parent() }} {% if required %} * {% endif %} {% endblock form_label %} {% block form_errors %} {% spaceless %} {% if errors|length > 0 %} {% endif %} {% endspaceless %} {% endblock form_errors %}