diff --git a/public/content/projects/1_miss-dior-blooming-bouquet/1_client-brief/client-brief.txt b/public/content/projects/1_miss-dior-blooming-bouquet/1_client-brief/client-brief.txt index 9c8cae0..a7cbcf1 100644 --- a/public/content/projects/1_miss-dior-blooming-bouquet/1_client-brief/client-brief.txt +++ b/public/content/projects/1_miss-dior-blooming-bouquet/1_client-brief/client-brief.txt @@ -6,6 +6,10 @@ Stepname: clientBrief ---- +Isvalidated: true + +---- + Pdf: ---- @@ -26,8 +30,4 @@ Stepindex: 1 ---- -Uuid: glE28vWGearnAmxw - ----- - -Isvalidated: true \ No newline at end of file +Uuid: glE28vWGearnAmxw \ No newline at end of file diff --git a/public/site/blueprints/pages/client-brief.yml b/public/site/blueprints/pages/client-brief.yml index a6e242f..6357c4d 100644 --- a/public/site/blueprints/pages/client-brief.yml +++ b/public/site/blueprints/pages/client-brief.yml @@ -22,7 +22,7 @@ tabs: fields: stepName: type: hidden - isSent: + isValidated: type: hidden pdf: label: PDF diff --git a/public/site/config/routes/validate-brief.php b/public/site/config/routes/validate-brief.php index cca9907..410b022 100644 --- a/public/site/config/routes/validate-brief.php +++ b/public/site/config/routes/validate-brief.php @@ -1,7 +1,7 @@ 'validate-brief.json', + 'pattern' => '(:all)validate-brief.json', 'method' => 'POST', 'action' => function () { $json = file_get_contents('php://input'); @@ -28,6 +28,7 @@ return [ ] ], 'date' => $dateTime->format('Y-m-d\TH:i:sP'), + 'text' => "Brief (" . $project->title()->value() . ")", 'author' => [ 'name' => (string) kirby()->user()->name(), 'email' => (string) kirby()->user()->email(), diff --git a/src/views/Brief.vue b/src/views/Brief.vue index 60afc76..a50cdc2 100644 --- a/src/views/Brief.vue +++ b/src/views/Brief.vue @@ -9,7 +9,13 @@ > Retour au projet - + @@ -22,6 +28,7 @@ import Images from "../components/project/brief/Images.vue"; import TitledPdfWrapper from "../components/project/TitledPdfWrapper.vue"; import { usePageStore } from "../stores/page"; import { storeToRefs } from "pinia"; +import { useApiStore } from "../stores/api"; const stepsComponents = { Intro, @@ -31,6 +38,7 @@ const stepsComponents = { }; const { page } = storeToRefs(usePageStore()); +const api = useApiStore(); const currentStep = ref(setInitialStep()); @@ -47,6 +55,12 @@ function setInitialStep() { if (isEmpty) return "Intro"; if (hasImages) return "Images"; } + +function validate() { + api.validateBrief(page.value.uri).then((res) => { + location.href = "/" + page.value.parent; + }); +} \ No newline at end of file + diff --git a/src/views/Notifications.vue b/src/views/Notifications.vue index 885c35b..68873ef 100644 --- a/src/views/Notifications.vue +++ b/src/views/Notifications.vue @@ -45,7 +45,7 @@ >

@@ -68,7 +68,7 @@

{{ notification.text }} @@ -172,6 +172,10 @@ function readAll() { console.log("Could not read all notifications : ", error); } } + +function toPath(string) { + return string.replace(window.location.origin, ""); +}