don't show collapsable sections that are empty

This commit is contained in:
isUnknown 2024-09-18 17:47:07 +02:00
parent b0142b4c21
commit 7c4e5d52b8
2 changed files with 20 additions and 16 deletions

View file

@ -220,7 +220,7 @@ img.show {
.main-nav a, .main-nav a,
.main-footer a, .main-footer a,
.hero__text a, .hero__text a,
.collapsable__content a { .collapsable__content a:not(.ticket-link) {
display: block; display: block;
scale: 1; scale: 1;
transition: scale 0.5s var(--curve-quick); transition: scale 0.5s var(--curve-quick);
@ -239,7 +239,7 @@ img.show {
.main-nav a:hover, .main-nav a:hover,
.main-footer a:hover, .main-footer a:hover,
.hero__text a:hover, .hero__text a:hover,
.collapsable__content a:hover, .collapsable__content a:not(.ticket-link):hover,
.anchors-strip a:hover { .anchors-strip a:hover {
scale: var(--scale-up); scale: var(--scale-up);
} }

View file

@ -117,23 +117,25 @@
<?php endif ?> <?php endif ?>
<?php endsnippet() ?> <?php endsnippet() ?>
<?php snippet('collapsable-section', ['title' => 'Distribution et production'], slots: true) ?> <?php if ($page->production()->isNotEmpty()): ?>
<?php slot('content') ?> <?php snippet('collapsable-section', ['title' => 'Distribution et production'], slots: true) ?>
<div class="production"> <?php slot('content') ?>
<?php foreach ($page->production()->toLayouts() as $layout): ?> <div class="production">
<div class="collapsable__item--padding grid" id="<?= $layout->id() ?>"> <?php foreach ($page->production()->toLayouts() as $layout): ?>
<?php foreach ($layout->columns() as $column): ?> <div class="collapsable__item--padding grid" id="<?= $layout->id() ?>">
<div class="grid__item" style="--span:<?= $column->span() ?>"> <?php foreach ($layout->columns() as $column): ?>
<div class="blocks"> <div class="grid__item" style="--span:<?= $column->span() ?>">
<?= $column->blocks() ?> <div class="blocks">
<?= $column->blocks() ?>
</div>
</div> </div>
<?php endforeach ?>
</div> </div>
<?php endforeach ?> <?php endforeach ?>
</div> </div>
<?php endforeach ?> <?php endslot() ?>
</div> <?php endsnippet() ?>
<?php endslot() ?> <?php endif ?>
<?php endsnippet() ?>
<?php if ($page->resources()->isNotEmpty()): ?> <?php if ($page->resources()->isNotEmpty()): ?>
<?php snippet('collapsable-section', ['title' => 'Ressources'], slots: true) ?> <?php snippet('collapsable-section', ['title' => 'Ressources'], slots: true) ?>
@ -152,7 +154,9 @@
<?php endif ?> <?php endif ?>
</section> </section>
<?php snippet('events-grid', ['title' => 'Pour aller plus loin', 'events' => $page->linkedPages()->toPages()]) ?> <?php if ($page->linkedPages()->isNotEmpty()): ?>
<?php snippet('events-grid', ['title' => 'Pour aller plus loin', 'events' => $page->linkedPages()->toPages()]) ?>
<?php endif ?>
<?php snippet('callout') ?> <?php snippet('callout') ?>