Skip to content

Commit

Permalink
Fix collection js form type affect collection form type
Browse files Browse the repository at this point in the history
  • Loading branch information
tienvx committed Oct 15, 2021
1 parent 020af95 commit 0dda8c7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Resources/views/bootstrap_3_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
<div id="{{ id }}-contents" class="panel-collapse collapse {{ not form.vars.valid ? 'in' }}" role="tabpanel">
<div class="panel-body">
{{ form_widget(form) }}
{{ block('collection_js_accordion_item_body') }}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/bootstrap_4_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
<div id="{{ id }}-contents" class="collapse {{ not form.vars.valid ? 'show' }}">
<div class="card-body">
{{ form_widget(form) }}
{{ block('collection_js_accordion_item_body') }}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/bootstrap_5_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</h2>
<div id="{{ id }}-contents" class="accordion-collapse collapse {{ not form.vars.valid ? 'show' }}">
<div class="accordion-body">
{{ form_widget(form) }}
{{ block('collection_js_accordion_item_body') }}
</div>
</div>
</div>
Expand Down
8 changes: 5 additions & 3 deletions src/Resources/views/form_div_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
</div>
{% endblock collection_js_actions %}

{% block collection_entry_widget %}
{{ form_widget(form) }}
{% endblock collection_entry_widget %}
{% block collection_js_accordion_item_body %}
{% for child in form|filter(child => not child.rendered) %}
{{- form_row(child) -}}
{% endfor %}
{% endblock collection_js_accordion_item_body %}

0 comments on commit 0dda8c7

Please sign in to comment.