custom event (no connected to Mapado) : add ticketing url and background color

This commit is contained in:
isUnknown 2025-10-01 11:18:20 +02:00
parent 79f754466b
commit c5ba561a9c
3 changed files with 42 additions and 18 deletions

View file

@ -35,7 +35,7 @@ picture svg {
} }
a[disabled] { a[disabled] {
cursor: not-allowed; pointer-events: none;
} }
a:focus-visible, a:focus-visible,

View file

@ -50,7 +50,7 @@ tabs:
mapadoSlug: mapadoSlug:
type: hidden type: hidden
bookingUrl: bookingUrl:
label: Lien de réservation label: Lien de réservation par défaut
type: url type: url
width: 1/2 width: 1/2
when: when:
@ -82,11 +82,15 @@ tabs:
type: structure type: structure
columns: columns:
date: date:
width: 1/3 width: 1/5
time: time:
width: 1/3 width: 1/5
timeComplement: ticketingUrl:
width: 1/3 width: 1/5
isFull:
width: 1/5
backgroundColor:
width: 1/5
when: when:
isMapadoEvent: false isMapadoEvent: false
fields: fields:
@ -94,18 +98,30 @@ tabs:
type: date type: date
icon: calendar icon: calendar
display: DD/MM/YYYY display: DD/MM/YYYY
width: 1/3 width: 1/2
time: time:
label: Horaire de début label: Horaire et complément
type: text type: text
help: | help: |
Format : 20h00 ou 20h (pas 20:00) Format : 20h00 ou 20h (pas 20:00)
width: 1/3 width: 1/2
timeComplement: ticketingUrl:
label: Complément label: Lien de réservation
help: Affiché après l'horaire type: url
type: text isFull:
width: 1/3 label: Complet
type: toggle
text:
off: non
on: oui
default: off
width: 1/4
backgroundColor:
type: color
label: Couleur de fond
width: 3/4
default: "#ffffff"
remoteSessions: remoteSessions:
label: Séances label: Séances
type: structure type: structure

View file

@ -51,17 +51,25 @@
$formatter = new IntlDateFormatter('fr_FR', IntlDateFormatter::FULL, IntlDateFormatter::NONE); $formatter = new IntlDateFormatter('fr_FR', IntlDateFormatter::FULL, IntlDateFormatter::NONE);
$formattedDate = $formatter->format($date); $formattedDate = $formatter->format($date);
?> ?>
<div class="session collapsable__item--padding grid"> <div class="session collapsable__item--padding grid"<?= $session->backgroundColor()->isNotEmpty(), ' style="background-color: ' . $session->backgroundColor() . ';"' ?>>
<div class="left-column"> <div class="left-column">
<p><?= $formattedDate ?></p> <p><?= $formattedDate ?></p>
<p><?= e($session->timeComplement()->isEmpty() == 'true', $session->time(), $session->time() . ' ' . $session->timeComplement()) ?></p> <p><?= $session->time() ?></p>
<p><?= $page->place() ?></p> <p><?= $page->place() ?></p>
</div> </div>
<div class="right-column"> <div class="right-column">
<?php if ($page->bookingUrl()->isEmpty()): ?> <?php if ($page->bookingUrl()->isEmpty()): ?>
<a class="ticket-link" title="Entrée libre" disabled><?php snippet('ticket') ?> Entrée libre</a> <a class="ticket-link" title="Entrée libre" disabled><?php snippet('ticket') ?> <?= e($session->isFull(), 'Complet', 'Entrée libre') ?></a>
<?php else: ?> <?php else: ?>
<a class="ticket-link" href="<?= $page->bookingUrl()->url() ?>" target="_blank" title="Plateforme de réservation"><?php snippet('ticket') ?> Réserver</a> <a
class="ticket-link"
href="<?= e($session->ticketingUrl()->isNotEmpty(), $session->ticketingUrl()->url(), $page->bookingUrl()->url()) ?>"
target="_blank"
title="Plateforme de réservation"
<?= e($session->isFull()->isTrue(), ' disabled') ?>
>
<?php snippet('ticket') ?> <?= e($session->isFull()->isTrue(), 'Complet', 'Réserver') ?>
</a>
<?php endif ?> <?php endif ?>
</div> </div>
</div> </div>