61 lines
2.1 KiB
PHP
61 lines
2.1 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>
|
|
|
|
<section class="container-cards">
|
|
|
|
|
|
|
|
<?php foreach ($page->children()->listed() as $package): ?>
|
|
|
|
|
|
|
|
<article class="card--package">
|
|
<?php if ($cover = $package->cover()->toFile()): ?>
|
|
<figure>
|
|
<img src="<?= $cover->url() ?>" alt="<?= $package->title()->esc() ?>">
|
|
</figure>
|
|
<?php endif ?>
|
|
<div class="content">
|
|
<p class="type"><?= t('package.type') ?></p>
|
|
<h4 class="title"><a href="<?= $package->url() ?>"><span class="icon"><?= svg('assets/icons/package.svg') ?></span><?= $package->title()->esc() ?></a></h4>
|
|
|
|
<!-- <?php if ($package->description()->isNotEmpty()): ?>
|
|
<p class="description"><?= $package->description()->excerpt(100) ?></p>
|
|
<?php endif ?> -->
|
|
|
|
<?php
|
|
$investigationsCount = $package->linkedContent()->toPages()->count();
|
|
$impactsCount = $package->linkedImpacts()->toPages()->count();
|
|
?>
|
|
<?php if ($investigationsCount > 0 || $impactsCount > 0): ?>
|
|
<ul class="details">
|
|
<?php if ($investigationsCount > 0): ?>
|
|
<li><?= $investigationsCount ?> enquête<?= $investigationsCount > 1 ? 's' : '' ?></li>
|
|
<?php endif ?>
|
|
<?php if ($impactsCount > 0): ?>
|
|
<li><?= $impactsCount ?> impact<?= $impactsCount > 1 ? 's' : '' ?></li>
|
|
<?php endif ?>
|
|
</ul>
|
|
<?php endif ?>
|
|
</div>
|
|
<button class="btn--go-to"><a href="<?= $package->url() ?>" target="_blank"><?= svg('assets/icons/arrow-left.svg') ?></a></button>
|
|
<a class="link-block" href="<?= $package->url() ?>" target="_blank" aria-hidden="true"></a>
|
|
</article>
|
|
|
|
|
|
<?php endforeach ?>
|
|
|
|
</section>
|
|
</main>
|
|
<?php snippet('footer') ?>
|