add title to home grid

This commit is contained in:
isUnknown 2024-08-28 11:28:22 +02:00
parent 303ccf5bce
commit 1ab84c2ea5
6 changed files with 19 additions and 5 deletions

View file

@ -2,6 +2,10 @@
--padding-vertical: calc(var(--space-m) / 2); --padding-vertical: calc(var(--space-m) / 2);
} }
.collapsable-sections + .events-grid {
border-top: none;
}
.events-grid h4 { .events-grid h4 {
margin-bottom: calc(var(--space-m) / 2); margin-bottom: calc(var(--space-m) / 2);
} }

View file

@ -3,7 +3,7 @@ footer {
box-sizing: border-box; box-sizing: border-box;
padding: var(--padding-vertical) var(--space-m); padding: var(--padding-vertical) var(--space-m);
} }
section:not(:last-child, .collapsable) { section:not(:last-child, .collapsable, .collapsable-sections) {
border-bottom: var(--border); border-bottom: var(--border);
} }

View file

@ -158,6 +158,8 @@ tabs:
linkedPages: linkedPages:
label: Pages liées label: Pages liées
type: pages type: pages
max: 4
help: 4 maximum
settingsTab: settingsTab:
label: Réglages label: Réglages
icon: cog icon: cog

View file

@ -1,8 +1,14 @@
<section class="events-grid"> <section class="events-grid">
<h4>À venir</h4> <h4><?= $title ?></h4>
<div class="grid"> <div class="grid">
<?php foreach($events as $event): ?> <?php foreach($events as $event): ?>
<?php snippet('event-card', ["event" => $event, "span" => 12 / $events->count()]) ?> <?php
$span = 4;
if ($events->count() === 4) {
$span = 3;
}
snippet('event-card', ["event" => $event, "span" => $span])
?>
<?php endforeach ?> <?php endforeach ?>
</div> </div>
</section> </section>

View file

@ -121,4 +121,6 @@
<?php endsnippet() ?> <?php endsnippet() ?>
<?php endif ?> <?php endif ?>
</section> </section>
<?php snippet('events-grid', ['title' => 'Pour aller plus loin', 'events' => $page->linkedPages()->toPages()]) ?>
<?php snippet('footer') ?> <?php snippet('footer') ?>

View file

@ -23,12 +23,12 @@
'asc' 'asc'
); );
snippet('events-grid', ['events' => $orderedEvents->slice(0, 2)]) snippet('events-grid', ['title' => 'À venir', 'events' => $orderedEvents->slice(0, 2)])
?> ?>
<?php snippet('newsletter-section') ?> <?php snippet('newsletter-section') ?>
<?php snippet('events-grid', ['events' => $orderedEvents->slice(2, 5)]) ?> <?php snippet('events-grid', ['title' => 'À venir', 'events' => $orderedEvents->slice(2, 5)]) ?>
<section class="callout"> <section class="callout">
<h4><?= $site->callout() ?></h4> <h4><?= $site->callout() ?></h4>