2024-12-20 07:19:46 +01:00
|
|
|
<template>
|
2024-12-20 10:40:44 +01:00
|
|
|
<Images
|
|
|
|
|
v-if="images.length > 0"
|
|
|
|
|
:step="step"
|
|
|
|
|
:images="images"
|
2026-02-02 18:21:11 +01:00
|
|
|
:uri="addLocalePrefix(step.uri)"
|
2024-12-20 10:40:44 +01:00
|
|
|
/>
|
2024-12-20 07:19:46 +01:00
|
|
|
<Document v-if="pdf" :step="step" :pdf="pdf" />
|
|
|
|
|
|
|
|
|
|
<button
|
2026-02-02 17:04:09 +01:00
|
|
|
v-if="images.length === 0 && step.id === 'clientBrief'"
|
2024-12-20 07:19:46 +01:00
|
|
|
class="btn | w-full"
|
|
|
|
|
@click="goToImagesBrief()"
|
|
|
|
|
>
|
2026-02-02 18:21:11 +01:00
|
|
|
{{ t('brief.addPlatform') }}
|
2024-12-20 07:19:46 +01:00
|
|
|
</button>
|
2026-02-02 17:04:09 +01:00
|
|
|
<div class="btn | w-full" v-if="!pdf && step.id === 'clientBrief'">
|
2024-12-20 07:19:46 +01:00
|
|
|
<label for="upload-pdf">
|
2026-02-02 18:21:11 +01:00
|
|
|
{{ t('brief.addPdf') }}
|
2024-12-20 07:19:46 +01:00
|
|
|
<input
|
|
|
|
|
id="upload-pdf"
|
|
|
|
|
type="file"
|
|
|
|
|
@change="addPdf($event, step.uri)"
|
|
|
|
|
accept="application/pdf"
|
|
|
|
|
ref="pdfInput"
|
|
|
|
|
hidden
|
|
|
|
|
/>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { computed } from "vue";
|
|
|
|
|
import Images from "./Images.vue";
|
|
|
|
|
import Document from "./Document.vue";
|
|
|
|
|
import { useBriefStore } from "../../../stores/brief";
|
|
|
|
|
import { useRouter } from "vue-router";
|
2026-02-02 18:21:11 +01:00
|
|
|
import { useI18n } from "vue-i18n";
|
|
|
|
|
import { addLocalePrefix } from "../../../utils/router";
|
2024-12-20 07:19:46 +01:00
|
|
|
|
|
|
|
|
const { step } = defineProps({ step: Object });
|
|
|
|
|
const { addPdf } = useBriefStore();
|
|
|
|
|
const router = useRouter();
|
2026-02-02 18:21:11 +01:00
|
|
|
const { t } = useI18n();
|
2024-12-20 07:19:46 +01:00
|
|
|
|
|
|
|
|
const images = computed(() => {
|
|
|
|
|
return step.files.filter((file) => file.type === "image");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const pdf = computed(() => {
|
|
|
|
|
return step.files.find((file) => file.type === "document");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function goToImagesBrief() {
|
2026-01-30 09:13:31 +01:00
|
|
|
router.push(location.pathname + "/" + step.slug);
|
2024-12-20 07:19:46 +01:00
|
|
|
}
|
|
|
|
|
</script>
|