nouveau-theatre-de-besancon/site/snippets/event-card.php
2024-09-13 17:12:49 +02:00

26 lines
No EOL
964 B
PHP

<div class="event-card grid__item" style="--span: <?= $span ?>">
<a class="event-card__link" href="<?= $event->url() ?>"></a>
<div class="image-wrapper">
<?php if ($event->gallery()->toFiles()->count() > 1): ?>
<img class="image-cover" src="<?= $event->gallery()->toFiles()->first()->url() ?>" alt="">
<?php endif ?>
<?php
$file = $event->gallery()->toFiles()->count() > 1 ? $event->gallery()->toFiles()->nth(1) : $event->gallery()->toFiles()->first();
snippet('picture', ["file" => $file]);
?>
</div>
<div class="event-card__infos">
<div>
<h5><?= $event->title() ?></h5>
<?php if ($event->isMapadoEvent() == 'true'): ?>
<?php snippet('ticket', ['link' => option('ticketingUrl') . 'event/' . $event->mapadoSlug()]) ?>
<?php endif ?>
</div>
<div>
<div class="event-card__authors">
<?= $event->authors() ?>
</div>
<p><?= $event->schedule() ?></p>
</div>
</div>
</div>