82 lines
2.8 KiB
PHP
82 lines
2.8 KiB
PHP
<?php snippet('header') ?>
|
|
<main>
|
|
|
|
<header class="page__header">
|
|
|
|
<h2 class="page__title"><?= $page->title() ?></h2>
|
|
|
|
<?php if ($page->chapo()->isNotEmpty()): ?>
|
|
<div class="page__description">
|
|
<p><?= $page->chapo() ?></p>
|
|
</div>
|
|
<?php endif ?>
|
|
</header>
|
|
|
|
|
|
<div class="page__sort">
|
|
<button class="sort btn--small no-link" data-sort-type="down"><p>Trier par date</p> <span class="arrow"><?= svg('assets/icons/arrow-left.svg') ?></span></button>
|
|
<div class="dropdown">
|
|
<button class="dropdown__trigger sort btn--small no-link"><span class="icon"><?= svg('assets/icons/filter.svg') ?></span><p>Catégories</p></button>
|
|
<div class="dropdown__content">
|
|
<ul>
|
|
<?php foreach (page('database')->impactCategories()->split() as $cat): ?>
|
|
<li><button type="button" data-filter="<?= esc(Str::slug($cat)) ?>"><?= esc($cat) ?></button></li>
|
|
<?php endforeach ?>
|
|
<li><button type="button" data-filter=""><?= t('filter.all') ?></button></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="page__content grid-masonry" data-sort-container>
|
|
|
|
<div class="grid-sizer"></div>
|
|
|
|
<?php foreach ($page->children()->listed()->sortBy('created', 'desc') as $impact): ?>
|
|
|
|
<?php
|
|
$categories = $impact->category()->split();
|
|
$category = $categories[0] ?? '';
|
|
$cover = $impact->cover()->toFile();
|
|
$investigations = $impact->linkedInvestigations()->toPages();
|
|
?>
|
|
|
|
<div class="card--block has-link"
|
|
data-impact-type="<?= esc(Str::slug($category)) ?>"
|
|
data-filter="<?= esc(Str::slug($category)) ?>"
|
|
data-date="<?= $impact->created()->isNotEmpty() ? $impact->created()->toDate('yyyy-MM-dd') : '' ?>">
|
|
|
|
<?php if ($cover): ?>
|
|
<figure><?php snippet('picture', ['file' => $cover]) ?></figure>
|
|
<?php endif ?>
|
|
|
|
<div class="group-top">
|
|
<p class="type">Impact</p>
|
|
<?php if ($category): ?>
|
|
<p class="category"><?= esc($category) ?></p>
|
|
<?php endif ?>
|
|
</div>
|
|
|
|
<h3 class="title"><?= $impact->title()->esc() ?></h3>
|
|
|
|
<?php if ($impact->created()->isNotEmpty()): ?>
|
|
<p class="date"><?= $impact->created()->toDate('d MMMM yyyy', 'fr_FR') ?></p>
|
|
<?php endif ?>
|
|
|
|
<?php if ($investigations->isNotEmpty()): ?>
|
|
<ul class="investigations">
|
|
<?php foreach ($investigations as $investigation): ?>
|
|
<li><a href="<?= $investigation->url() ?>"><?= $investigation->title()->esc() ?></a></li>
|
|
<?php endforeach ?>
|
|
</ul>
|
|
<?php endif ?>
|
|
|
|
<a class="link-block" href="<?= $impact->url() ?>"></a>
|
|
</div>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</div>
|
|
|
|
</main>
|
|
<?php snippet('footer') ?>
|