{% block collection_widget -%} {% from '@SyliusResource/Macros/notification.html.twig' import error %} {% set attr = attr|merge({'class': attr.class|default ~ ' controls collection-widget'}) %} {% spaceless %}
{{ error(form.vars.errors) }} {% if prototypes|default is iterable %} {% for key, subPrototype in prototypes %} {% endfor %} {% endif %}
{% for child in form %} {{ _self.collectionItem(child, allow_delete, button_delete_label, loop.index0) }} {% endfor %}
{% if prototype is defined and allow_add %} {{ button_add_label|trans }} {% endif %}
{% endspaceless %} {%- endblock collection_widget %} {% macro collectionItem(form, allow_delete, button_delete_label, index) %} {% spaceless %}
{% if allow_delete %}

{{ button_delete_label|trans }}

{% endif %} {% if not form.children|length %} {{ form_widget(form) }} {% else %} {{ form_rest(form) }} {% endif %}
{% endspaceless %} {% endmacro %}