Skip to content

Commit

Permalink
chore: avoid empty view groups
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanorosanelli committed Jul 6, 2023
1 parent bf136a5 commit 38fc9ce
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions templates/Element/Form/other_properties.twig
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
{# Remaining properties groups: 'other' and custom groups not in 'core', '_keep', 'publish', 'advanced' #}
{% set otherProperties = Array.removeKeys(properties, ['core', '_keep', 'publish', 'advanced']) %}
{% for group, props in otherProperties %}
{% if props %}

<property-view inline-template :tab-open="tabsOpen" tab-name="{{ group }}">

<section class="fieldset">
<header @click.prevent="toggleVisibility()"
class="tab unselectable"
:class="isOpen? 'open has-border-module-{{ currentModule.name }}' : ''">
<h2>{{ Layout.tr(group) }}</h2>
</header>

<div v-show="isOpen" class="tab-container">

{{ element('Form/group_properties', {'properties' : props, 'group': group}) }}

</div>
</section>

</property-view>
{% else %}
{% set customElement = Element.custom(group, 'group') %}
{% if props or customElement %}

<property-view inline-template :tab-open="tabsOpen" tab-name="{{ group }}">

Expand All @@ -33,9 +16,10 @@

<div v-show="isOpen" class="tab-container">

{% set customElement = Element.custom(group, 'group') %}
{% if customElement %}
{{ element(customElement) }}
{% else %}
{{ element('Form/group_properties', {'properties' : props, 'group': group}) }}
{% endif %}

</div>
Expand Down

0 comments on commit 38fc9ce

Please sign in to comment.