index-main/site/templates/home.php

295 lines
9.7 KiB
PHP
Raw Normal View History

2025-10-07 16:21:26 +02:00
<?php snippet('header') ?>
2026-01-06 11:19:25 +01:00
<main>
2026-01-13 12:13:02 +01:00
2026-01-27 22:24:47 +01:00
<section class="section--home" id="home__hero">
<div class="section--inner">
<p class="baseline">Index est une ONG dinvestigation numérique, au&nbsp;service du public, de&nbsp;la&nbsp;vérité et de&nbsp;la&nbsp;justice.</p>
2026-01-13 12:13:02 +01:00
<button class="btn--bold-inline">
2026-01-27 19:09:56 +01:00
<a href="#">
<span class="text">En savoir plus</span>
<span class="icon"><?= svg('assets/icons/arrow-left.svg') ?></span>
</a>
</button>
2026-01-27 22:24:47 +01:00
</div>
2026-01-13 12:13:02 +01:00
</section>
2026-01-27 19:09:56 +01:00
2026-01-13 12:18:22 +01:00
<section class="section--home" id="home__investigations">
2026-01-13 12:13:02 +01:00
<div class="section--inner">
2026-01-27 19:09:56 +01:00
<div class="col-left">
2026-01-27 23:06:29 +01:00
<?php $investigationsPage = site()->find('enquetes'); ?>
<h2 class="title-section"><?= $investigationsPage ? $investigationsPage->title() : 'Enquêtes' ?></h2>
<?php if ($investigationsPage && $investigationsPage->chapo()->isNotEmpty()): ?>
2026-01-27 21:28:14 +01:00
<p class="description-section">
2026-01-27 23:06:29 +01:00
<?= $investigationsPage->chapo() ?>
2026-01-27 19:09:56 +01:00
</p>
2026-01-27 23:06:29 +01:00
<?php endif ?>
2026-01-27 19:09:56 +01:00
<button class="btn--bold-inline">
<a href="/enquetes">
<span class="text">Voir les enquêtes</span>
<span class="icon"><?= svg('assets/icons/arrow-left.svg') ?></span>
</a>
</button>
</div>
<div class="col-right">
2026-01-27 19:58:53 +01:00
<div class="home-investigations-slider swiper">
<div class="swiper-wrapper">
2026-01-27 19:09:56 +01:00
2026-01-29 20:57:17 +01:00
<?php
$latestInvestigations = site()->find('enquetes')->children()->listed()->sortBy('created', 'desc')->limit(3);
foreach ($latestInvestigations as $investigation):
?>
<div class="swiper-slide">
<div class="swiper-slide__inner">
<article class="card--article">
<?php if ($cover = $investigation->cover()->toFile()): ?>
<figure>
<img src="<?= $cover->url() ?>" alt="<?= $investigation->title()->esc() ?>">
</figure>
<?php endif ?>
<div class="content">
<h4 class="title"><a href="<?= $investigation->url() ?>"><?= $investigation->title()->esc() ?></a></h4>
2026-01-30 12:27:44 +01:00
<time class="time-alone" datetime="<?= $investigation->incidentDate()->toDate('yyyy-MM-dd') ?>"><?= $investigation->incidentDate()->toDate('d MMMM yyyy', 'fr_FR') ?></time>
2026-01-29 20:57:17 +01:00
<?php if ($investigation->chapo()->isNotEmpty()): ?>
<p class="description"><?= $investigation->chapo()->excerpt(200) ?></p>
<?php endif ?>
</div>
<?php if ($keywords = $investigation->keywords()->split()): ?>
<div class="keywords-wrapper">
<ul class="keywords">
<?php foreach ($keywords as $keyword): ?>
<li><a href="#keyword" target="_blank"><?= esc($keyword) ?></a></li>
<?php endforeach ?>
</ul>
</div>
<?php endif ?>
<?php if ($investigation->pinned()->toBool()): ?>
<div class="pin"><?= svg('assets/icons/pin.svg') ?></div>
<?php endif ?>
<a class="link-block" href="<?= $investigation->url() ?>"></a>
</article>
</div>
</div>
<?php endforeach ?>
2026-01-27 19:09:56 +01:00
2026-01-27 19:58:53 +01:00
</div> <!-- swiper-wrapper -->
<!-- Navigation buttons -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
2026-01-27 19:09:56 +01:00
2026-01-27 19:58:53 +01:00
<!-- Pagination -->
<div class="swiper-pagination"></div>
</div> <!-- home-investigations-slider -->
2026-01-27 19:09:56 +01:00
</div> <!-- col-right-->
</div>
</section>
<section class="section--home" id="home__impacts">
<div class="section--inner">
<div class="col-left">
2026-01-27 23:06:29 +01:00
<?php $impactsPage = site()->find('impacts'); ?>
<h2 class="title-section"><?= $impactsPage ? $impactsPage->title() : 'Impacts' ?></h2>
<?php if ($impactsPage && $impactsPage->chapo()->isNotEmpty()): ?>
2026-01-27 21:28:14 +01:00
<p class="description-section">
2026-01-27 23:06:29 +01:00
<?= $impactsPage->chapo() ?>
2026-01-27 19:09:56 +01:00
</p>
2026-01-27 23:06:29 +01:00
<?php endif ?>
2026-01-27 19:09:56 +01:00
<button class="btn--bold-inline">
2026-01-27 23:06:29 +01:00
<a href="/impacts">
2026-01-27 19:09:56 +01:00
<span class="text">Voir les impacts</span>
<span class="icon"><?= svg('assets/icons/arrow-left.svg') ?></span>
</a>
</button>
</div>
<div class="col-right">
2026-01-27 19:58:53 +01:00
2026-01-30 12:27:44 +01:00
<!-- Contenu statique temporaire -->
<div class="card--impact" data-impact-type="media">
<div class="card--impact__inner">
2026-01-27 19:58:53 +01:00
<p class="tag">Médiatique</p>
2026-01-30 12:27:44 +01:00
2026-01-28 01:15:51 +01:00
<?php snippet('card-open-graph') ?>
2026-01-30 12:27:44 +01:00
<ul class="investigations">
2026-01-28 01:15:51 +01:00
<li><a href="/enquetes/l-execution-de-nidal-et-khaled-amirah-a-naplouse"><span class="icon"><?= svg('assets/icons/article.svg') ?></span> L'exécution de Nidal et Khaled 'Amirah à Naplouse</a></li>
2026-01-30 12:27:44 +01:00
<li><a href="/enquetes/l-homicide-de-nahel-merzouk"><span class="icon"><?= svg('assets/icons/article.svg') ?></span> Lhomicide de Nahel Merzouk</a></li>
</ul>
<div class="keywords-wrapper">
<ul class="keywords">
<li><a href="#keyword" target="_blank">Occupation</a></li>
<li><a href="#keyword" target="_blank">Colonialité</a></li>
<li><a href="#keyword" target="_blank">Forces armées</a></li>
</ul>
</div>
</div>
2026-01-27 19:58:53 +01:00
</div>
2026-01-28 01:15:51 +01:00
<div class="card--impact has-link" data-impact-type="judiciaire">
2026-01-30 12:27:44 +01:00
<div class="card--impact__inner">
2026-01-27 19:58:53 +01:00
<p class="tag">Judiciaire</p>
<p class="date">12 Dec 2025</p>
<div class="content">
2026-01-28 01:15:51 +01:00
<p>La justice israélienne déclare ouvrir une enquête sur "les circonstances de la mort de Nidal et Khaled Amirah".
2026-01-27 19:58:53 +01:00
</p>
</div>
2026-01-30 12:27:44 +01:00
2026-01-28 01:15:51 +01:00
<ul class="investigations">
<li><a href="/enquetes/l-execution-de-nidal-et-khaled-amirah-a-naplouse"><span class="icon"><?= svg('assets/icons/article.svg') ?></span> L'exécution de Nidal et Khaled 'Amirah à Naplouse</a></li>
</ul>
2026-01-30 12:27:44 +01:00
<div class="keywords-wrapper">
<ul class="keywords">
<li><a href="#keyword" target="_blank">Occupation</a></li>
<li><a href="#keyword" target="_blank">Colonialité</a></li>
</ul>
</div>
2026-01-28 01:15:51 +01:00
<button class="btn--go-to"><a href="#" target="_blank"><?= svg('assets/icons/arrow-left.svg') ?></a></button>
<a class="link-block" href="#" target="_blank"></a>
2026-01-30 12:27:44 +01:00
</div>
2026-01-27 19:58:53 +01:00
</div>
2026-01-28 01:15:51 +01:00
<div class="card--impact has-link" data-impact-type="judiciaire">
2026-01-30 12:27:44 +01:00
<div class="card--impact__inner">
2026-01-27 19:58:53 +01:00
<p class="tag">Judiciaire</p>
<p class="date">12 Dec 2025</p>
<div class="content">
2026-01-28 01:15:51 +01:00
<p>La justice israélienne déclare ouvrir une enquête sur "les circonstances de la mort de Nidal et Khaled Amirah"
2026-01-27 19:58:53 +01:00
</p>
</div>
2026-01-28 01:15:51 +01:00
<ul class="investigations">
<li><a href="/enquetes/l-execution-de-nidal-et-khaled-amirah-a-naplouse"><span class="icon"><?= svg('assets/icons/article.svg') ?></span> L'exécution de Nidal et Khaled 'Amirah à Naplouse</a></li>
2026-01-30 12:27:44 +01:00
</ul>
<div class="keywords-wrapper">
<ul class="keywords">
<li><a href="#keyword" target="_blank">Occupation</a></li>
<li><a href="#keyword" target="_blank">Colonialité</a></li>
<li><a href="#keyword" target="_blank">Forces armées</a></li>
</ul>
</div>
2026-01-27 19:58:53 +01:00
2026-01-30 12:27:44 +01:00
<button class="btn--go-to"><a href="#" target="_blank"><?= svg('assets/icons/arrow-left.svg') ?></a></button>
<a class="link-block" href="#" target="_blank"></a>
</div>
2026-01-27 19:58:53 +01:00
</div>
2026-01-30 12:27:44 +01:00
</div><!-- col-right -->
2026-01-27 19:58:53 +01:00
</div>
2026-01-27 19:09:56 +01:00
</section>
2026-01-27 19:58:53 +01:00
2026-01-27 19:09:56 +01:00
<section class="section--home" id="home__folders">
<div class="section--inner">
<div class="col-left">
2026-01-27 23:06:29 +01:00
<?php $foldersPage = site()->find('dossiers'); ?>
<h2 class="title-section"><?= $foldersPage ? $foldersPage->title() : 'Dossiers' ?></h2>
<?php if ($foldersPage && $foldersPage->chapo()->isNotEmpty()): ?>
2026-01-27 21:28:14 +01:00
<p class="description-section">
2026-01-27 23:06:29 +01:00
<?= $foldersPage->chapo() ?>
2026-01-27 19:09:56 +01:00
</p>
2026-01-27 23:06:29 +01:00
<?php endif ?>
2026-01-27 19:09:56 +01:00
<button class="btn--bold-inline">
<a href="/dossiers">
<span class="text">Voir les dossiers</span>
<span class="icon"><?= svg('assets/icons/arrow-left.svg') ?></span>
</a>
</button>
</div>
<div class="col-right">
2026-01-27 19:58:53 +01:00
<?php
$latestFolders = site()->find('dossiers') ? site()->find('dossiers')->children()->listed()->sortBy('created', 'desc')->limit(2) : [];
if (count($latestFolders) > 0):
foreach ($latestFolders as $folder):
?>
<article class="card--folder">
<?php if ($cover = $folder->cover()->toFile()): ?>
<figure>
<img src="<?= $cover->url() ?>" alt="<?= $folder->title()->esc() ?>">
</figure>
<?php endif ?>
<div class="content">
2026-01-27 23:06:29 +01:00
<h4 class="title"><a href="<?= $folder->url() ?>"><span class="icon"><?= svg('assets/icons/folder.svg') ?></span><?= $folder->title()->esc() ?></a></h4>
2026-01-27 19:58:53 +01:00
<?php if ($folder->description()->isNotEmpty()): ?>
<p class="short"><?= $folder->description()->excerpt(200) ?></p>
<?php endif ?>
<?php
// Compter les enquêtes associées à ce dossier
$investigationsCount = site()->find('enquetes')->children()->listed()->filter(function($investigation) use ($folder) {
return $investigation->folder()->value() === $folder->slug();
})->count();
?>
<ul>
<?php if ($investigationsCount > 0): ?>
<li><?= $investigationsCount ?> enquête<?= $investigationsCount > 1 ? 's' : '' ?></li>
<?php endif ?>
<li>8 impacts</li>
</ul>
</div>
<button class="btn--go-to"><a href="<?= $folder->url() ?>" target="_blank"><?= svg('assets/icons/arrow-left.svg') ?></a></button>
<a class="link-block" href="<?= $folder->url() ?>"></a>
</article>
<?php endforeach ?>
<?php endif ?>
</div> <!-- col-right -->
</div>
2026-01-13 12:13:02 +01:00
</section>
2026-01-27 19:58:53 +01:00
2026-01-06 11:19:25 +01:00
</main>
2025-10-07 16:21:26 +02:00
<?php snippet('footer') ?>