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>
This commit is contained in:
parent
e228c1757e
commit
15581752b8
11 changed files with 298 additions and 346 deletions
|
|
@ -40,14 +40,14 @@ $report = $page->children()->filterBy('intendedTemplate', 'report')->first();
|
|||
<li><a href="#section__impacts">Impacts</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();
|
||||
$packageSlug = $page->package()->value();
|
||||
$hasPackage = false;
|
||||
if (!empty($packageSlug) && site()->find('dossiers')) {
|
||||
$hasPackage = site()->find('dossiers')->children()->filterBy('slug', $packageSlug)->first();
|
||||
}
|
||||
if ($hasFolder):
|
||||
if ($hasPackage):
|
||||
?>
|
||||
<li><a href="#section__folder">Dossier</a></li>
|
||||
<li><a href="#section__package">Dossier</a></li>
|
||||
<?php endif ?>
|
||||
<?php
|
||||
// Vérifier s'il y a des enquêtes en lien
|
||||
|
|
@ -305,34 +305,34 @@ if ($relatedInvestigations->isEmpty()) {
|
|||
|
||||
<?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();
|
||||
$packageSlug = $page->package()->value();
|
||||
$package = null;
|
||||
if (!empty($packageSlug) && site()->find('dossiers')) {
|
||||
$package = site()->find('dossiers')->children()->filterBy('slug', $packageSlug)->first();
|
||||
}
|
||||
|
||||
if ($folder):
|
||||
if ($package):
|
||||
?>
|
||||
<aside class="section__article" id="section__folder">
|
||||
<aside class="section__article" id="section__package">
|
||||
<h3 class="section__title">Dans le dossier</h3>
|
||||
|
||||
<article class="card--folder">
|
||||
<?php if ($cover = $folder->cover()->toFile()): ?>
|
||||
<article class="card--package">
|
||||
<?php if ($cover = $package->cover()->toFile()): ?>
|
||||
<figure>
|
||||
<img src="<?= $cover->url() ?>" alt="<?= $folder->title()->esc() ?>">
|
||||
<img src="<?= $cover->url() ?>" alt="<?= $package->title()->esc() ?>">
|
||||
</figure>
|
||||
<?php endif ?>
|
||||
<div class="content">
|
||||
<h4 class="title"><a href="<?= $folder->url() ?>"><span class="icon"><?= svg('assets/icons/folder.svg') ?></span><?= $folder->title()->esc() ?></a></h4>
|
||||
<h4 class="title"><a href="<?= $package->url() ?>"><span class="icon"><?= svg('assets/icons/package.svg') ?></span><?= $package->title()->esc() ?></a></h4>
|
||||
|
||||
<?php if ($folder->description()->isNotEmpty()): ?>
|
||||
<p class="short"><?= $folder->description()->excerpt(200) ?></p>
|
||||
<?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 ($folder) {
|
||||
return $investigation->folder()->value() === $folder->slug();
|
||||
$investigationsCount = site()->find('enquetes')->children()->listed()->filter(function($investigation) use ($package) {
|
||||
return $investigation->package()->value() === $package->slug();
|
||||
})->count();
|
||||
?>
|
||||
|
||||
|
|
@ -344,8 +344,8 @@ if ($folder):
|
|||
</ul>
|
||||
|
||||
</div>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,17 +16,17 @@
|
|||
<?php
|
||||
// Récupérer les enquêtes associées à ce dossier
|
||||
$investigations = site()->find('enquetes')->children()->listed()->filter(function($investigation) use ($page) {
|
||||
return $investigation->folder()->value() === $page->slug();
|
||||
return $investigation->package()->value() === $page->slug();
|
||||
});
|
||||
?>
|
||||
|
||||
|
||||
<div class="btn--group" id="nav-folder">
|
||||
<div class="btn--group" id="nav-package">
|
||||
<button class="btn--small"><a href="#section__investigations">Enquêtes <span class="arrow"><?= svg('assets/icons/arrow-left.svg') ?></span></a></button>
|
||||
<button class="btn--small"><a href="#section__impacts">Impacts <span class="arrow"><?= svg('assets/icons/arrow-left.svg') ?></span></a></button>
|
||||
</div>
|
||||
|
||||
<div class="content-folder">
|
||||
<div class="content-package">
|
||||
|
||||
|
||||
<?php if ($investigations->isNotEmpty()): ?>
|
||||
|
|
@ -16,28 +16,28 @@
|
|||
|
||||
|
||||
|
||||
<?php foreach ($page->children()->listed() as $folder): ?>
|
||||
<article class="card--folder">
|
||||
<?php foreach ($page->children()->listed() as $package): ?>
|
||||
<article class="card--package">
|
||||
|
||||
<?php if ($cover = $folder->cover()->toFile()): ?>
|
||||
<?php if ($cover = $package->cover()->toFile()): ?>
|
||||
<figure>
|
||||
<img src="<?= $cover->url() ?>" alt="<?= $folder->title()->esc() ?>">
|
||||
<img src="<?= $cover->url() ?>" alt="<?= $package->title()->esc() ?>">
|
||||
</figure>
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
|
||||
<div class="content">
|
||||
<h4 class="title"><a href="<?= $folder->url() ?>"><span class="icon"><?= svg('assets/icons/folder.svg') ?></span><?= $folder->title()->esc() ?></a></h4>
|
||||
<h4 class="title"><a href="<?= $package->url() ?>"><span class="icon"><?= svg('assets/icons/package.svg') ?></span><?= $package->title()->esc() ?></a></h4>
|
||||
|
||||
<?php if ($folder->description()->isNotEmpty()): ?>
|
||||
<p class="short"><?= $folder->description()->excerpt(200) ?></p>
|
||||
<?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 ($folder) {
|
||||
return $investigation->folder()->value() === $folder->slug();
|
||||
$investigationsCount = site()->find('enquetes')->children()->listed()->filter(function($investigation) use ($package) {
|
||||
return $investigation->package()->value() === $package->slug();
|
||||
})->count();
|
||||
?>
|
||||
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
</div>
|
||||
<button class="btn--go-to"><a href="#" target="_blank"><?= svg('assets/icons/arrow-left.svg') ?></a></button>
|
||||
<a class="link-block" href="<?= $folder->url() ?>"></a>
|
||||
<a class="link-block" href="<?= $package->url() ?>"></a>
|
||||
</article>
|
||||
<?php endforeach ?>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue