collection -> inspiration
This commit is contained in:
parent
dfda911664
commit
0d41b27cc3
9 changed files with 61 additions and 16 deletions
|
|
@ -85,5 +85,20 @@ return [
|
|||
'users',
|
||||
'system'
|
||||
]
|
||||
],
|
||||
'routes' => [
|
||||
[
|
||||
'pattern' => '(:all)logout.php',
|
||||
'action' => function () {
|
||||
$kirby = kirby();
|
||||
$user = $kirby->user();
|
||||
$user->logout();
|
||||
session_start();
|
||||
|
||||
go($_SESSION['redirect_url']);
|
||||
|
||||
return '<html><body>logout</body></html>';
|
||||
}
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,3 +1,15 @@
|
|||
|
||||
<script>
|
||||
const kirbyData = {
|
||||
user: {
|
||||
role: '<?= $kirby->user()->role() ?>',
|
||||
<?php if ($kirby->user()->role() == 'client'): ?>
|
||||
client: {
|
||||
name: '<?= $kirby->user()->client()->toPage()->title() ?>',
|
||||
uuid: '<?= $kirby->user()->client()->toPage()->uuid() ?>',
|
||||
}
|
||||
<?php endif ?>
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
<?php
|
||||
|
||||
$collections = $page->children()->map(function ($child) {
|
||||
$inspirations = $page->children()->map(function ($child) {
|
||||
return [
|
||||
'title' => $child->title()->value(),
|
||||
'description' => $child->description()->value(),
|
||||
'new' => $child->new()->value() === "true" ? true : false,
|
||||
'date' => $child->date()->toDate('Y-MM-d'),
|
||||
'url' => $child->url(),
|
||||
|
|
@ -18,7 +19,7 @@ $collections = $page->children()->map(function ($child) {
|
|||
})->values();
|
||||
|
||||
$specificData = [
|
||||
"collections" => $collections
|
||||
"inspirations" => $inspirations
|
||||
];
|
||||
|
||||
$data = array_merge($genericData, $specificData);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue