update attributes in murph_collection_widget template

This commit is contained in:
Simon Vieille 2022-04-15 15:35:23 +02:00
parent f4b8705efc
commit c916d68412
Signed by: deblan
GPG key ID: 03383D15A1D31745

View file

@ -83,9 +83,11 @@
{% endblock %}
{% block murph_collection_widget %}
<div data-collection="collection-{{ collection_name }}" {{ block('widget_attributes') }}>
{{ dump(row_attr) }}
<div data-collection="collection-{{ collection_name }}" {% for attr, value in row_attr %}{{ attr }}="{{ value }}"{% endfor %}>
{% set attrs = attr|merge({class: 'mb-1 ' ~ (attr.class ?? '')}) %}
{% for item in form %}
<div data-collection-item="{{ loop.index }}" class="mb-1">
<div data-collection-item="{{ loop.index }}" {% for attr, value in attrs %}{{ attr }}="{{ value }}"{% endfor %}>
{% for child in item %}
{{ form_row(child) }}
{% endfor %}