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:
parent
99a924010f
commit
ffcb1a9f2e
13 changed files with 64 additions and 60 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
41
public/site/blueprints/pages/chapter.yml
Normal file
41
public/site/blueprints/pages/chapter.yml
Normal 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
|
||||
|
|
@ -7,6 +7,7 @@ columns:
|
|||
fields:
|
||||
type: fields
|
||||
fields:
|
||||
blueprint: fields/blueprint
|
||||
subtitle:
|
||||
label: Sous-titre
|
||||
type: text
|
||||
|
|
@ -13,7 +13,7 @@ tabs:
|
|||
label: Projets
|
||||
type: pages
|
||||
templates:
|
||||
- projet
|
||||
- project
|
||||
secondary:
|
||||
width: 1/2
|
||||
sections:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Virtual Print Page Plugin
|
||||
*
|
||||
* 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;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* 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');
|
||||
|
|
@ -122,16 +122,16 @@ function parseBlocks($blocksField, $page) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Parse un chapitre
|
||||
* Parse a chapter
|
||||
*/
|
||||
function parseChapitre($chapitre) {
|
||||
function parseChapter($chapter) {
|
||||
return [
|
||||
'id' => $chapitre->id(),
|
||||
'uuid' => $chapitre->uuid()->toString(),
|
||||
'template' => 'chapitre',
|
||||
'title' => $chapitre->title()->value(),
|
||||
'slug' => $chapitre->slug(),
|
||||
'blocks' => parseBlocks($chapitre->text(), $chapitre)
|
||||
'id' => $chapter->id(),
|
||||
'uuid' => $chapter->uuid()->toString(),
|
||||
'template' => 'chapter',
|
||||
'title' => $chapter->title()->value(),
|
||||
'slug' => $chapter->slug(),
|
||||
'blocks' => parseBlocks($chapter->text(), $chapter)
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -154,10 +154,10 @@ function parseCarte($carte) {
|
|||
* Parse un geoformat
|
||||
*/
|
||||
function parseGeoformat($geoformat) {
|
||||
$chapitres = [];
|
||||
$chapters = [];
|
||||
foreach ($geoformat->children()->listed() as $child) {
|
||||
if ($child->intendedTemplate()->name() === 'chapitre') {
|
||||
$chapitres[] = parseChapitre($child);
|
||||
if ($child->intendedTemplate()->name() === 'chapter') {
|
||||
$chapters[] = parseChapter($child);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ function parseGeoformat($geoformat) {
|
|||
'tags' => $geoformat->tags()->isNotEmpty() ? $geoformat->tags()->split() : [],
|
||||
'cover' => resolveFileUrl($geoformat->cover(), $geoformat),
|
||||
'text' => resolveImagesInHtml($geoformat->text()->value(), $geoformat),
|
||||
'children' => $chapitres
|
||||
'children' => $chapters
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@
|
|||
<div v-if="item.text" class="chapeau" v-html="item.text"></div>
|
||||
</section>
|
||||
|
||||
<!-- Chapitre -->
|
||||
<!-- Chapter -->
|
||||
<section
|
||||
v-else-if="item.template === 'chapitre'"
|
||||
class="chapitre"
|
||||
v-else-if="item.template === 'chapter'"
|
||||
class="chapter"
|
||||
:data-page-type="item.template"
|
||||
>
|
||||
<h3>{{ item.title }}</h3>
|
||||
|
|
@ -116,7 +116,7 @@ const getBlockComponent = (type) => {
|
|||
/* Base print styles for content sections */
|
||||
.narrative-cover,
|
||||
.geoformat,
|
||||
.chapitre,
|
||||
.chapter,
|
||||
.carte {
|
||||
break-before: page;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,10 +48,10 @@ export const useNarrativeStore = defineStore('narrative', () => {
|
|||
if (child.children && child.children.length > 0) {
|
||||
flattenChildren(child.children, depth + 1);
|
||||
}
|
||||
} else if (child.template === 'chapitre') {
|
||||
} else if (child.template === 'chapter') {
|
||||
items.push({
|
||||
id: child.id,
|
||||
template: 'chapitre',
|
||||
template: 'chapter',
|
||||
title: child.title,
|
||||
blocks: child.blocks,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue