Skip to content

Commit

Permalink
Merge 004767c into 37d0925
Browse files Browse the repository at this point in the history
  • Loading branch information
tienvx committed Oct 3, 2021
2 parents 37d0925 + 004767c commit 3b92484
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
3 changes: 0 additions & 3 deletions src/Resources/translations/messages.en.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?php

return [
'label' => [
'empty' => 'Empty',
],
'action' => [
'add_new_item' => 'Add a new item',
'move_item_up' => 'Move item up',
Expand Down
22 changes: 3 additions & 19 deletions src/Resources/views/bootstrap_5_layout.html.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{% block empty_collection %}
<div class="empty collection-empty">
<span class="badge badge-secondary">{{ 'label.empty'|trans }}</span>
</div>
{% endblock empty_collection %}

{% block collection_js_row %}
{% if prototype is defined and not prototype.rendered %}
{% set row_attr = row_attr|merge({ 'data-prototype': form_row(prototype) }) %}
Expand All @@ -24,18 +18,8 @@
{% endblock collection_js_row %}

{% block collection_js_widget %}
{# the "is iterable" check is needed because if an object implements __toString() and
returns an empty string, "is empty" returns true even if it's not a collection #}
{% set isEmptyCollection = value is null or (value is iterable and value is empty) %}

<div class="collection-js">
{% if isEmptyCollection %}
{{ block('empty_collection') }}
{% else %}
<div class="accordion">
{{ block('form_widget') }}
</div>
{% endif %}
<div class="accordion">
{{ block('form_widget') }}
</div>

{% if allow_add|default(false) %}
Expand All @@ -48,7 +32,7 @@

{% block collection_js_entry_widget %}
<div class="accordion-item">
<h2 class="accordion-header" id="headingOne">
<h2 class="accordion-header">
<h5 class="m-0">{{ value }}</h5>
<div>
<button class="accordion-button {{ render_expanded ? '' : 'collapsed' }}" type="button" data-bs-toggle="collapse" data-bs-target="#{{ id }}-contents">
Expand Down

0 comments on commit 3b92484

Please sign in to comment.