diff --git a/public/site/blueprints/files/pdf.yml b/public/site/blueprints/files/pdf.yml index 13e1a5d..d817585 100644 --- a/public/site/blueprints/files/pdf.yml +++ b/public/site/blueprints/files/pdf.yml @@ -1,8 +1,5 @@ title: PDF -accept: - mime: application/pdf - extension: pdf focus: false fields: comments: diff --git a/public/site/blueprints/pages/client-brief.yml b/public/site/blueprints/pages/client-brief.yml index f7bd72b..2e900df 100644 --- a/public/site/blueprints/pages/client-brief.yml +++ b/public/site/blueprints/pages/client-brief.yml @@ -27,10 +27,8 @@ tabs: pdf: label: PDF type: files - multiple: false template: pdf - accept: - extension: pdf + multiple: false description: type: textarea size: tiny diff --git a/public/site/config/routes/upload-pdf.php b/public/site/config/routes/upload-pdf.php index 1542ad1..bfd5143 100644 --- a/public/site/config/routes/upload-pdf.php +++ b/public/site/config/routes/upload-pdf.php @@ -40,7 +40,7 @@ return [ 'content' => [ 'date' => date('Y-m-d h:i') ] - ]); + ]); $newPage = $page->update([ "pdf" => $newFile->id() @@ -50,7 +50,7 @@ return [ } catch (Exception $e) { return [ - 'error' => $e->getMessage(), + 'error' => $e->getMessage() . " in " . $e->getFile() . " line " . $e->getLine(), ]; } } diff --git a/public/site/plugins/helpers/index.php b/public/site/plugins/helpers/index.php index 69d1173..616dbc2 100644 --- a/public/site/plugins/helpers/index.php +++ b/public/site/plugins/helpers/index.php @@ -8,6 +8,10 @@ function getFileData($file) { 'quality' => 80, 'format' => 'webp' ])->url(), + 'parent' => [ + "title" => (string) $file->parent()->title(), + "uri" => $file->parent()->uri() + ], 'uuid' => (string) $file->uuid(), 'name' => $file->filename(), 'label' => (string) $file->label(), diff --git a/src/components/project/ProjectStep.vue b/src/components/project/ProjectStep.vue index cefb2c7..ee82e61 100644 --- a/src/components/project/ProjectStep.vue +++ b/src/components/project/ProjectStep.vue @@ -8,210 +8,7 @@ {{ step.label }}
- - - - +
@@ -223,19 +20,22 @@ import { usePageStore } from "../../stores/page"; import { computed } from "vue"; import { useProjectStore } from "../../stores/project"; import { useRouter } from "vue-router"; -import { useBriefStore } from "../../stores/brief"; +import ClientBrief from "./cards/ClientBrief.vue"; const { step } = defineProps({ step: Object, }); +const cardsMap = { + clientBrief: ClientBrief, +}; + const emit = defineEmits(["update:file"]); const router = useRouter(); dayjs.locale("fr"); const { page } = usePageStore(); -const { addPdf } = useBriefStore(); const { setStatus } = useProjectStore(); const steps = page.steps.map((item) => { @@ -262,16 +62,6 @@ function getFrontView(track) { const frontView = track.files.find((file) => file.name === frontViewName); return frontView; } - -function hasOneBriefType() { - const hasImage = step.files.some((file) => file.type === "image"); - const hasDocument = step.files.some((file) => file.type === "document"); - return hasImage ^ hasDocument; -} - -function toImagesBrief() { - router.push(location.pathname + "/client-brief?step=images"); -}