complete dossier
All checks were successful
Deploy / Deploy to Production (push) Successful in 17s

This commit is contained in:
Julie Blanc 2026-02-26 17:54:47 +01:00
parent e5727b5630
commit ec72fa474c
10 changed files with 220 additions and 45 deletions

View file

@ -8,21 +8,33 @@ $locale = $lang ? $lang->locale(LC_ALL) : 'fr_FR.UTF-8';
$dateLocale = substr(is_array($locale) ? reset($locale) : $locale, 0, 5);
$investigations = $page->linkedContent()->toPages();
$impacts = $page->linkedImpacts()->toPages();
$impacts = $page->linkedImpacts()->toPages();
$resources = $page->linkedResources()->toPages();
$news = $page->linkedNews()->toPages();
$projects = $page->linkedProjects()->toPages();
?>
<header class="page__header">
<p class="page__type"><?= t('package.type') ?></p>
<h2 class="page__title"><?= $page->title() ?></h2>
<?php if ($investigations->isNotEmpty() || $impacts->isNotEmpty()): ?>
<ul class="details">
<?php if ($investigations->isNotEmpty() || $impacts->isNotEmpty() || $resources->isNotEmpty() || $news->isNotEmpty() || $projects->isNotEmpty()): ?>
<ul class="list-nav">
<?php if ($investigations->isNotEmpty()): ?>
<li><a href="#investigations"><?= $investigations->count() ?> <?= $investigations->count() > 1 ? t('investigation.type.plural') : t('investigation.type') ?></a></li>
<?php endif ?>
<?php if ($impacts->isNotEmpty()): ?>
<li><a href="#impacts"><?= $impacts->count() ?> <?= $impacts->count() > 1 ? t('impact.type.plural') : t('impact.type') ?></a></li>
<?php endif ?>
<?php if ($resources->isNotEmpty()): ?>
<li><a href="#resources"><?= $resources->count() ?> <?= $resources->count() > 1 ? t('resource.type.plural') : t('resource.type') ?></a></li>
<?php endif ?>
<?php if ($news->isNotEmpty()): ?>
<li><a href="#news"><?= $news->count() ?> <?= $news->count() > 1 ? t('news.type.plural') : t('news.type') ?></a></li>
<?php endif ?>
<?php if ($projects->isNotEmpty()): ?>
<li><a href="#projects"><?= $projects->count() ?> <?= $projects->count() > 1 ? t('project.type.plural') : t('project.type') ?></a></li>
<?php endif ?>
</ul>
<?php endif ?>
@ -110,5 +122,102 @@ $impacts = $page->linkedImpacts()->toPages();
<?php endif ?>
<?php if ($resources->isNotEmpty()): ?>
<div class="package__section" id="resources">
<h3 class="section__title"><?= t('resources.title') ?> (<?= $resources->count() ?>)</h3>
<?php foreach ($resources as $resource): ?>
<div class="card--block-small has-link">
<div class="group-top">
<p class="type"><?= t('resource.type') ?></p>
<?php if ($resource->category()->isNotEmpty()): ?>
<p class="category"><?= $resource->category()->esc() ?></p>
<?php endif ?>
</div>
<h4 class="title"><?= $resource->title()->esc() ?></h4>
<?php if ($resource->created()->isNotEmpty()): ?>
<p class="date">
<time datetime="<?= $resource->created()->toDate('yyyy-MM-dd') ?>"><?= $resource->created()->toDate('d MMMM yyyy', $dateLocale) ?></time>
</p>
<?php endif ?>
<button class="btn--go-to">
<a href="<?= $resource->url() ?>"><?= svg('assets/icons/arrow-left.svg') ?></a>
</button>
<a class="link-block" href="<?= $resource->url() ?>" aria-hidden="true"></a>
</div>
<?php endforeach ?>
</div>
<?php endif ?>
<?php if ($news->isNotEmpty()): ?>
<div class="package__section" id="news">
<h3 class="section__title"><?= t('news.title') ?> (<?= $news->count() ?>)</h3>
<?php foreach ($news as $newsItem): ?>
<div class="card--block-small has-link">
<div class="group-top">
<p class="type"><?= t('news.type') ?></p>
<?php if ($newsItem->category()->isNotEmpty()): ?>
<p class="category"><?= $newsItem->category()->esc() ?></p>
<?php endif ?>
</div>
<h4 class="title"><?= $newsItem->title()->esc() ?></h4>
<?php if ($newsItem->created()->isNotEmpty()): ?>
<p class="date">
<time datetime="<?= $newsItem->created()->toDate('yyyy-MM-dd') ?>"><?= $newsItem->created()->toDate('d MMMM yyyy', $dateLocale) ?></time>
</p>
<?php endif ?>
<button class="btn--go-to">
<a href="<?= $newsItem->url() ?>"><?= svg('assets/icons/arrow-left.svg') ?></a>
</button>
<a class="link-block" href="<?= $newsItem->url() ?>" aria-hidden="true"></a>
</div>
<?php endforeach ?>
</div>
<?php endif ?>
<?php if ($projects->isNotEmpty()): ?>
<div class="package__section" id="projects">
<h3 class="section__title"><?= t('lab.title') ?> (<?= $projects->count() ?>)</h3>
<?php foreach ($projects as $project): ?>
<div class="card--block-small has-link">
<div class="group-top">
<p class="type"><?= t('project.type') ?></p>
<?php if ($project->category()->isNotEmpty()): ?>
<p class="category"><?= $project->category()->esc() ?></p>
<?php endif ?>
</div>
<h4 class="title"><?= $project->title()->esc() ?></h4>
<?php if ($project->created()->isNotEmpty()): ?>
<p class="date">
<time datetime="<?= $project->created()->toDate('yyyy-MM-dd') ?>"><?= $project->created()->toDate('d MMMM yyyy', $dateLocale) ?></time>
</p>
<?php endif ?>
<button class="btn--go-to">
<a href="<?= $project->url() ?>"><?= svg('assets/icons/arrow-left.svg') ?></a>
</button>
<a class="link-block" href="<?= $project->url() ?>" aria-hidden="true"></a>
</div>
<?php endforeach ?>
</div>
<?php endif ?>
</main>
<?php snippet('footer') ?>