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] {
cursor: not-allowed;
pointer-events: none;
}
a:focus-visible,

View file

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

View file

@ -51,17 +51,25 @@
$formatter = new IntlDateFormatter('fr_FR', IntlDateFormatter::FULL, IntlDateFormatter::NONE);
$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">
<p><?= $formattedDate ?></p>
<p><?= e($session->timeComplement()->isEmpty() == 'true', $session->time(), $session->time() . ' ' . $session->timeComplement()) ?></p>
<p><?= $session->time() ?></p>
<p><?= $page->place() ?></p>
</div>
<div class="right-column">
<?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: ?>
<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 ?>
</div>
</div>