refactor: rename 'recit' to 'narrative' for English code naming
- Rename store: recit.js → narrative.js (useRecitStore → useNarrativeStore) - Rename templates: recit.php/json.php → narrative.php/json.php - Rename blueprint: recit.yml → narrative.yml - Update all imports and references in Vue/JS files - Update PHP template references and data attributes - Update CLAUDE.md documentation - Create comprehensive README.md with English-French dictionary The dictionary section maps English code terms to French content terms for easier navigation between codebase and CMS content. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
ea0994ed45
commit
af788ad1e0
12 changed files with 267 additions and 66 deletions
|
|
@ -1,4 +1,4 @@
|
|||
title: Récit
|
||||
title: Narrative
|
||||
|
||||
columns:
|
||||
main:
|
||||
|
|
@ -17,9 +17,9 @@ columns:
|
|||
multiple: false
|
||||
width: 1/2
|
||||
pages:
|
||||
label: Récits
|
||||
label: Narratives
|
||||
type: pages
|
||||
template: recit
|
||||
template: narrative
|
||||
sidebar:
|
||||
width: 1/3
|
||||
sections:
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
/**
|
||||
* Virtual Print Page Plugin
|
||||
*
|
||||
* Crée une page virtuelle /print pour chaque récit
|
||||
* Permet d'accéder à l'éditeur d'impression via /projet/recit/print
|
||||
* Creates a virtual /print page for each narrative
|
||||
* Allows access to print editor via /projet/narrative/print
|
||||
*/
|
||||
|
||||
use Kirby\Cms\Page;
|
||||
|
|
@ -14,20 +14,20 @@ Kirby::plugin('geoproject/virtual-print-page', [
|
|||
[
|
||||
'pattern' => '(:all)/print',
|
||||
'action' => function ($parentPath) {
|
||||
// Trouver la page parente (le récit)
|
||||
// Find parent page (the narrative)
|
||||
$parent = page($parentPath);
|
||||
|
||||
if (!$parent || $parent->intendedTemplate()->name() !== 'recit') {
|
||||
if (!$parent || $parent->intendedTemplate()->name() !== 'narrative') {
|
||||
return $this->next();
|
||||
}
|
||||
|
||||
// Créer la page virtuelle avec Page::factory()
|
||||
// Create virtual page with Page::factory()
|
||||
return Page::factory([
|
||||
'slug' => 'print',
|
||||
'template' => 'print',
|
||||
'parent' => $parent,
|
||||
'content' => [
|
||||
'title' => 'Impression - ' . $parent->title()->value(),
|
||||
'title' => 'Print - ' . $parent->title()->value(),
|
||||
'uuid' => Uuid::generate()
|
||||
]
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -26,5 +26,5 @@
|
|||
<?php endif ?>
|
||||
</head>
|
||||
|
||||
<body data-template="<?= $page->template() ?>"<?php if (isset($recitJsonUrl)): ?> data-recit-url="<?= $recitJsonUrl ?>"<?php endif ?>>
|
||||
<body data-template="<?= $page->template() ?>"<?php if (isset($narrativeJsonUrl)): ?> data-narrative-url="<?= $narrativeJsonUrl ?>"<?php endif ?>>
|
||||
<div id="app">
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* Template JSON pour exposer les données d'un récit
|
||||
* Accessible via /projet/recit.json ou /projet/recit?format=json
|
||||
* JSON template to expose narrative data
|
||||
* Accessible via /projet/narrative.json or /projet/narrative?format=json
|
||||
*/
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
|
@ -175,11 +175,11 @@ function parseGeoformat($geoformat) {
|
|||
];
|
||||
}
|
||||
|
||||
// Construction de la réponse JSON
|
||||
// Build JSON response
|
||||
$data = [
|
||||
'id' => $page->id(),
|
||||
'uuid' => $page->uuid()->toString(),
|
||||
'template' => 'recit',
|
||||
'template' => 'narrative',
|
||||
'title' => $page->title()->value(),
|
||||
'slug' => $page->slug(),
|
||||
'author' => $page->author()->value() ?? '',
|
||||
|
|
@ -188,7 +188,7 @@ $data = [
|
|||
'children' => []
|
||||
];
|
||||
|
||||
// Parser les enfants (geoformats et cartes)
|
||||
// Parse children (geoformats and maps)
|
||||
foreach ($page->children()->listed() as $child) {
|
||||
$template = $child->intendedTemplate()->name();
|
||||
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
/**
|
||||
* Template pour afficher un récit
|
||||
* Ce template est requis pour que recit.json.php fonctionne
|
||||
* Template to display a narrative
|
||||
* This template is required for narrative.json.php to work
|
||||
*/
|
||||
?>
|
||||
<?php snippet('header') ?>
|
||||
|
||||
<article class="recit">
|
||||
<article class="narrative">
|
||||
<h1><?= $page->title() ?></h1>
|
||||
|
||||
<?php if ($page->author()->isNotEmpty()): ?>
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<p><a href="<?= $page->url() ?>/print">Ouvrir l'éditeur d'impression</a></p>
|
||||
<p><a href="<?= $page->url() ?>/print">Open print editor</a></p>
|
||||
</article>
|
||||
|
||||
<?php snippet('footer') ?>
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* Template pour l'éditeur d'impression Vue.js
|
||||
* Route: /projet/recit/print
|
||||
* Template for Vue.js print editor
|
||||
* Route: /projet/narrative/print
|
||||
*
|
||||
* Ce template charge l'app Vue et lui passe l'URL JSON du récit parent
|
||||
* This template loads the Vue app and passes the parent narrative JSON URL
|
||||
*/
|
||||
|
||||
// Récupérer le récit parent
|
||||
$recit = $page->parent();
|
||||
// Get parent narrative
|
||||
$narrative = $page->parent();
|
||||
|
||||
// Construire l'URL JSON du récit
|
||||
$recitJsonUrl = $recit->url() . '.json';
|
||||
// Build narrative JSON URL
|
||||
$narrativeJsonUrl = $narrative->url() . '.json';
|
||||
?>
|
||||
<?php snippet('header', ['recitJsonUrl' => $recitJsonUrl]) ?>
|
||||
<?php snippet('header', ['narrativeJsonUrl' => $narrativeJsonUrl]) ?>
|
||||
|
||||
<?php snippet('footer') ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue