This commit is contained in:
isUnknown 2025-02-03 15:29:26 +01:00
parent 3fd93ac292
commit 1e91353c86
3 changed files with 50 additions and 38 deletions

View file

@ -154,7 +154,7 @@ button.see-more {
}
/* ================= TEXT ITEM ================= */
.panel .text {
.texts .text {
margin-bottom: var(--unit--vertical);
}
.panel .text:first-child,

View file

@ -7,6 +7,13 @@ image:
columns:
- width: 1/3
sections:
fieldsSection:
type: fields
fields:
openDate:
label: Date d'ouverture
type: date
display: DD/MM/YYYY
texts:
label: Textes
type: pages

View file

@ -1,39 +1,44 @@
<?php snippet('header'); ?>
<?php snippet('header') ?>
<main id="<?= $page->template() ?>">
<article
x-data="{edito: false}"
>
<?php snippet('cover', slots: true) ?>
<?php slot('text') ?>
<h2 class="main-title <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h2>
<div class="edito" :class="edito ? '' : 'short'"><?= $page->edito() ?></div>
<button
:class="edito ? 'open' : 'close'"
class="see-more toggle-btn toggle-btn--left"
@click="edito = !edito"
>Lire</button>
<p class="h3">textes :</p>
<ul class="texts">
<?php foreach($page->children() as $article): ?>
<li
class="text"
>
<a href="<?= $article->url() ?>" class="text__title no-underline">
<h4><?= $article->title() ?></h4>
</a>
<div class="text__infos">
<p>
<span class="light">par</span>
<a class="author" href="/auteurs/<?= Str::slug($article->author()->toPage()->title()) ?>"><?= $article->author()->toPage()->title() ?></a><br>
<span class="light">publié le </span><?= $article->published()->toDate('d/m/Y') ?><br>
<span class="light">dans</span> <a href="<?= $article->parent()->url() ?>"><?= $article->parent()->title() ?></a> / <a href="/categories/<?= $article->category() ?>"><?= $article->category() ?></a>
</p>
<article>
<?php snippet('cover', array('isOpen' => true), slots: true) ?>
<?php slot('title') ?>
<h1 class="main-title"><?= $page->title() ?></h1>
<?php if ($page->subtitle()->isNotEmpty()): ?>
<h2 class="main-subtitle fs-l"><?= $page->subtitle()->inline() ?></h2>
<?php endif ?>
<p>
<span class="light">ouverte depuis le </span><?= $page->openDate()->toDate('d/m/Y') ?>
</p>
<?php endslot() ?>
<?php endsnippet() ?>
<div id="main-content">
<?php if ($page->chapo()->isNotEmpty()): ?>
<div id="chapo">
<?= $page->chapo() ?>
</div>
</li>
<?php endforeach ?>
</ul>
<?php endslot() ?>
<?php endsnippet() ?>
</article>
</main>
<?php endif ?>
<ul class="texts">
<?php foreach($page->children() as $article): ?>
<li
class="text"
>
<a href="<?= $article->url() ?>" class="text__title no-underline">
<h4><?= $article->title() ?></h4>
</a>
<div class="text__infos">
<p>
<span class="light">par</span>
<a class="author" href="/auteurs/<?= Str::slug($article->author()->toPage()->title()) ?>"><?= $article->author()->toPage()->title() ?></a><br>
<span class="light">publié le </span><?= $article->published()->toDate('d/m/Y') ?><br>
<span class="light">dans</span> <a href="<?= $article->parent()->url() ?>"><?= $article->parent()->title() ?></a> / <a href="/categories/<?= $article->category() ?>"><?= $article->category() ?></a>
</p>
</div>
</li>
<?php endforeach ?>
</div>
</article>
</main>
<?php snippet('footer') ?>