proposal step : handle multiple files

This commit is contained in:
isUnknown 2024-11-18 16:21:07 +01:00
parent 9ade34e6ea
commit 86d3f8b22c
7 changed files with 119 additions and 31 deletions

View file

@ -1,12 +1,12 @@
<template>
<section class="flex-1" :aria-labelledby="step.id" :data-status="status">
<router-link :to="'/' + step.uri">
<h2 :id="step.id">
<!-- ADRIEN / TIMOTHÉE : DYNAMISER L'ICONE -->
<span :data-icon="step.id">{{ step.label }}</span>
</h2>
<div class="cards | flow">
<article v-if="step.id !== 'proposal'" class="card">
<h2 :id="step.id">
<!-- ADRIEN / TIMOTHÉE : DYNAMISER L'ICONE -->
<span :data-icon="step.id">{{ step.label }}</span>
</h2>
<div class="cards | flow">
<article class="card" v-if="step.id !== 'proposal'">
<router-link :to="'/' + step.uri">
<hgroup class="order-last">
<h3 class="card__title | font-serif | text-lg">{{ step.label }}</h3>
</hgroup>
@ -57,10 +57,16 @@
step.files[0].comments.length > 1 ? "s" : ""
}}
</footer>
</article>
</router-link>
</article>
<template v-if="step.id == 'proposal' && step.files.length">
<article class="card" v-for="file in step.files">
<template v-if="step.id == 'proposal' && step.files.length">
<article
class="card"
v-for="(file, index) in step.files"
:key="file.name"
>
<router-link :to="'/' + step.uri + '&fileIndex=' + index">
<hgroup class="order-last">
<h3 class="card__title | font-serif | text-lg">
{{
@ -75,17 +81,21 @@
>{{ dayjs(file.modified).format("DD MMMM YYYY") }}</time
>
</div>
<div class="card__images" data-icon="document"></div>
<div
v-if="index === 0"
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>
</div>
</router-link>
</router-link>
</article>
</template>
</div>
</section>
</template>

View file

@ -44,13 +44,16 @@ import { useDialogStore } from "../../../stores/dialog";
import { useRoute, useRouter } from "vue-router";
import { storeToRefs } from "pinia";
const dialog = useDialogStore();
const { openedFile, comments } = storeToRefs(useDialogStore());
openedFile.value = dialog.content.files[0];
const router = useRouter();
const route = useRoute();
const dialog = useDialogStore();
const { openedFile, comments } = storeToRefs(useDialogStore());
openedFile.value = route.query.fileIndex
? dialog.content.files[route.query.fileIndex]
: dialog.content.files[0];
const licenseKey = import.meta.env.VITE_VPV_LICENSE;
useLicense({ licenseKey });

View file

@ -36,14 +36,14 @@
v-for="notification in sortedNotifications"
:key="notification.id"
>
<router-link
v-if="currentTab === 'all' || !notification.isRead"
:to="notification.location.href"
<article
class="notification | bg-white rounded-lg | p-16 | flow"
:data-status="notification.isRead ? 'read' : 'unread'"
:data-type="notification.type"
>
<article
class="notification | bg-white rounded-lg | p-16 | flow"
:data-status="notification.isRead ? 'read' : 'unread'"
:data-type="notification.type"
<router-link
v-if="currentTab === 'all' || !notification.isRead"
:to="notification.location.href"
>
<header>
<p class="flex">
@ -71,8 +71,8 @@
>
{{ notification.text }}
</p>
</article>
</router-link>
</router-link>
</article>
</template>
<!-- <article
class="notification | bg-white rounded-lg | p-16 | flow"
@ -156,7 +156,7 @@ function formatDate(notification) {
const isToday = notificationDigitalDate === todayDigitalDate;
if (isToday) {
return dayjs(notification.date).format("h:m");
return dayjs(notification.date).format("HH:mm");
} else if (todayDigitalDate === notificationDigitalDate + 1) {
return "hier";
} else {