nouveau-theatre-de-besancon/site/templates/program.php

83 lines
2.3 KiB
PHP
Raw Normal View History

2024-08-28 19:11:58 +02:00
<?php snippet('header') ?>
2024-08-30 14:37:13 +02:00
<div
2024-08-30 15:16:41 +02:00
class="program-methods"
2024-08-30 14:37:13 +02:00
x-data="{
setInitialTab() {
const queryString = window.location.search;
if (queryString.length === 0) return 'Programme';
const urlParams = new URLSearchParams(queryString);
const tab = urlParams.get('tab');
return tab;
}
}"
>
2024-08-30 15:16:41 +02:00
<div class="program-data"
2024-08-30 14:37:13 +02:00
x-data="{
tab: setInitialTab()
}"
>
2024-08-30 15:16:41 +02:00
<section class="filters">
<button
x-data="{title: 'Calendrier'}"
x-text="title"
@click="tab = title"
></button>
<button
x-data="{title: 'Spectacles'}"
x-text="title"
@click="tab = title"
></button>
<button
x-data="{title: 'Autres événements'}"
x-text="title"
@click="tab = title"
></button>
<button
x-data="{title: 'Ici & Là'}"
x-text="title"
@click="tab = title"
></button>
<button
x-data="{title: 'Saisons précédentes'}"
x-text="title"
@click="tab = title"
></button>
</section>
2024-08-30 14:37:13 +02:00
<section class="page-title">
<h1 x-text="tab"></h1>
</section>
2024-08-30 15:16:41 +02:00
<!-- Programme -->
<template x-if="tab === 'Programme'">
<div class="program-content__events">
<section class="yellow">
<h2>À venir <?= $page->children()->first()->title() ?></h2>
</section>
<?php snippet('events-grid', ['events' => $nextEvents, 'columns' => 3]) ?>
<section class="yellow">
<h2>Événements passés</h2>
</section>
<?php snippet('events-grid', ['events' => $previousEvents, 'columns' => 3]) ?>
</div>
</template>
<!-- Calendrier -->
<template x-if="tab === 'Calendrier'">
<div class="program-content__events">
<section class="collapsable-sections">
<?php foreach($currentSeasonSessions as $month => $sessions): ?>
<?php if (count($sessions) > 0): ?>
<?php snippet('collapsable-section', ['title' => $month], slots: true) ?>
<?php slot('content') ?>
<?php endslot() ?>
<?php endsnippet() ?>
<?php endif ?>
<?php endforeach ?>
</section>
</div>
</template>
2024-08-30 14:37:13 +02:00
</div>
</div>
2024-08-28 19:11:58 +02:00
<?php snippet('footer') ?>