index-main/site/templates/packages.php
isUnknown 15581752b8 refactor: rename "folder" to "package" throughout codebase
- Rename CSS files: _card-folder.scss → card-package
- Rename template files: _folder.scss → package
- Update all CSS class names and selectors
- Delete old folder blueprints and templates
- Add new package blueprints with improved structure
- Update investigation-summary template and blueprint
- Add "Dossiers" menu item in panel configuration
- Improve package blueprint with linkedContent field

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 12:40:18 +01:00

59 lines
1.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="description-medium">
<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">
<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="short"><?= $package->description()->excerpt(200) ?></p>
<?php endif ?>
<?php
// Compter les enquêtes associées à ce dossier
$investigationsCount = site()->find('enquetes')->children()->listed()->filter(function($investigation) use ($package) {
return $investigation->package()->value() === $package->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="<?= $package->url() ?>"></a>
</article>
<?php endforeach ?>
</section>
</main>
<?php snippet('footer') ?>