dynamize project

This commit is contained in:
isUnknown 2024-11-05 14:26:23 +01:00
parent 4d1811830c
commit 801db754d2
3 changed files with 23 additions and 2 deletions

View file

@ -6,6 +6,7 @@ $children = $page->children()->map(function ($child) {
'uri' => $child->uri(), 'uri' => $child->uri(),
'uri' => '/' . $child->uri(), 'uri' => '/' . $child->uri(),
'modified' => $child->modified('Y-MM-d'), 'modified' => $child->modified('Y-MM-d'),
'currentStep' => $child->currentStep()->value(),
'status' => $child->status(), 'status' => $child->status(),
'logo' => $child->client()->toPage()->logo()->toFile()->url(), 'logo' => $child->client()->toPage()->logo()->toFile()->url(),
]; ];

View file

@ -13,7 +13,9 @@
<img :src="project.logo" alt="Logo" class="project-logo | rounded-sm" /> <img :src="project.logo" alt="Logo" class="project-logo | rounded-sm" />
<ol class="project-steps" data-steps="1"> <ol class="project-steps" data-steps="1">
<li class="project-step" data-status="in-progress"> <li class="project-step" data-status="in-progress">
<span class="pill" data-icon="search">Votre Brief</span> <span class="pill" data-icon="search">{{
stepsLabels[project.currentStep]
}}</span>
</li> </li>
</ol> </ol>
</article> </article>
@ -23,13 +25,17 @@
<script setup> <script setup>
import dayjs from "dayjs"; import dayjs from "dayjs";
import "dayjs/locale/fr"; import "dayjs/locale/fr";
const { project } = defineProps({ project: Array }); import { useProjectStore } from "../../stores/project";
dayjs.locale("fr"); dayjs.locale("fr");
const { project } = defineProps({ project: Array });
const frenchFormattedModified = dayjs(project.modified).format( const frenchFormattedModified = dayjs(project.modified).format(
"dddd D MMMM YYYY" "dddd D MMMM YYYY"
); );
const { stepsLabels } = useProjectStore();
</script> </script>
<style scoped> <style scoped>

14
src/stores/project.js Normal file
View file

@ -0,0 +1,14 @@
import { defineStore } from "pinia";
export const useProjectStore = defineStore("project", () => {
const stepsLabels = {
clientBrief: "Votre brief",
proposal: "Proposition commerciale",
extendedBrief: "Brief enrichi",
industrialIdeation: "Idéation industrielle",
virtualSample: "Échantillon virtuel",
physicalSample: "Échantillon physique",
};
return { stepsLabels };
});