nouveau-theatre-de-besancon/site/snippets/event-card.php

32 lines
1.4 KiB
PHP
Raw Normal View History

2024-09-19 08:06:58 +02:00
<div class="event-card grid__item" style="--span: <?= $span ?>; --color: <?= $event->color()->isEmpty() || $event->color() == '#fff' ? 'var(--color-season)' : $event->color() ?>">
<a class="event-card__link" href="<?= $event->url() ?>"><span class="sr-only">En savoir plus sur l'événement</s></span></a>
2024-09-19 08:06:58 +02:00
<div class="image-wrapper">
2024-09-05 12:37:46 +02:00
<?php if ($event->gallery()->toFiles()->count() > 1): ?>
2024-09-17 15:33:26 +02:00
<?php snippet('picture', [
2024-09-19 14:47:46 +02:00
'file' => $event->gallery()->toFiles()->first(),
2024-09-19 10:21:26 +02:00
'class' => 'image-cover',
'size' => (100 / (12 / $span) - 10)
2024-09-17 15:33:26 +02:00
]) ?>
2024-09-05 12:37:46 +02:00
<?php endif ?>
2024-09-06 13:58:37 +02:00
<?php
$file = $event->gallery()->toFiles()->count() > 1 ? $event->gallery()->toFiles()->nth(1) : $event->gallery()->toFiles()->first();
2024-09-19 14:47:46 +02:00
snippet('picture', ["file" => $file, 'size' => (100 / (12 / $span) - 10), 'alt' => null]);
2024-09-06 13:58:37 +02:00
?>
2024-09-05 12:37:46 +02:00
</div>
2024-09-04 16:09:25 +02:00
<div class="event-card__infos">
<div>
2024-09-05 12:23:07 +02:00
<h5><?= $event->title() ?></h5>
2024-09-04 16:09:25 +02:00
<?php if ($event->isMapadoEvent() == 'true'): ?>
2024-09-19 10:21:26 +02:00
<?php snippet('ticket', ['link' => option('ticketingUrl') . 'event/' . $event->mapadoSlug(), 'size' => (100 / (12 / $span) - 10)]) ?>
<?php elseif($event->bookingUrl()->isNotEmpty()): ?>
<?php snippet('ticket', ['link' => $event->bookingUrl(), 'size' => (100 / (12 / $span) - 10)]) ?>
2024-09-04 16:09:25 +02:00
<?php endif ?>
</div>
<div>
<div class="event-card__authors">
<?= $event->authors() ?>
</div>
2024-09-04 16:09:25 +02:00
<p><?= $event->schedule() ?></p>
</div>
2024-09-04 16:09:25 +02:00
</div>
2024-07-30 19:03:01 +02:00
</div>