rename: chapitre/projet templates to chapter/project

Standardize French template names to English across blueprints,
content files, PHP templates, Vue components and Pinia stores.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-02-25 15:00:41 +01:00
parent 99a924010f
commit ffcb1a9f2e
13 changed files with 64 additions and 60 deletions

View file

@ -1,38 +0,0 @@
title: Chapitre
columns:
main:
width: 2/3
sections:
fields:
type: fields
fields:
text:
label: Contenu
type: blocks
fieldsets:
text:
label: Texte
type: group
fieldsets:
- heading
- text
- list
- quote
media:
label: Medias
type: group
fieldsets:
- map
- image
- video
sidebar:
width: 1/3
sections:
files:
label: Fichiers
type: files

View file

@ -0,0 +1,41 @@
title: Chapitre
tabs:
contentTab:
label: Contenu
columns:
main:
width: 2/3
sections:
fields:
type: fields
fields:
blueprint: fields/blueprint
text:
label: Contenu
type: blocks
fieldsets:
text:
label: Texte
type: group
fieldsets:
- heading
- text
- list
- quote
media:
label: Medias
type: group
fieldsets:
- map
- image
- video
sidebar:
width: 1/3
sections:
maps:
label: Cartes
type: pages
template: map
files: tabs/files

View file

@ -7,6 +7,7 @@ columns:
fields: fields:
type: fields type: fields
fields: fields:
blueprint: fields/blueprint
subtitle: subtitle:
label: Sous-titre label: Sous-titre
type: text type: text

View file

@ -13,7 +13,7 @@ tabs:
label: Projets label: Projets
type: pages type: pages
templates: templates:
- projet - project
secondary: secondary:
width: 1/2 width: 1/2
sections: sections:

View file

@ -3,7 +3,7 @@
* Virtual Print Page Plugin * Virtual Print Page Plugin
* *
* Creates a virtual /print page for each narrative * Creates a virtual /print page for each narrative
* Allows access to print editor via /projet/narrative/print * Allows access to print editor via /project/narrative/print
*/ */
use Kirby\Cms\Page; use Kirby\Cms\Page;

View file

@ -1,7 +1,7 @@
<?php <?php
/** /**
* JSON template to expose narrative data * JSON template to expose narrative data
* Accessible via /projet/narrative.json or /projet/narrative?format=json * Accessible via /project/narrative.json or /project/narrative?format=json
*/ */
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: application/json; charset=utf-8');
@ -122,16 +122,16 @@ function parseBlocks($blocksField, $page) {
} }
/** /**
* Parse un chapitre * Parse a chapter
*/ */
function parseChapitre($chapitre) { function parseChapter($chapter) {
return [ return [
'id' => $chapitre->id(), 'id' => $chapter->id(),
'uuid' => $chapitre->uuid()->toString(), 'uuid' => $chapter->uuid()->toString(),
'template' => 'chapitre', 'template' => 'chapter',
'title' => $chapitre->title()->value(), 'title' => $chapter->title()->value(),
'slug' => $chapitre->slug(), 'slug' => $chapter->slug(),
'blocks' => parseBlocks($chapitre->text(), $chapitre) 'blocks' => parseBlocks($chapter->text(), $chapter)
]; ];
} }
@ -154,10 +154,10 @@ function parseCarte($carte) {
* Parse un geoformat * Parse un geoformat
*/ */
function parseGeoformat($geoformat) { function parseGeoformat($geoformat) {
$chapitres = []; $chapters = [];
foreach ($geoformat->children()->listed() as $child) { foreach ($geoformat->children()->listed() as $child) {
if ($child->intendedTemplate()->name() === 'chapitre') { if ($child->intendedTemplate()->name() === 'chapter') {
$chapitres[] = parseChapitre($child); $chapters[] = parseChapter($child);
} }
} }
@ -171,7 +171,7 @@ function parseGeoformat($geoformat) {
'tags' => $geoformat->tags()->isNotEmpty() ? $geoformat->tags()->split() : [], 'tags' => $geoformat->tags()->isNotEmpty() ? $geoformat->tags()->split() : [],
'cover' => resolveFileUrl($geoformat->cover(), $geoformat), 'cover' => resolveFileUrl($geoformat->cover(), $geoformat),
'text' => resolveImagesInHtml($geoformat->text()->value(), $geoformat), 'text' => resolveImagesInHtml($geoformat->text()->value(), $geoformat),
'children' => $chapitres 'children' => $chapters
]; ];
} }

View file

@ -1,7 +1,7 @@
<?php <?php
/** /**
* Template for Vue.js print editor * Template for Vue.js print editor
* Route: /projet/narrative/print * Route: /project/narrative/print
* *
* This template loads the Vue app and passes the parent narrative JSON URL * This template loads the Vue app and passes the parent narrative JSON URL
*/ */

View file

@ -40,10 +40,10 @@
<div v-if="item.text" class="chapeau" v-html="item.text"></div> <div v-if="item.text" class="chapeau" v-html="item.text"></div>
</section> </section>
<!-- Chapitre --> <!-- Chapter -->
<section <section
v-else-if="item.template === 'chapitre'" v-else-if="item.template === 'chapter'"
class="chapitre" class="chapter"
:data-page-type="item.template" :data-page-type="item.template"
> >
<h3>{{ item.title }}</h3> <h3>{{ item.title }}</h3>
@ -116,7 +116,7 @@ const getBlockComponent = (type) => {
/* Base print styles for content sections */ /* Base print styles for content sections */
.narrative-cover, .narrative-cover,
.geoformat, .geoformat,
.chapitre, .chapter,
.carte { .carte {
break-before: page; break-before: page;
} }

View file

@ -48,10 +48,10 @@ export const useNarrativeStore = defineStore('narrative', () => {
if (child.children && child.children.length > 0) { if (child.children && child.children.length > 0) {
flattenChildren(child.children, depth + 1); flattenChildren(child.children, depth + 1);
} }
} else if (child.template === 'chapitre') { } else if (child.template === 'chapter') {
items.push({ items.push({
id: child.id, id: child.id,
template: 'chapitre', template: 'chapter',
title: child.title, title: child.title,
blocks: child.blocks, blocks: child.blocks,
}); });