Skip to content

Commit

Permalink
IBX-1602: Show first goup if all are empty (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
dew326 authored Dec 8, 2021
1 parent 9ddc4ff commit 008c0be
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<div class="ibexa-content-type-edit__field-definitions-group">
<div class="ibexa-content-type-edit__field-definitions-group-list">
{% set should_show_first = true %}

{% for field_defintions in grouped_field_defintions %}
{% if field_defintions is not empty %}
{% set should_show_first = false %}
{% endif %}
{% endfor %}

{% for id, field_defintions in grouped_field_defintions %}
{% set field_definitions_group_class = [
'ibexa-collapse--field-definitions-group ibexa-field-definitions-group-%s'|format(id),
field_defintions is empty ? 'ibexa-collapse--hidden'
field_defintions is empty and not loop.first or loop.first and not should_show_first and field_defintions is empty ? 'ibexa-collapse--hidden'
] %}

{%- embed "@ibexadesign/ui/component/collapse.html.twig" with {
Expand Down

0 comments on commit 008c0be

Please sign in to comment.