This commit is contained in:
parent
3836144423
commit
4fee638a93
10 changed files with 342 additions and 143 deletions
|
|
@ -287,32 +287,54 @@ if ($relatedInvestigations->isEmpty()) {
|
|||
// KIRBY TO DO : récupérer s’il y a un dossier mr
|
||||
?>
|
||||
|
||||
<?php
|
||||
// Récupérer le dossier associé à cette investigation
|
||||
$folderSlug = $page->folder()->value();
|
||||
$folder = null;
|
||||
if (!empty($folderSlug) && site()->find('dossiers')) {
|
||||
$folder = site()->find('dossiers')->children()->filterBy('slug', $folderSlug)->first();
|
||||
}
|
||||
|
||||
if ($folder):
|
||||
?>
|
||||
<aside class="section__article" id="section__folder">
|
||||
<h3 class="section__title">Dans le dossier</h3>
|
||||
|
||||
<article class="card--folder">
|
||||
<figure>
|
||||
<img src="/media/pages/enquetes/l-homicide-de-nahel-merzouk/fe521629d6-1768297341/nahel-visuel1.png">
|
||||
<?php if ($cover = $folder->cover()->toFile()): ?>
|
||||
<figure>
|
||||
<img src="<?= $cover->url() ?>" alt="<?= $folder->title()->esc() ?>">
|
||||
</figure>
|
||||
<?php endif ?>
|
||||
<div class="content">
|
||||
<h4 class="title"><a href="#"><span class="icon"><?= svg('assets/icons/folder.svg') ?></span>Refus d’optempérer</a></h4>
|
||||
<h4 class="title"><a href="<?= $folder->url() ?>"><span class="icon"><?= svg('assets/icons/folder.svg') ?></span><?= $folder->title()->esc() ?></a></h4>
|
||||
|
||||
<p class="short">
|
||||
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Aperiam dolorum inventore itaque excepturi veritatis asperiores? Aliquid officiis reprehenderit sunt fugit dicta repudiandae dolores natus, doloremque illum, nesciunt, exercitationem vitae labore.
|
||||
</p>
|
||||
<?php if ($folder->description()->isNotEmpty()): ?>
|
||||
<p class="short"><?= $folder->description()->excerpt(200) ?></p>
|
||||
<?php endif ?>
|
||||
|
||||
<ul>
|
||||
<li>4 enquêtes</li>
|
||||
<li>8 impacts</li>
|
||||
</ul>
|
||||
<?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="#" target="_blank"><?= svg('assets/icons/arrow-left.svg') ?></a></button>
|
||||
<a class="link-block" href="#" target="_blank" aria-hidden="true"></a>
|
||||
<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() ?>" target="_blank" aria-hidden="true"></a>
|
||||
|
||||
</article>
|
||||
|
||||
</aside>
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue