add client brief page
This commit is contained in:
parent
83cf6beea7
commit
769639b241
12 changed files with 97 additions and 53 deletions
|
|
@ -2,14 +2,17 @@
|
||||||
|
|
||||||
class ProjectPage extends Page {
|
class ProjectPage extends Page {
|
||||||
public function getSteps() {
|
public function getSteps() {
|
||||||
|
$steps = [];
|
||||||
|
|
||||||
$steps = array_map(function($child) {
|
foreach ($this->children() as $child) {
|
||||||
return [
|
$steps[] = [
|
||||||
'text' => $child['content']['title'],
|
'text' => $child->title()->value(),
|
||||||
'value' => $child['content']['stepname'],
|
'value' => $child->stepName()->value(),
|
||||||
'index' => $child['content']['stepindex']
|
'index' => $child->stepIndex()->value(),
|
||||||
|
'modified' => $child->modified('Y-MM-dd'),
|
||||||
|
'uri' => $child->uri()
|
||||||
];
|
];
|
||||||
}, $this->children()->toArray());
|
}
|
||||||
|
|
||||||
usort($steps, function ($a, $b) {
|
usort($steps, function ($a, $b) {
|
||||||
return $a['index'] <=> $b['index'];
|
return $a['index'] <=> $b['index'];
|
||||||
|
|
|
||||||
9
public/site/templates/client-brief.json.php
Normal file
9
public/site/templates/client-brief.json.php
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$specificData = [
|
||||||
|
"exampleField" => $page->exampleField(),
|
||||||
|
];
|
||||||
|
|
||||||
|
$data = array_merge($genericData, $specificData);
|
||||||
|
|
||||||
|
echo json_encode($data);
|
||||||
1
public/site/templates/client-brief.php
Normal file
1
public/site/templates/client-brief.php
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<?php snippet('generic-template') ?>
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
:style="'--image: url(\'' + inspiration.cover + '\')'"
|
:style="'--image: url(\'' + inspiration.cover + '\')'"
|
||||||
>
|
>
|
||||||
<h2
|
<h2
|
||||||
id="inspiration-title"
|
id="inspiration-title"
|
||||||
class="inspiration__title | font-serif | text-lg"
|
class="inspiration__title | font-serif | text-lg"
|
||||||
:class="{ new: inspiration.new }"
|
:class="{ new: inspiration.new }"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
12
src/components/project/Header.vue
Normal file
12
src/components/project/Header.vue
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<template>
|
||||||
|
<header class="flex | bg-white | rounded-2xl | p-8 mb-16">
|
||||||
|
<h1 class="font-serif | px-8">{{ title }}</h1>
|
||||||
|
<button class="btn | ml-auto">Demander un RDV</button>
|
||||||
|
</header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const { title } = defineProps({
|
||||||
|
title: String,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
@ -5,33 +5,46 @@
|
||||||
data-status="done"
|
data-status="done"
|
||||||
>
|
>
|
||||||
<h2 id="votre-brief-label">
|
<h2 id="votre-brief-label">
|
||||||
<span data-icon="votre-brief">Votre brief</span>
|
<span data-icon="votre-brief">{{ step.text }}</span>
|
||||||
</h2>
|
</h2>
|
||||||
<div class="cards | flow">
|
<div class="cards | flow">
|
||||||
<article class="card">
|
<article class="card">
|
||||||
<hgroup class="order-last">
|
<hgroup class="order-last">
|
||||||
<h3 class="card__title | font-serif | text-lg">Votre Brief</h3>
|
<h3 class="card__title | font-serif | text-lg">{{ step.text }}</h3>
|
||||||
</hgroup>
|
</hgroup>
|
||||||
<div class="card__meta | flex">
|
<div class="card__meta | flex">
|
||||||
<time class="card__date | text-grey-700" datetime="2024-06-12"
|
<time class="card__date | text-grey-700" datetime="2024-06-12">{{
|
||||||
>12 juin 2024</time
|
dayjs(step.modified).format("DD MMMM YYYY")
|
||||||
>
|
}}</time>
|
||||||
</div>
|
</div>
|
||||||
<figure class="card__images" data-count="13">
|
<router-link :to="'/' + step.uri">
|
||||||
<img
|
<figure class="card__images" data-count="13">
|
||||||
src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/6ed93d6950-1725442486/d82f18573c439d6edd434ffca62471a7.png"
|
<img
|
||||||
alt=""
|
src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/6ed93d6950-1725442486/d82f18573c439d6edd434ffca62471a7.png"
|
||||||
/>
|
alt=""
|
||||||
<img
|
/>
|
||||||
src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/7b0fcc5012-1725442486/37a038883c87973036232aa0e43f6da2.png"
|
<img
|
||||||
alt=""
|
src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/7b0fcc5012-1725442486/37a038883c87973036232aa0e43f6da2.png"
|
||||||
/>
|
alt=""
|
||||||
<img
|
/>
|
||||||
src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/1bbe051c5a-1725442486/0c41d3266e9ce2872f30608cceb28239.png"
|
<img
|
||||||
alt=""
|
src="http://localhost:8888/media/pages/inspirations/shape-of-the-nature/1bbe051c5a-1725442486/0c41d3266e9ce2872f30608cceb28239.png"
|
||||||
/>
|
alt=""
|
||||||
</figure>
|
/>
|
||||||
|
</figure>
|
||||||
|
</router-link>
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import "dayjs/locale/fr";
|
||||||
|
|
||||||
|
dayjs.locale("fr");
|
||||||
|
|
||||||
|
const { step } = defineProps({
|
||||||
|
step: Object,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import Notifications from "../views/Notifications.vue";
|
||||||
import Reunions from "../views/Reunions.vue";
|
import Reunions from "../views/Reunions.vue";
|
||||||
import Inspirations from "../views/Inspirations.vue";
|
import Inspirations from "../views/Inspirations.vue";
|
||||||
import Project from "../views/Project.vue";
|
import Project from "../views/Project.vue";
|
||||||
|
import ClientBrief from "../views/ClientBrief.vue";
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
|
|
@ -25,6 +26,10 @@ const routes = [
|
||||||
path: "/projects/:id",
|
path: "/projects/:id",
|
||||||
component: Project,
|
component: Project,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/projects/:id/client-brief",
|
||||||
|
component: ClientBrief,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default routes;
|
export default routes;
|
||||||
|
|
|
||||||
25
src/views/ClientBrief.vue
Normal file
25
src/views/ClientBrief.vue
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
<template>
|
||||||
|
<main class="flex flex-col items-stretch | w-full">
|
||||||
|
<Header />
|
||||||
|
<component :is="stepsComponents[currentStep]" @update:step="changeStep" />
|
||||||
|
</main>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { ref } from "vue";
|
||||||
|
import Header from "../components/project/Header.vue";
|
||||||
|
import Intro from "../components/project/ClientBrief/Intro.vue";
|
||||||
|
import ModeSelection from "../components/project/ClientBrief/ModeSelection.vue";
|
||||||
|
import AddImages from "../components/project/ClientBrief/AddImages.vue";
|
||||||
|
|
||||||
|
const stepsComponents = {
|
||||||
|
Intro,
|
||||||
|
ModeSelection,
|
||||||
|
AddImages,
|
||||||
|
};
|
||||||
|
|
||||||
|
const currentStep = ref("Intro");
|
||||||
|
|
||||||
|
function changeStep(stepName) {
|
||||||
|
currentStep.value = stepName;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -1,16 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<main class="flex flex-col items-stretch | w-full">
|
<main class="flex flex-col items-stretch | w-full">
|
||||||
<header class="flex | bg-white | rounded-2xl | p-8 mb-16">
|
<Header :title="page.content.title" />
|
||||||
<h1 class="font-serif | px-8">{{ page.content.title }}</h1>
|
|
||||||
<button class="btn | ml-auto">Demander un RDV</button>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<!-- <component :is="stepsComponents[currentStep]" @update:step="changeStep" /> -->
|
|
||||||
|
|
||||||
<!-- Kanban: Status Brief Enrichi -->
|
<!-- Kanban: Status Brief Enrichi -->
|
||||||
|
|
||||||
<div class="kanban">
|
<div class="kanban">
|
||||||
<ProjectStep v-for="step in steps" :key="step" :step="step" />
|
<ProjectStep v-for="step in page.steps" :key="step" :step="step" />
|
||||||
<!-- <section
|
<!-- <section
|
||||||
class="flex-1"
|
class="flex-1"
|
||||||
aria-labelledby="votre-brief-label"
|
aria-labelledby="votre-brief-label"
|
||||||
|
|
@ -157,31 +151,13 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { usePageStore } from "../stores/page";
|
import { usePageStore } from "../stores/page";
|
||||||
import { useUserStore } from "../stores/user";
|
import { useUserStore } from "../stores/user";
|
||||||
import { ref, computed } from "vue";
|
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import ProjectStep from "../components/project/ProjectStep.vue";
|
import ProjectStep from "../components/project/ProjectStep.vue";
|
||||||
import Intro from "../components/project/brief/Intro.vue";
|
import Header from "../components/project/Header.vue";
|
||||||
import ModeSelection from "../components/project/brief/ModeSelection.vue";
|
|
||||||
import AddImages from "../components/project/brief/AddImages.vue";
|
|
||||||
|
|
||||||
const { page } = storeToRefs(usePageStore());
|
const { page } = storeToRefs(usePageStore());
|
||||||
const user = useUserStore().user;
|
const user = useUserStore().user;
|
||||||
|
|
||||||
const currentStep = page.value.currentStep;
|
|
||||||
const steps = page.value.steps.map((step) => step.value);
|
|
||||||
|
|
||||||
// const stepsComponents = {
|
|
||||||
// Intro,
|
|
||||||
// ModeSelection,
|
|
||||||
// AddImages,
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const currentStep = ref("Intro");
|
|
||||||
|
|
||||||
// function changeStep(stepName) {
|
|
||||||
// currentStep.value = stepName;
|
|
||||||
// }
|
|
||||||
|
|
||||||
function setStepStatus(stepName) {
|
function setStepStatus(stepName) {
|
||||||
const stepIndex = steps.indexOf(stepName);
|
const stepIndex = steps.indexOf(stepName);
|
||||||
const currentIndex = steps.indexOf(currentStep.value);
|
const currentIndex = steps.indexOf(currentStep.value);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue