Create new report.php template that dynamically renders Kirby layouts as section-content blocks. Each layout becomes a section, supporting 1-column and 2-column layouts with proper CSS classes (section-txt, subsection-w-media, etc.) matching the backup file structure. Add report-backup.php as reference file. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
230 lines
9.1 KiB
PHP
230 lines
9.1 KiB
PHP
<?php snippet('header') ?>
|
|
|
|
<div class="btn--group__mobile">
|
|
<button id="toggle-panel__mobile" class="btn--bold-inline no-link btn--toc">
|
|
<span class="icon"><?= svg('assets/icons/toc.svg') ?></span>
|
|
<span class="text">Table des matières</span>
|
|
</button>
|
|
<div class="dropdown dropdown--position-mobile">
|
|
<button class="dropdown__trigger btn--bold-inline no-link">
|
|
<span class="icon"><?= svg('assets/icons/share.svg') ?></span>
|
|
<span class="text">Partager</span>
|
|
</button>
|
|
<div class="dropdown__content">
|
|
<?php snippet('modal-share') ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<main>
|
|
|
|
<button id="toggle-panel" class="btn--bold-inline no-link btn--toc">
|
|
<?= svg('assets/icons/toc.svg') ?>
|
|
</button>
|
|
|
|
<aside class="panel-left" id="report__aside">
|
|
<div class="panel__header">
|
|
<span class="icon"><?= svg('assets/icons/toc.svg') ?></span>
|
|
<span class="text">Table des matières</span>
|
|
<span class="icon close"><?= svg('assets/icons/close.svg') ?></span>
|
|
</div>
|
|
|
|
<div class="panel__content">
|
|
<?php snippet('toc') ?>
|
|
</div>
|
|
|
|
<div class="btn--group">
|
|
<button id="download-pdf" class="btn--bold">
|
|
<a href="#">
|
|
<span class="icon"><?= svg('assets/icons/pdf.svg') ?></span>
|
|
<span class="text">Télécharger le PDF</span>
|
|
</a>
|
|
</button>
|
|
|
|
<div class="dropdown dropdown--position-panel">
|
|
<button class="dropdown__trigger btn--bold-inline no-link">
|
|
<span class="icon"><?= svg('assets/icons/share.svg') ?></span>
|
|
<span class="text">Partager</span>
|
|
</button>
|
|
<div class="dropdown__content">
|
|
<?php snippet('modal-share') ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<input type="checkbox" id="share-banner__aside">
|
|
<?php snippet('modal-share') ?>
|
|
</aside>
|
|
|
|
<article id="report">
|
|
|
|
<header class="report__header">
|
|
<div class="report__title-group">
|
|
<p class="page__type">Rapport</p>
|
|
<h1 class="title">Rapport de contre-expertise</h1>
|
|
<h2 class="subtitle"><?= $page->subtitle()->toLowerCase() ?></h2>
|
|
</div>
|
|
|
|
<?php snippet('picture', [
|
|
'file' => $page->cover()->toFile(),
|
|
'class' => 'report__cover'
|
|
]) ?>
|
|
|
|
<dl class="report__dl">
|
|
<div class="dl__group">
|
|
<dt>Auteurs du rapport</dt>
|
|
<dd><?= $page->authors() ?></dd>
|
|
</div>
|
|
<div class="dl__group">
|
|
<dt>Date du rapport</dt>
|
|
<dd>
|
|
<time datetime="<?= $page->created()->toDate('Y-m-d') ?>">
|
|
<?= $page->created()->toDate('d MMMM yyyy') ?>
|
|
</time>
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</header>
|
|
|
|
<div class="report__btns btn--group">
|
|
<button class="btn--bold">
|
|
<a href="#">
|
|
<span class="icon"><?= svg('assets/icons/pdf.svg') ?></span>
|
|
<span class="text">Télécharger le PDF</span>
|
|
</a>
|
|
</button>
|
|
|
|
<button class="btn--bold-inline">
|
|
<a href="/enquetes/l-execution-de-nidal-et-khaled-amirah-a-naplouse">
|
|
<span class="icon"><?= svg('assets/icons/play.svg') ?></span>
|
|
<span class="text">Voir la synthèse</span>
|
|
</a>
|
|
</button>
|
|
|
|
<div class="dropdown">
|
|
<button class="dropdown__trigger btn--bold-inline no-link">
|
|
<span class="icon"><?= svg('assets/icons/share.svg') ?></span>
|
|
<span class="text">Partager</span>
|
|
</button>
|
|
<div class="dropdown__content">
|
|
<?php snippet('modal-share') ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="report__content">
|
|
<?php foreach ($page->body()->toLayouts() as $layout): ?>
|
|
<?php
|
|
$columns = $layout->columns();
|
|
$columnCount = $columns->count();
|
|
?>
|
|
|
|
<?php if ($columnCount === 1): ?>
|
|
<?php
|
|
$column = $columns->first();
|
|
$blocks = $column->blocks();
|
|
$hasHeading = false;
|
|
$hasOtherContent = false;
|
|
|
|
// Check what types of content we have
|
|
foreach ($blocks as $block) {
|
|
if ($block->type() === 'heading') {
|
|
$hasHeading = true;
|
|
} else {
|
|
$hasOtherContent = true;
|
|
}
|
|
}
|
|
?>
|
|
|
|
<div class="section-content">
|
|
<?php foreach ($blocks as $block): ?>
|
|
<?php if ($block->type() === 'heading'): ?>
|
|
<<?= $block->level()->or('h3') ?> class="section-title"><?= $block->text() ?></<?= $block->level()->or('h3') ?>>
|
|
<?php elseif ($block->type() === 'text'): ?>
|
|
<div class="section-txt">
|
|
<?= $block->text() ?>
|
|
</div>
|
|
|
|
<?php elseif ($block->type() === 'image'): ?>
|
|
<div class="media container-figure fig-simple">
|
|
<?php $image = $block->image()->toFile(); ?>
|
|
<?php if ($image): ?>
|
|
<figure>
|
|
<img src="<?= $image->url() ?>" alt="<?= $image->alt()->esc() ?>">
|
|
</figure>
|
|
<?php if ($image->caption()->isNotEmpty()): ?>
|
|
<p class="caption"><?= $image->caption()->html() ?></p>
|
|
<?php endif ?>
|
|
<?php endif ?>
|
|
</div>
|
|
|
|
<?php elseif ($block->type() === 'beforeafter'): ?>
|
|
<div class="media">
|
|
<?php snippet('blocks/' . $block->type(), ['block' => $block]) ?>
|
|
</div>
|
|
|
|
<?php elseif ($block->type() === 'video'): ?>
|
|
<div class="media container-video">
|
|
<?php snippet('blocks/' . $block->type(), ['block' => $block]) ?>
|
|
</div>
|
|
|
|
<?php elseif ($block->type() === 'horizontal-gallery'): ?>
|
|
<?php snippet('blocks/' . $block->type(), ['block' => $block]) ?>
|
|
|
|
<?php endif ?>
|
|
<?php endforeach ?>
|
|
</div>
|
|
|
|
<?php elseif ($columnCount === 2): ?>
|
|
<div class="section-content">
|
|
<div class="subsection-w-media">
|
|
<?php
|
|
$firstColumn = $columns->first();
|
|
$lastColumn = $columns->last();
|
|
?>
|
|
|
|
<div class="media">
|
|
<?php foreach ($firstColumn->blocks() as $block): ?>
|
|
<?php if ($block->type() === 'image'): ?>
|
|
<div class="container-figure fig-simple">
|
|
<?php $image = $block->image()->toFile(); ?>
|
|
<?php if ($image): ?>
|
|
<figure>
|
|
<img src="<?= $image->url() ?>" alt="<?= $image->alt()->esc() ?>">
|
|
</figure>
|
|
<?php if ($image->caption()->isNotEmpty()): ?>
|
|
<p class="caption"><?= $image->caption()->html() ?></p>
|
|
<?php endif ?>
|
|
<?php endif ?>
|
|
</div>
|
|
|
|
<?php elseif ($block->type() === 'beforeafter'): ?>
|
|
<?php snippet('blocks/' . $block->type(), ['block' => $block]) ?>
|
|
|
|
<?php elseif ($block->type() === 'video'): ?>
|
|
<?php snippet('blocks/' . $block->type(), ['block' => $block]) ?>
|
|
|
|
<?php endif ?>
|
|
<?php endforeach ?>
|
|
</div>
|
|
|
|
<div class="subsection-txt">
|
|
<?php foreach ($lastColumn->blocks() as $block): ?>
|
|
<?php if ($block->type() === 'text'): ?>
|
|
<?= $block->text() ?>
|
|
<?php elseif ($block->type() === 'heading'): ?>
|
|
<<?= $block->level()->or('h3') ?>><?= $block->text() ?></<?= $block->level()->or('h3') ?>>
|
|
<?php endif ?>
|
|
<?php endforeach ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php endif ?>
|
|
<?php endforeach ?>
|
|
</div>
|
|
|
|
</article>
|
|
</main>
|
|
|
|
<?php snippet('footer') ?>
|