index-main/site/templates/investigations.php

90 lines
3.1 KiB
PHP
Raw Normal View History

2025-10-07 16:21:26 +02:00
<?php snippet('header') ?>
2026-01-06 17:14:32 +01:00
2026-01-13 10:48:10 +01:00
<h2 class="page__title"><?= $page->title() ?></h2>
2026-01-08 14:53:08 +01:00
<div class="page__description">
2026-01-06 17:14:32 +01:00
<p>
2026-01-13 10:48:10 +01:00
<?= $page->chapo() ?>
2026-01-06 17:14:32 +01:00
</p>
2026-01-08 14:53:08 +01:00
</div>
<?php snippet('search-form') ?>
<div class="page__sort">
2026-01-08 16:27:21 +01:00
<button class="sort btn--small btn--light no-link" data-sort-type="down"><p>Trier par date</p> <span class="arrow"><?= svg('assets/icons/arrow-left.svg') ?></span></button>
<button class="sort btn--small btn--light no-link" ><span class="icon"><?= svg('assets/icons/filter.svg') ?></span><p>Lieu</p></button>
<button class="sort btn--small btn--light no-link" ><span class="icon"><?= svg('assets/icons/filter.svg') ?></span><p>Mots-clés</p></button>
2026-01-08 14:53:08 +01:00
</div>
2026-01-06 17:14:32 +01:00
<section id="container-cards">
2026-01-13 10:48:10 +01:00
<?php foreach ($page->children()->listed() as $investigation): ?>
2026-01-06 17:14:32 +01:00
<article class="card--article">
2026-01-13 10:48:10 +01:00
<?php if ($cover = $investigation->cover()->toFile()): ?>
2026-01-06 17:14:32 +01:00
<figure>
2026-01-13 10:48:10 +01:00
<img src="<?= $cover->url() ?>" alt="<?= $investigation->title()->esc() ?>">
2026-01-06 17:14:32 +01:00
</figure>
2026-01-13 10:48:10 +01:00
<?php endif ?>
2026-01-06 17:14:32 +01:00
<div class="content">
2026-01-13 10:48:10 +01:00
<h4 class="title"><a href="<?= $investigation->url() ?>"><?= $investigation->title()->esc() ?></a></h4>
2026-01-06 17:14:32 +01:00
2026-01-13 10:48:10 +01:00
<?php if ($investigation->chapo()->isNotEmpty()): ?>
<p class="description"><?= $investigation->chapo()->excerpt(200) ?></p>
<?php endif ?>
2026-01-06 17:14:32 +01:00
<dl class="dl">
2026-01-13 10:48:10 +01:00
<?php if ($investigation->incidentDate()->isNotEmpty()): ?>
2026-01-06 17:14:32 +01:00
<div class="dl__group">
2026-01-13 10:48:10 +01:00
<dt>Date de l'incident</dt>
2026-01-13 10:57:17 +01:00
<dd><time datetime="<?= $investigation->incidentDate()->toDate('yyyy-MM-dd') ?>"><?= $investigation->incidentDate()->toDate('d MMMM yyyy', 'fr_FR') ?></time></dd>
2026-01-06 17:14:32 +01:00
</div>
2026-01-13 10:48:10 +01:00
<?php endif ?>
2026-01-06 17:14:32 +01:00
2026-01-13 10:48:10 +01:00
<?php if ($partners = $investigation->partners()->toStructure()): ?>
<?php if ($partners->isNotEmpty()): ?>
2026-01-06 17:14:32 +01:00
<div class="dl__group">
<dt>Partenaire(s)</dt>
<dd>
2026-01-13 10:48:10 +01:00
<?php $partnerNames = [] ?>
<?php foreach ($partners as $partner): ?>
<?php $partnerNames[] = $partner->name()->value() ?>
<?php endforeach ?>
<?= implode(', ', $partnerNames) ?>
2026-01-06 17:14:32 +01:00
</dd>
</div>
2026-01-13 10:48:10 +01:00
<?php endif ?>
<?php endif ?>
2026-01-06 17:14:32 +01:00
2026-01-13 10:48:10 +01:00
<?php if ($investigation->incidentLocation()->isNotEmpty()): ?>
2026-01-06 17:14:32 +01:00
<div class="dl__group">
2026-01-13 10:48:10 +01:00
<dt>Lieu de l'incident</dt>
<dd><?= $investigation->incidentLocation()->esc() ?></dd>
2026-01-06 17:14:32 +01:00
</div>
2026-01-13 10:48:10 +01:00
<?php endif ?>
2026-01-06 17:14:32 +01:00
2026-01-13 10:48:10 +01:00
<?php if ($keywords = $investigation->keywords()->split()): ?>
<?php if (count($keywords) > 0): ?>
2026-01-06 17:14:32 +01:00
<div class="dl__group dl__group__keywords">
<dt>Mots-clés</dt>
<dd>
<ul class="keywords">
2026-01-13 10:48:10 +01:00
<?php foreach ($keywords as $keyword): ?>
<li><a href="#"><?= esc($keyword) ?></a></li>
<?php endforeach ?>
2026-01-06 17:14:32 +01:00
</ul>
</dd>
</div>
2026-01-13 10:48:10 +01:00
<?php endif ?>
<?php endif ?>
2026-01-06 17:14:32 +01:00
</dl>
</div>
2026-01-13 10:48:10 +01:00
<a class="link-block" href="<?= $investigation->url() ?>"></a>
2026-01-06 17:14:32 +01:00
</article>
2026-01-13 10:48:10 +01:00
<?php endforeach ?>
2026-01-06 17:14:32 +01:00
</section>
2025-10-07 16:21:26 +02:00
<?php snippet('footer') ?>