fix next / previous events

This commit is contained in:
isUnknown 2024-11-04 15:09:17 +01:00
parent e5e8cad6ca
commit 94cf47ee43
3 changed files with 14 additions and 9 deletions

View file

@ -107,12 +107,12 @@
<section class="yellow">
<h2>Prochainement <?= $page->children()->first()->title() ?></h2>
</section>
<?php snippet('events-grid', ['events' => $futureEvents, 'columns' => 3]) ?>
<?php if ($pastEvents->count() > 0): ?>
<?php snippet('events-grid', ['events' => $events['next'], 'columns' => 3]) ?>
<?php if ($events['previous']->count() > 0): ?>
<section class="yellow">
<h2>Événements passés</h2>
</section>
<?php snippet('events-grid', ['events' => $pastEvents, 'columns' => 3]) ?>
<?php snippet('events-grid', ['events' => $events['previous'], 'columns' => 3]) ?>
<?php endif ?>
</div>
</template>