add hook create-steps
This commit is contained in:
parent
5cc48ff9d2
commit
ee4e6adf06
24 changed files with 204 additions and 77 deletions
39
public/site/blueprints/pages/client-brief.yml
Normal file
39
public/site/blueprints/pages/client-brief.yml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
title: Brief client
|
||||
icon: draft
|
||||
image:
|
||||
back: black
|
||||
color: white
|
||||
query: false
|
||||
options:
|
||||
delete: false
|
||||
changeTitle: false
|
||||
changeTemplate: false
|
||||
changeStatus: false
|
||||
changeSlug: false
|
||||
move: false
|
||||
duplicate: false
|
||||
sort: false
|
||||
|
||||
tabs:
|
||||
content:
|
||||
label: Brief client
|
||||
icon: document
|
||||
columns:
|
||||
- width: 1/1
|
||||
fields:
|
||||
briefClientPdf:
|
||||
label: PDF
|
||||
type: files
|
||||
multiple: false
|
||||
uploads: pdf
|
||||
description:
|
||||
type: textarea
|
||||
size: tiny
|
||||
buttons: false
|
||||
maxlength: 700
|
||||
briefClientImages:
|
||||
label: Images
|
||||
type: files
|
||||
uploads: image
|
||||
layout: cards
|
||||
size: medium
|
||||
15
public/site/blueprints/pages/extended-brief.yml
Normal file
15
public/site/blueprints/pages/extended-brief.yml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
title: Brief enrichi
|
||||
icon: document
|
||||
image:
|
||||
back: black
|
||||
color: white
|
||||
query: false
|
||||
options:
|
||||
delete: false
|
||||
changeTitle: false
|
||||
changeTemplate: false
|
||||
changeStatus: false
|
||||
changeSlug: false
|
||||
move: false
|
||||
duplicate: false
|
||||
sort: false
|
||||
|
|
@ -2,58 +2,44 @@ title: Projet
|
|||
icon: page
|
||||
|
||||
tabs:
|
||||
brief:
|
||||
label: Brief client
|
||||
icon: document
|
||||
steps:
|
||||
label: Étapes
|
||||
icon: circle-nested
|
||||
columns:
|
||||
- width: 1/2
|
||||
sections:
|
||||
brief:
|
||||
type: fields
|
||||
fields:
|
||||
currentStep:
|
||||
label: Étape en cours
|
||||
type: select
|
||||
options:
|
||||
type: query
|
||||
query: page.parent.steps.split
|
||||
client:
|
||||
type: pages
|
||||
multiple: false
|
||||
query: site.find("clients").childrenAndDrafts
|
||||
subpages: false
|
||||
image:
|
||||
query: page.logo.toFile
|
||||
layout: cardlets
|
||||
width: 1/2
|
||||
briefClientPdf:
|
||||
label: PDF
|
||||
type: files
|
||||
multiple: false
|
||||
uploads: pdf
|
||||
layout: cardlets
|
||||
width: 1/2
|
||||
- width: 1/2
|
||||
sections:
|
||||
description:
|
||||
type: fields
|
||||
fields:
|
||||
description:
|
||||
type: textarea
|
||||
size: tiny
|
||||
buttons: false
|
||||
maxlength: 700
|
||||
- width: 1/1
|
||||
fields:
|
||||
currentStep:
|
||||
label: Étape en cours
|
||||
type: radio
|
||||
columns: 4
|
||||
default: clientBrief
|
||||
options:
|
||||
clientBrief: Brief client
|
||||
proposal: Offre commerciale
|
||||
extendedBrief: Brief enrichi
|
||||
virtualSample: Échantillon virtuel
|
||||
- width: 1/3
|
||||
fields:
|
||||
client:
|
||||
type: pages
|
||||
multiple: false
|
||||
query: site.find("clients").childrenAndDrafts
|
||||
subpages: false
|
||||
image:
|
||||
query: page.logo.toFile
|
||||
layout: cardlets
|
||||
|
||||
- width: 2/3
|
||||
sections:
|
||||
images:
|
||||
type: fields
|
||||
fields:
|
||||
briefClientImages:
|
||||
label: Images
|
||||
type: files
|
||||
uploads: image
|
||||
layout: cards
|
||||
size: medium
|
||||
stepsSection:
|
||||
label: Étapes
|
||||
type: pages
|
||||
templates:
|
||||
- client-brief
|
||||
- proposal
|
||||
- extended-brief
|
||||
- sample
|
||||
|
||||
# client:
|
||||
# label: Client
|
||||
# icon: account
|
||||
|
|
|
|||
15
public/site/blueprints/pages/proposal.yml
Normal file
15
public/site/blueprints/pages/proposal.yml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
title: Offre commerciale
|
||||
icon: badge
|
||||
image:
|
||||
back: black
|
||||
color: white
|
||||
query: false
|
||||
options:
|
||||
delete: false
|
||||
changeTitle: false
|
||||
changeTemplate: false
|
||||
changeStatus: false
|
||||
changeSlug: false
|
||||
move: false
|
||||
duplicate: false
|
||||
sort: false
|
||||
15
public/site/blueprints/pages/sample.yml
Normal file
15
public/site/blueprints/pages/sample.yml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
title: Échantillon virtuel
|
||||
icon: box
|
||||
image:
|
||||
back: black
|
||||
color: white
|
||||
query: false
|
||||
options:
|
||||
delete: false
|
||||
changeTitle: false
|
||||
changeTemplate: false
|
||||
changeStatus: false
|
||||
changeSlug: false
|
||||
move: false
|
||||
duplicate: false
|
||||
sort: false
|
||||
|
|
@ -21,5 +21,8 @@ return [
|
|||
'routes' => [
|
||||
require(__DIR__ . '/routes/logout.php'),
|
||||
require(__DIR__ . '/routes/toggle-favorite.php'),
|
||||
],
|
||||
'hooks' => [
|
||||
'page.create:after' => require_once(__DIR__ . '/hooks/create-steps.php')
|
||||
]
|
||||
];
|
||||
|
|
|
|||
37
public/site/config/hooks/create-steps.php
Normal file
37
public/site/config/hooks/create-steps.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
return function($newPage, $oldPage) {
|
||||
if ($newPage->template() != "project") return;
|
||||
|
||||
$newPage->createChild([
|
||||
'slug' => 'client-brief',
|
||||
'template' => 'client-brief',
|
||||
'content' => [
|
||||
'title' => 'Brief client'
|
||||
]
|
||||
]);
|
||||
|
||||
$newPage->createChild([
|
||||
'slug' => 'proposal',
|
||||
'template' => 'proposal',
|
||||
'content' => [
|
||||
'title' => 'Offre commerciale'
|
||||
]
|
||||
]);
|
||||
|
||||
$newPage->createChild([
|
||||
'slug' => 'extended-brief',
|
||||
'template' => 'extended-brief',
|
||||
'content' => [
|
||||
'title' => 'Brief enrichi'
|
||||
]
|
||||
]);
|
||||
|
||||
$newPage->createChild([
|
||||
'slug' => 'sample',
|
||||
'template' => 'sample',
|
||||
'content' => [
|
||||
'title' => 'Échantillon virtuel'
|
||||
]
|
||||
]);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue