program - calendar filters working
This commit is contained in:
parent
a2fd20c1cc
commit
3d24e61e12
4 changed files with 42 additions and 41 deletions
|
|
@ -29,39 +29,19 @@
|
|||
:class="tab === title ? 'strong' : ''"
|
||||
@click="if (tab === title) { tab = 'Programme' } else {tab = title}"
|
||||
></button>
|
||||
<button
|
||||
x-data="{
|
||||
title: 'Spectacles',
|
||||
get filterTitle() {
|
||||
return 'Calendrier — ' + this.title
|
||||
}
|
||||
}"
|
||||
x-text="title"
|
||||
:class="tab === filterTitle ? 'strong' : ''"
|
||||
@click="if (tab === filterTitle) { tab = 'Programme' } else { tab = filterTitle; filter = title }"
|
||||
></button>
|
||||
<button
|
||||
x-data="{
|
||||
title: 'Autres événements',
|
||||
get filterTitle() {
|
||||
return 'Calendrier — ' + this.title
|
||||
}
|
||||
}"
|
||||
x-text="title"
|
||||
:class="tab === filterTitle ? 'strong' : ''"
|
||||
@click="if (tab === filterTitle) { tab = 'Programme' } else { tab = filterTitle; filter = title }"
|
||||
></button>
|
||||
<button
|
||||
x-data="{
|
||||
title: 'Ici & Là',
|
||||
get filterTitle() {
|
||||
return 'Calendrier — ' + this.title
|
||||
}
|
||||
}"
|
||||
x-text="title"
|
||||
:class="tab === filterTitle ? 'strong' : ''"
|
||||
@click="if (tab === filterTitle) { tab = 'Programme' } else { tab = filterTitle; filter = title }"
|
||||
></button>
|
||||
<?php foreach($page->categories()->split() as $filter): ?>
|
||||
<button
|
||||
x-data="{
|
||||
title: '<?= $filter ?>',
|
||||
get filterTitle() {
|
||||
return 'Calendrier — ' + this.title
|
||||
}
|
||||
}"
|
||||
x-text="title"
|
||||
:class="tab === filterTitle ? 'strong' : ''"
|
||||
@click="if (tab === filterTitle) { tab = 'Programme' } else { tab = filterTitle; filter = title }"
|
||||
></button>
|
||||
<?php endforeach ?>
|
||||
</section>
|
||||
<section class="page-title">
|
||||
<h1 x-text="tab"></h1>
|
||||
|
|
@ -101,7 +81,8 @@
|
|||
} catch (\Throwable $th) {
|
||||
throw new Exception($session['title'], 1);
|
||||
}
|
||||
?>
|
||||
?>
|
||||
<template x-if="tab === 'Calendrier' || ('<?= $session['category'] ?>'.length > 0 && tab.includes('<?= $session['category'] ?>'))">
|
||||
<li class="collapsable__item--padding session grid js-link" style="--color: <?= $session['color'] ?>" @click="goTo(event, '<?= $session['event-url'] ?>')" title="En savoir plus">
|
||||
<div class="session__info">
|
||||
<p><?= $formattedDate ?></p>
|
||||
|
|
@ -138,6 +119,7 @@
|
|||
<?php endif ?>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endslot() ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue