virtual sample - reorganize files data (add dynamic / static level)
This commit is contained in:
parent
e29738c4ab
commit
2c574069f5
5 changed files with 79 additions and 29 deletions
|
|
@ -16,14 +16,40 @@ options:
|
|||
|
||||
tabs:
|
||||
contentTab:
|
||||
sections:
|
||||
tracksSection:
|
||||
label: Piste
|
||||
type: pages
|
||||
layout: cards
|
||||
template: track
|
||||
fieldsSection:
|
||||
type: fields
|
||||
fields:
|
||||
stepName:
|
||||
type: hidden
|
||||
columns:
|
||||
- width: 1/2
|
||||
sections:
|
||||
fieldsSection:
|
||||
type: fields
|
||||
fields:
|
||||
staticHeadline:
|
||||
label: Vue statique
|
||||
type: headline
|
||||
rawGlass:
|
||||
label: Verre brut
|
||||
type: files
|
||||
multiple: false
|
||||
accept:
|
||||
extension: pdf
|
||||
finishedGlass:
|
||||
label: Verre parachevé
|
||||
type: files
|
||||
mutliple: false
|
||||
accept:
|
||||
extension: pdf
|
||||
stepName:
|
||||
type: hidden
|
||||
|
||||
- width: 1/2
|
||||
sections:
|
||||
rightColFieldsSection:
|
||||
type: fields
|
||||
fields:
|
||||
dynamicHeadline:
|
||||
label: Vue dynamique
|
||||
type: headline
|
||||
tracksSection:
|
||||
label: Pistes
|
||||
type: pages
|
||||
layout: cards
|
||||
template: track
|
||||
|
|
|
|||
|
|
@ -66,21 +66,35 @@ class ProjectPage extends Page {
|
|||
|
||||
private function handleVirtualSampleStep($child, &$files, &$uri) {
|
||||
$uri = $child->parent()->uri() . '?dialog=' . $child->slug();
|
||||
|
||||
foreach ($child->children() as $key => $track) {
|
||||
|
||||
if ($child->hasChildren()) {
|
||||
$files['dynamic'] = [];
|
||||
|
||||
$trackData = [
|
||||
'title' => (string) $track->title(),
|
||||
'slug' => (string) $track->slug(),
|
||||
'files' => [],
|
||||
];
|
||||
|
||||
foreach ($track->views()->toFiles() as $view) {
|
||||
$trackData['files'][] = getFileData($view);
|
||||
foreach ($child->children() as $key => $track) {
|
||||
$trackData = [
|
||||
'title' => (string) $track->title(),
|
||||
'slug' => (string) $track->slug(),
|
||||
'files' => [],
|
||||
];
|
||||
|
||||
foreach ($track->views()->toFiles() as $view) {
|
||||
$trackData['files'][] = getFileData($view);
|
||||
}
|
||||
|
||||
$files['dynamic'][] = $trackData;
|
||||
}
|
||||
}
|
||||
|
||||
$files[] = $trackData;
|
||||
if ($child->rawGlass()->isNotEmpty() || $child->finishedGlass()->isNotEmpty()) {
|
||||
$files['static'] = [];
|
||||
}
|
||||
|
||||
if ($child->rawGlass()->isNotEmpty()) {
|
||||
$files['static']['rawGlass'] = getFileData($child->rawGlass()->toFile());
|
||||
}
|
||||
|
||||
if ($child->finishedGlass()->isNotEmpty()) {
|
||||
$files['static']['finishedGlass'] = getFileData($child->finishedGlass()->toFile());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue