add bookingUrl field for local events

This commit is contained in:
isUnknown 2024-09-06 14:20:46 +02:00
parent 3ecb964f29
commit 64b53f2fc4
3 changed files with 19 additions and 5 deletions

View file

@ -130,9 +130,10 @@
background-color: var(--color-yellow);
}
.session:first-child > a {
/* .session:first-child > a {
border-top: var(--border) !important;
}
} */
.session:not(:last-child) {
border-bottom: var(--border);
}

View file

@ -39,6 +39,13 @@ tabs:
isMapadoEvent: true
mapadoSlug:
type: hidden
bookingUrl:
label: Lien de réservation
type: url
width: 1/2
when:
isMapadoEvent: false
help: Laisser vide pour afficher la mention "Entrée libre"
duration:
label: Durée
type: text

View file

@ -31,6 +31,7 @@
<section class="collapsable-sections">
<?php snippet('collapsable-section', ['title' => 'Prenez vos places !', 'padding' => false], slots: true) ?>
<!--========== KIRBY EVENT ==========-->
<?php if ($page->isMapadoEvent() != 'true'): ?>
<?php slot('content') ?>
@ -45,16 +46,21 @@
$formatter = new IntlDateFormatter('fr_FR', IntlDateFormatter::FULL, IntlDateFormatter::NONE);
$formattedDate = $formatter->format($date);
?>
<div class="session grid">
<div class="session collapsable__item--padding grid">
<p><?= $formattedDate ?></p>
<p><?= $session->time() ?></p>
<p><?= $page->place() ?></p>
<a class="ticket-link" title="Entrée libre"><?php snippet('ticket') ?> Entrée libre</a>
<p><?= $page->place() ?></p>
<?php if ($page->bookingUrl()->isEmpty()): ?>
<a class="ticket-link" title="Entrée libre" disabled><?php snippet('ticket') ?> Entrée libre</a>
<?php else: ?>
<a class="ticket-link" title="Plateforme de réservation"><?php snippet('ticket') ?> Réserver</a>
<?php endif ?>
</div>
<?php endforeach ?>
</div>
<?php endslot() ?>
<!--========== MAPADO EVENT ==========-->
<?php else: ?>
<?php slot('content') ?>