{# This file is part of the Sonata package. (c) Thomas Rabaix For the full copyright and license information, please view the LICENSE file that was distributed with this source code. #} {% extends 'SonataAdminBundle:Form:silex_form_div_layout.html.twig' %} {# Labels #} {% block generic_label %} {% spaceless %} {% if required %} {% set attr = attr|merge({'class': attr.class|default('') ~ ' required'}) %} {% endif %} {% if in_list_checkbox is defined and in_list_checkbox and widget is defined %} {{ widget|raw }} {% if not sonata_admin.admin%} {{- label -}} {% else %} {{- label|trans({}, sonata_admin.admin.translationDomain) -}} {% endif%} {% else %} {% if not sonata_admin.admin%} {{ label }} {% else %} {{ label|trans({}, sonata_admin.admin.translationDomain) }} {% endif%} {{ required ? '*' : '' }} {% endif %} {% endspaceless %} {% endblock %} {% block widget_container_attributes_choice_widget %} {% spaceless %} id="{{ id }}" {% for attrname,attrvalue in attr %}{{attrname}}="{% if attrname == 'class' %}inputs-list {% endif%}{{attrvalue}}" {% endfor %} {% if "class" not in attr|keys %}class="inputs-list"{%endif %} {% endspaceless %} {% endblock %} {% block choice_widget %} {% spaceless %} {% if expanded %}
    {% for child in form %}
  • {{ form_label(child, null, { 'in_list_checkbox' : true, 'widget' : form_widget(child) } ) }}
  • {% endfor %}
{% else %} {% endif %} {% endspaceless %} {% endblock choice_widget %} {% block field_row %} {% if sonata_admin is not defined or not sonata_admin_enabled or not sonata_admin.field_description %} {{ parent() }} {% else %}
{% block label %} {% if sonata_admin.field_description.options.name is defined %} {{ form_label(form, sonata_admin.field_description.options.name) }} {% else %} {{ form_label(form) }} {% endif %} {% endblock %}
{{ form_widget(form) }} {% if sonata_admin.field_description.help %} {{ sonata_admin.field_description.help }} {% endif %} {% if errors|length > 0 %}
{{ form_errors(form) }}
{% endif %}
{% endif %} {% endblock field_row %} {% block collection_widget_row %} {% spaceless %}
{% if allow_delete %} {% endif %} {{ form_row(child) }}
{% endspaceless %} {% endblock %} {% block collection_widget %} {% spaceless %} {% if prototype is defined %} {% set child = prototype %} {% set attr = attr|merge({'data-prototype': block('collection_widget_row') }) %} {% endif %}
{{ form_errors(form) }} {% for child in form %} {{ block('collection_widget_row') }} {% endfor %} {{ form_rest(form) }} {% if allow_add %}
{% endif %}
{% endspaceless %} {% endblock collection_widget %}