summary-investigation → delete slides, dynamic nav
All checks were successful
Deploy / Deploy to Production (push) Successful in 12s

This commit is contained in:
Julie Blanc 2026-02-07 14:56:47 +01:00
parent aeb5abb7aa
commit 48ded249a3
9 changed files with 56 additions and 74 deletions

View file

@ -41,7 +41,6 @@ tabs:
type: select
options:
image: Image simple
slider: Slider d'images
video: Vidéo
default: image
width: 1/3
@ -52,7 +51,6 @@ tabs:
layout: cards
when:
heroType: image
heroType: slider
videoExtractUrl:
label: URL vidéo d'extrait (autoplay)
type: url

View file

@ -31,11 +31,34 @@ $report = $page->children()->filterBy('intendedTemplate', 'report')->first();
<div class="panel-left" id="banner--page">
<nav id="nav--page">
<ul>
<?php if ($page->heroType()->isNotEmpty() && ($page->heroImages()->toFile() || $page->videoExtractUrl()->isNotEmpty())): ?>
<li><a href="#">Vidéo</a></li>
<?php endif ?>
<?php if ($page->synthesis()->isNotEmpty()): ?>
<li><a href="#section__synthese">Synthèse</a></li>
<?php endif ?>
<li><a href="#section__impacts">Impacts</a></li>
<li><a href="#section__folder">Dossier</a></li>
<?php
// Vérifier si un dossier existe pour cette investigation
$folderSlug = $page->folder()->value();
$hasFolder = false;
if (!empty($folderSlug) && site()->find('dossiers')) {
$hasFolder = site()->find('dossiers')->children()->filterBy('slug', $folderSlug)->first();
}
if ($hasFolder):
?>
<li><a href="#section__folder">Dossier</a></li>
<?php endif ?>
<?php
// Vérifier s'il y a des enquêtes en lien
$relatedInvestigations = $page->relatedInvestigations()->toPages();
if ($relatedInvestigations->isEmpty()) {
$relatedInvestigations = $page->parent()->children()->filterBy('intendedTemplate', 'investigation-summary')->not($page)->listed()->limit(3);
}
if ($relatedInvestigations->isNotEmpty()):
?>
<li><a href="#section__related-articles">En lien</a></li>
<?php endif ?>
</ul>
</nav>
@ -74,7 +97,7 @@ $report = $page->children()->filterBy('intendedTemplate', 'report')->first();
<?php if ($page->heroType()->value() == 'image'): ?>
<?php if ($heroImage = $page->heroImages()->toFile()): ?>
<!-- HERO IMAGE SIMPLE -->
<div id="hero">
<div id="summary__hero">
<figure>
<img src="<?= $heroImage->url() ?>" alt="<?= $page->title()->esc() ?>">
</figure>
@ -84,33 +107,9 @@ $report = $page->children()->filterBy('intendedTemplate', 'report')->first();
</div>
<?php endif ?>
<?php elseif ($page->heroType()->value() == 'slider'): ?>
<?php if ($heroImages = $page->heroImages()->toFiles()): ?>
<!-- HERO SLIDER -->
<div id="hero" class="hero-slider swiper">
<div class="swiper-wrapper">
<?php foreach ($heroImages as $image): ?>
<div class="swiper-slide">
<figure>
<img src="<?= $image->url() ?>" alt="<?= $page->title()->esc() ?>">
</figure>
<?php if ($image->caption()->isNotEmpty()): ?>
<figcaption><?= $image->caption() ?></figcaption>
<?php endif ?>
</div>
<?php endforeach ?>
</div>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<div class="swiper-pagination"></div>
</div>
<?php endif ?>
<?php elseif ($page->heroType()->value() == 'video'): ?>
<!-- HERO VIDEO -->
<div id="hero" class="hero-video">
<div id="summary__hero" class="hero-video">
<div class="player-container">
<?php if ($page->videoExtractUrl()->isNotEmpty()): ?>
@ -130,6 +129,7 @@ $report = $page->children()->filterBy('intendedTemplate', 'report')->first();
<?php endif ?>
<dl class="section__article" id="section__dl">
<?php if ($page->incidentDate()->isNotEmpty()): ?>
<div class="dl__group">