From 6d9c4283bd3dbd95b8fa0f0a1d6a06e052294e99 Mon Sep 17 00:00:00 2001 From: Josua Frank Date: Thu, 4 Jul 2024 00:05:39 +0200 Subject: [PATCH] fixes and enhancements --- components/informations/ProjectProgress.vue | 77 +++++++++--------- components/templates/LegendComponent.vue | 6 +- pages/templates/[number]/index.vue | 86 ++++++++++++++++++--- 3 files changed, 123 insertions(+), 46 deletions(-) diff --git a/components/informations/ProjectProgress.vue b/components/informations/ProjectProgress.vue index ec3f0a1..1ac3d1f 100644 --- a/components/informations/ProjectProgress.vue +++ b/components/informations/ProjectProgress.vue @@ -12,28 +12,28 @@
- {{ progress[i].length / 5 }}% + {{ p.progress / 5 }}%
- {{ progress[i].length }} {{ $t("tiles") }} + {{ p.progress }} {{ $t("tiles") }}
-
+
const progress = useProgressStore(); -const currentMouseOver = ref(); +const currentMouseOver = ref(); -const tileProgress = ref({ - finished: { - classes: "bg-success text-bg-success", - styles: "border-radius: 50rem 0 0 50rem;", - text: "finished", - }, - inProgress: { - classes: "bg-primary text-bg-primary", - styles: "", - text: "in-progress", - }, - reserved: { - classes: "bg-danger text-bg-danger", - styles: "", - text: "reserved", - }, - availableInStock: { - classes: "bg-warning text-bg-warning", - styles: "border-radius: 0 50rem 50rem 0;", - text: "available-in-stock", - }, - availableOutOfStock: { - classes: "bg-info text-bg-info", - styles: "border-radius: 0 50rem 50rem 0;", - text: "available-out-of-stock", - }, -}); +const tileProgress = computed(() => + [ + { + classes: "bg-success text-bg-success", + styles: "border-radius: 50rem 0 0 50rem;", + text: "finished", + progress: progress.finished.length, + }, + { + classes: "bg-primary text-bg-primary", + styles: "", + text: "in-progress", + progress: progress.inProgress.length, + }, + { + classes: "bg-danger text-bg-danger", + styles: "", + text: "reserved", + progress: progress.reserved.length, + }, + { + classes: "bg-warning text-bg-warning", + styles: "border-radius: 0 50rem 50rem 0;", + text: "available-in-stock", + progress: progress.availableInStock.length, + }, + { + classes: "bg-info text-bg-info", + styles: "border-radius: 0 50rem 50rem 0;", + text: "available-out-of-stock", + progress: progress.availableOutOfStock.length, + }, + ].filter((p) => p.progress > 0), +);