From 849b506c50e77d6f77c8e1b1ded1963a4d49ca1e Mon Sep 17 00:00:00 2001 From: Julie Blanc Date: Sun, 25 Jan 2026 22:42:02 +0100 Subject: [PATCH] add folders --- site/blueprints/pages/folder.yml | 21 ++++ site/blueprints/pages/folders.yml | 17 ++++ .../pages/investigation-summary.yml | 10 ++ site/templates/folder.php | 97 +++++++++++++++++++ site/templates/folders.php | 58 +++++++---- 5 files changed, 183 insertions(+), 20 deletions(-) create mode 100644 site/blueprints/pages/folder.yml create mode 100644 site/blueprints/pages/folders.yml create mode 100644 site/templates/folder.php diff --git a/site/blueprints/pages/folder.yml b/site/blueprints/pages/folder.yml new file mode 100644 index 0000000..f47cd72 --- /dev/null +++ b/site/blueprints/pages/folder.yml @@ -0,0 +1,21 @@ +title: Dossier + +tabs: + contentTab: + label: Contenu + icon: page + fields: + description: + label: Description + type: textarea + size: medium + buttons: false + cover: + label: Visuel de couverture + type: files + multiple: false + layout: cards + image: + ratio: 12/7 + cover: true + help: Image utilisée dans la liste des dossiers diff --git a/site/blueprints/pages/folders.yml b/site/blueprints/pages/folders.yml new file mode 100644 index 0000000..6b17e90 --- /dev/null +++ b/site/blueprints/pages/folders.yml @@ -0,0 +1,17 @@ +title: Dossiers + +tabs: + contentTab: + label: Contenu + sections: + folders: + type: pages + text: "{{ page.title }}" + info: "{{ page.description }}" + layout: cards + size: huge + search: true + image: + cover: true + ratio: 12/7 + template: folder diff --git a/site/blueprints/pages/investigation-summary.yml b/site/blueprints/pages/investigation-summary.yml index d1e7e68..803de70 100644 --- a/site/blueprints/pages/investigation-summary.yml +++ b/site/blueprints/pages/investigation-summary.yml @@ -74,6 +74,16 @@ tabs: label: Métadonnées icon: table fields: + folder: + label: Dossier + type: select + options: query + query: + fetch: site.find('dossiers').children + text: "{{ page.title }}" + value: "{{ page.slug }}" + empty: Aucun dossier + width: 1/3 incidentDate: label: Date de l'incident type: date diff --git a/site/templates/folder.php b/site/templates/folder.php new file mode 100644 index 0000000..75b69e2 --- /dev/null +++ b/site/templates/folder.php @@ -0,0 +1,97 @@ + +
+ + + +find('enquetes')->children()->listed()->filter(function($investigation) use ($page) { + return $investigation->folder()->value() === $page->slug(); +}); +?> + +isNotEmpty()): ?> +
+ + +
+ + cover()->toFile()): ?> +
+ <?= $investigation->title()->esc() ?> +
+ + +
+ +

title()->esc() ?>

+ + chapo()->isNotEmpty()): ?> +

chapo()->excerpt(200) ?>

+ + +
+ incidentDate()->isNotEmpty()): ?> +
+
Date de l'incident
+
+
+ + + partners()->toStructure()): ?> + isNotEmpty()): ?> +
+
Partenaire(s)
+
+ + + name()->value() ?> + + +
+
+ + + + incidentLocation()->isNotEmpty()): ?> +
+
Lieu de l'incident
+
incidentLocation()->esc() ?>
+
+ +
+ +
+ + keywords()->split()): ?> + 0): ?> +
+
    + +
  • + +
+
+ + + + +
+ + +
+ +

Aucune enquête associée à ce dossier pour le moment.

+ + +
+ diff --git a/site/templates/folders.php b/site/templates/folders.php index 49d94cf..cd95c4f 100644 --- a/site/templates/folders.php +++ b/site/templates/folders.php @@ -4,33 +4,51 @@ - -
- - -
-
+children()->listed() as $folder): ?> +
+ cover()->toFile()): ?> +
+ <?= $folder->title()->esc() ?> +
+ + +
+

title()->esc() ?>

+ + description()->isNotEmpty()): ?> +

description()->excerpt(200) ?>

+ + + find('enquetes')->children()->listed()->filter(function($investigation) use ($folder) { + return $investigation->folder()->value() === $folder->slug(); + })->count(); + ?> + + 0): ?> +
+
+
Enquêtes
+
enquête 1 ? 's' : '' ?>
+
+
+ +
+ + +
+