fix bookableStock

This commit is contained in:
isUnknown 2024-09-02 14:02:13 +02:00
parent ea052d22f0
commit 9b4e35f3af
8 changed files with 79 additions and 28 deletions

View file

@ -67,12 +67,44 @@
<div class="program-content__events">
<section class="collapsable-sections">
<?php foreach($currentSeasonSessions as $month => $sessions): ?>
<?php if (count($sessions) > 0): ?>
<?php snippet('collapsable-section', ['title' => $month], slots: true) ?>
<?php snippet('collapsable-section', ['title' => $month, 'sessions' => true], slots: true) ?>
<?php slot('content') ?>
<div class="session grid">
<?php
foreach($sessions as $session):
$date = new DateTime($session['date']);
$formatter = new IntlDateFormatter('fr_FR', IntlDateFormatter::NONE, IntlDateFormatter::NONE);
$formattedDate = $formatter->formatObject($date, "d MMMM");
try {
$endTime = strlen($session['duration']) > 0 ? getEndTime($session) : false;
} catch (\Throwable $th) {
throw new Exception($session['title'], 1);
}
?>
<div class="session__info">
<p><?= $formattedDate ?></p>
<p><?= $session['time'] ?><?php e($endTime, ' - ' . $endTime) ?></p>
</div>
<div class="session__info">
<p><strong><?= $session['title'] ?></strong></p>
<p><?= $session['authors'] ?></p>
</div>
<div class="session__info">
<p><?= $session['place'] ?></p>
</div>
<div class="session__info">
<a class="ticket-link" title="Entrée libre"><?php snippet('ticket') ?> Entrée libre</a>
</div>
<?php endforeach ?>
</div>
<?php endslot() ?>
<?php endsnippet() ?>
<?php endif ?>
<?php endforeach ?>
</section>
</div>