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

32 lines
No EOL
1.4 KiB
PHP

<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>
<div class="image-wrapper">
<?php if ($event->gallery()->toFiles()->count() > 1): ?>
<?php snippet('picture', [
'file' => $event->gallery()->toFiles()->first(),
'class' => 'image-cover',
'size' => (100 / (12 / $span) - 10)
]) ?>
<?php endif ?>
<?php
$file = $event->gallery()->toFiles()->count() > 1 ? $event->gallery()->toFiles()->nth(1) : $event->gallery()->toFiles()->first();
snippet('picture', ["file" => $file, 'size' => (100 / (12 / $span) - 10), 'alt' => null]);
?>
</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(), 'size' => (100 / (12 / $span) - 10)]) ?>
<?php elseif($event->bookingUrl()->isNotEmpty()): ?>
<?php snippet('ticket', ['link' => $event->bookingUrl(), 'size' => (100 / (12 / $span) - 10)]) ?>
<?php endif ?>
</div>
<div>
<div class="event-card__authors">
<?= $event->authors() ?>
</div>
<p><?= $event->schedule() ?></p>
</div>
</div>
</div>