2024-09-26 17:21:24 +02:00
|
|
|
<template>
|
2024-11-16 11:30:51 +01:00
|
|
|
<section class="flex-1" :aria-labelledby="step.id" :data-status="status">
|
2024-10-23 09:48:27 +02:00
|
|
|
<router-link :to="'/' + step.uri">
|
2024-11-16 11:30:51 +01:00
|
|
|
<h2 :id="step.id">
|
2024-10-23 09:48:27 +02:00
|
|
|
<!-- ADRIEN / TIMOTHÉE : DYNAMISER L'ICONE -->
|
2024-11-16 11:30:51 +01:00
|
|
|
<span data-icon="votre-brief">{{ step.label }}</span>
|
2024-10-23 09:48:27 +02:00
|
|
|
</h2>
|
|
|
|
|
<div class="cards | flow">
|
2024-11-18 15:52:15 +01:00
|
|
|
<article v-if="step.id !== 'proposal'" class="card">
|
2024-10-23 09:48:27 +02:00
|
|
|
<hgroup class="order-last">
|
2024-11-16 11:30:51 +01:00
|
|
|
<h3 class="card__title | font-serif | text-lg">{{ step.label }}</h3>
|
2024-10-23 09:48:27 +02:00
|
|
|
</hgroup>
|
|
|
|
|
<div class="card__meta | flex">
|
2024-11-16 11:30:51 +01:00
|
|
|
<time
|
|
|
|
|
class="card__date | text-grey-700"
|
|
|
|
|
:datetime="dayjs(step.modified).format('YYYY-M-DD')"
|
|
|
|
|
>{{ dayjs(step.modified).format("DD MMMM YYYY") }}</time
|
|
|
|
|
>
|
2024-10-23 09:48:27 +02:00
|
|
|
</div>
|
2024-10-16 17:32:15 +02:00
|
|
|
|
2024-11-16 11:30:51 +01:00
|
|
|
<!-- All images -->
|
|
|
|
|
<figure
|
|
|
|
|
v-if="
|
|
|
|
|
step.value === 'clientBrief' && step.files[0]?.type === 'image'
|
|
|
|
|
"
|
|
|
|
|
class="card__images"
|
|
|
|
|
:data-count="
|
|
|
|
|
step.files.length > 3 ? step.files.length - 3 : undefined
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<img
|
|
|
|
|
v-for="image in step.files.slice(0, 3)"
|
|
|
|
|
:key="image.uuid"
|
|
|
|
|
:src="image.url"
|
|
|
|
|
:alt="image.alt"
|
|
|
|
|
/>
|
|
|
|
|
</figure>
|
|
|
|
|
|
|
|
|
|
<!-- First image -->
|
|
|
|
|
<figure v-if="step.value === 'virtualSample'" class="card__images">
|
|
|
|
|
<img
|
|
|
|
|
:key="step.files[0].uuid"
|
|
|
|
|
:src="step.files[0].url"
|
|
|
|
|
:alt="step.files[0].alt"
|
|
|
|
|
/>
|
|
|
|
|
</figure>
|
|
|
|
|
|
|
|
|
|
<!-- Document -->
|
|
|
|
|
<div
|
|
|
|
|
v-if="step.files[0]?.type === 'document'"
|
|
|
|
|
class="card__images"
|
|
|
|
|
data-icon="document"
|
|
|
|
|
></div>
|
2024-10-23 11:32:51 +02:00
|
|
|
|
2024-11-08 12:25:00 +01:00
|
|
|
<footer v-if="step?.files[0]?.comments?.length > 0">
|
|
|
|
|
{{ step.files[0].comments.length }} commentaire{{
|
|
|
|
|
step.files[0].comments.length > 1 ? "s" : ""
|
|
|
|
|
}}
|
|
|
|
|
</footer>
|
2024-10-23 09:48:27 +02:00
|
|
|
</article>
|
2024-11-18 15:52:15 +01:00
|
|
|
|
|
|
|
|
<template v-if="step.id == 'proposal' && step.files.length">
|
|
|
|
|
<article class="card" v-for="file in step.files">
|
|
|
|
|
<hgroup class="order-last">
|
|
|
|
|
<h3 class="card__title | font-serif | text-lg">
|
|
|
|
|
{{
|
|
|
|
|
file.label.length ? file.label : file.name.replace(".pdf", "")
|
|
|
|
|
}}
|
|
|
|
|
</h3>
|
|
|
|
|
</hgroup>
|
|
|
|
|
<div class="card__meta | flex">
|
|
|
|
|
<time
|
|
|
|
|
class="card__date | text-grey-700"
|
|
|
|
|
:datetime="dayjs(file.modified).format('YYYY-M-DD')"
|
|
|
|
|
>{{ dayjs(file.modified).format("DD MMMM YYYY") }}</time
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card__images" data-icon="document"></div>
|
|
|
|
|
|
|
|
|
|
<footer v-if="file.comments?.length > 0">
|
|
|
|
|
{{ file.comments.length }} commentaire{{
|
|
|
|
|
file.comments.length > 1 ? "s" : ""
|
|
|
|
|
}}
|
|
|
|
|
</footer>
|
|
|
|
|
</article>
|
|
|
|
|
</template>
|
2024-10-23 09:48:27 +02:00
|
|
|
</div>
|
|
|
|
|
</router-link>
|
2024-09-26 17:21:24 +02:00
|
|
|
</section>
|
|
|
|
|
</template>
|
2024-09-26 19:14:20 +02:00
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
|
import "dayjs/locale/fr";
|
2024-10-16 15:32:24 +02:00
|
|
|
import { usePageStore } from "../../stores/page";
|
2024-09-26 19:14:20 +02:00
|
|
|
|
|
|
|
|
const { step } = defineProps({
|
|
|
|
|
step: Object,
|
|
|
|
|
});
|
2024-10-16 15:32:24 +02:00
|
|
|
|
2024-10-23 11:32:51 +02:00
|
|
|
const emit = defineEmits(["update:file"]);
|
2024-10-16 18:43:04 +02:00
|
|
|
|
2024-10-16 15:32:24 +02:00
|
|
|
dayjs.locale("fr");
|
|
|
|
|
|
|
|
|
|
const { page } = usePageStore();
|
|
|
|
|
|
2024-10-16 17:32:15 +02:00
|
|
|
const steps = page.steps.map((item) => {
|
|
|
|
|
return item.value;
|
|
|
|
|
});
|
2024-10-16 15:32:24 +02:00
|
|
|
|
|
|
|
|
const status = setStatus();
|
|
|
|
|
|
|
|
|
|
function setStatus() {
|
2024-11-18 15:52:15 +01:00
|
|
|
const currentStepId = page.content.currentstep;
|
|
|
|
|
|
|
|
|
|
const currentStepIndex = page.steps.findIndex(
|
|
|
|
|
(item) => item.id === currentStepId
|
|
|
|
|
);
|
|
|
|
|
const stepIndex = page.steps.findIndex((item) => item.id === step.id);
|
|
|
|
|
|
|
|
|
|
if (currentStepIndex === stepIndex) {
|
2024-10-16 15:32:24 +02:00
|
|
|
return "in-progress";
|
|
|
|
|
}
|
2024-11-18 15:52:15 +01:00
|
|
|
if (currentStepIndex > stepIndex) {
|
|
|
|
|
return "done";
|
2024-10-16 15:32:24 +02:00
|
|
|
}
|
2024-11-18 15:52:15 +01:00
|
|
|
if (currentStepIndex < stepIndex) {
|
2024-10-16 15:32:24 +02:00
|
|
|
return "uncompleted";
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-09-26 19:14:20 +02:00
|
|
|
</script>
|
2024-10-16 15:36:29 +02:00
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.kanban > section {
|
|
|
|
|
min-width: 20rem;
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kanban .cards {
|
|
|
|
|
padding-top: var(--space-16);
|
|
|
|
|
max-height: calc(100% - var(--header-height));
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kanban > section h2 {
|
|
|
|
|
position: relative;
|
|
|
|
|
background-color: var(--header-bg-color);
|
|
|
|
|
border-radius: var(--rounded-md);
|
|
|
|
|
font-size: var(--text-sm);
|
|
|
|
|
height: var(--header-height);
|
|
|
|
|
}
|
|
|
|
|
.kanban > section h2 > span {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: var(--space-8);
|
|
|
|
|
background-color: var(--header-title-bg-color);
|
|
|
|
|
color: var(--color-white);
|
|
|
|
|
height: 100%;
|
|
|
|
|
width: fit-content;
|
|
|
|
|
padding: 0 var(--space-12);
|
|
|
|
|
border-top-left-radius: inherit;
|
|
|
|
|
border-bottom-left-radius: inherit;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
}
|
|
|
|
|
.kanban > section + section h2::before {
|
|
|
|
|
content: "";
|
|
|
|
|
display: inline-block;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: calc(var(--header-height) / 2 - 1.5px);
|
|
|
|
|
right: 100%;
|
|
|
|
|
width: var(--gap);
|
|
|
|
|
height: 3px;
|
|
|
|
|
background-color: var(--color-grey-200);
|
|
|
|
|
z-index: -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kanban [data-status="done"] h2::after {
|
|
|
|
|
content: "";
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
right: var(--space-4);
|
|
|
|
|
bottom: 0;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: var(--icon-size, var(--header-height));
|
|
|
|
|
height: var(--icon-size, var(--header-height));
|
|
|
|
|
background: var(--icon-color, currentColor);
|
|
|
|
|
mask-repeat: no-repeat;
|
|
|
|
|
mask-position: center;
|
|
|
|
|
mask-size: var(--icon-size, 1rem);
|
|
|
|
|
mask-image: var(--icon, var(--icon-check));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kanban [data-status="in-progress"] {
|
|
|
|
|
--header-bg-color: var(--color-primary-20);
|
|
|
|
|
--header-title-bg-color: var(--color-primary);
|
|
|
|
|
}
|
|
|
|
|
.kanban [data-status="in-progress"] h2::after {
|
|
|
|
|
content: "";
|
|
|
|
|
color: var(--color-primary);
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
right: var(--space-4);
|
|
|
|
|
bottom: 0;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: var(--icon-size, var(--header-height));
|
|
|
|
|
height: var(--icon-size, var(--header-height));
|
|
|
|
|
background: var(--icon-color, currentColor);
|
|
|
|
|
mask-repeat: no-repeat;
|
|
|
|
|
mask-position: center;
|
|
|
|
|
mask-size: var(--icon-size, 1rem);
|
|
|
|
|
mask-image: var(--icon-point-active);
|
|
|
|
|
}
|
|
|
|
|
.kanban [data-status="in-progress"]::after {
|
|
|
|
|
content: "En cours";
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
right: calc(var(--icon-size, var(--header-height)) + var(--space-4));
|
|
|
|
|
color: var(--color-primary);
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
font-size: var(--text-sm);
|
|
|
|
|
line-height: 2.125rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.kanban [data-status="uncompleted"] h2 {
|
|
|
|
|
background: none;
|
|
|
|
|
}
|
|
|
|
|
.kanban [data-status="uncompleted"] h2::before {
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
background-repeat: repeat-x;
|
|
|
|
|
background-position: left center;
|
|
|
|
|
background-image: url("data:image/svg+xml,%3Csvg width='8' height='8' viewBox='0 0 8 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50%' cy='50%' r='2' opacity='0.15' fill='black'/%3E%3C/svg%3E%0A");
|
|
|
|
|
background-size: 0.5rem;
|
|
|
|
|
right: calc(-1 * var(--gap));
|
|
|
|
|
left: calc(-1 * var(--gap));
|
|
|
|
|
width: auto;
|
|
|
|
|
}
|
|
|
|
|
.kanban [data-status="uncompleted"] h2 > span {
|
|
|
|
|
border-radius: inherit;
|
|
|
|
|
}
|
|
|
|
|
.kanban [data-status="uncompleted"] .cards > * {
|
|
|
|
|
min-height: 10rem;
|
|
|
|
|
}
|
|
|
|
|
.kanban [data-status="uncompleted"]::after {
|
|
|
|
|
content: "En attente";
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
background-color: var(--color-grey-50);
|
|
|
|
|
color: var(--color-grey-700);
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
font-size: var(--text-sm);
|
|
|
|
|
line-height: 2.125rem;
|
|
|
|
|
padding: 0 var(--space-12);
|
|
|
|
|
}
|
|
|
|
|
</style>
|