From cde3c84bc732c2aeaeca3935a9598a736d3c6731 Mon Sep 17 00:00:00 2001 From: TobiZog Date: Sat, 30 Aug 2025 13:39:16 +0200 Subject: [PATCH] Append icons in toolbar shows tooltips, exercise page icon adds open exercises badge --- backend/data/exercises.json | 2 +- .../navigation/navigationAppendItems.vue | 137 +++++++++++++----- src/locales/de.json | 9 +- src/locales/en.json | 9 +- src/pages/misc/homePage/index.vue | 34 ++--- 5 files changed, 134 insertions(+), 57 deletions(-) diff --git a/backend/data/exercises.json b/backend/data/exercises.json index cfe0349..b284826 100644 --- a/backend/data/exercises.json +++ b/backend/data/exercises.json @@ -98,7 +98,7 @@ "nameEn": "Upgrade your privileges", "exerciseNr": 4, "descriptionDe": "Jetzt bearbeiten wir unseren eigenen Account. Schreibe hierfür einen >>UPDATE<<-SQL-Befehl, welcher die >>accountRoleId<< auf das Niveau eines >>Admin<< erhöht für deinen Account-Namen.", - "descriptionEn": "Change the privileges of your account" + "descriptionEn": "Now we'll edit our own account. To do this, write an >>UPDATE<< SQL command that elevates the >>accountRoleId<< to the level of >>Admin<< for your account name." }, { "uuid": "sql-injection-capture-account", diff --git a/src/components/navigation/navigationAppendItems.vue b/src/components/navigation/navigationAppendItems.vue index bc3a0e5..72e3354 100644 --- a/src/components/navigation/navigationAppendItems.vue +++ b/src/components/navigation/navigationAppendItems.vue @@ -2,54 +2,121 @@ import { useAccountStore } from "@/stores/account.store"; import { useBasketStore } from "@/stores/basket.store"; import { useExerciseStore } from "@/stores/exercise.store"; +import { ref, watch } from "vue"; const accountStore = useAccountStore(); const basketStore = useBasketStore(); const exerciseStore = useExerciseStore(); +const basketItems = ref(0); exerciseStore.getAllExercises(); + +watch( + () => basketStore.itemsInBasket, + () => { + basketItems.value = basketStore.itemsInBasket.reduce((tot, item) => { + return tot + item.seats.length; + }, 0); + } +); diff --git a/src/locales/de.json b/src/locales/de.json index 8475548..9b30a84 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -179,7 +179,8 @@ "selectConfigFile": "Konfigurations-Datei auswählen", "download": "Konfiguration exportieren", "upload": "Datei hochladen" - } + }, + "preferences": "Einstellungen" }, "help": { "scoreBoard": { @@ -280,7 +281,8 @@ "empty": { "headline": "So leer hier..." }, - "searchterm": "Suchbegriff" + "searchterm": "Suchbegriff", + "globalsearch": "Globale Suche" }, "submit": "Absenden", "content": "Inhalt", @@ -295,5 +297,8 @@ }, "genre": { "withoutBand": "ohne Band" + }, + "admin": { + "adminpanel": "Admin Panel" } } diff --git a/src/locales/en.json b/src/locales/en.json index 05daa3c..7a8e1c2 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -181,7 +181,8 @@ "selectConfigFile": "Select config file", "upload": "Upload file", "download": "Export config" - } + }, + "preferences": "Preferences" }, "help": { "scoreBoard": { @@ -280,7 +281,8 @@ "empty": { "headline": "So empty here..." }, - "searchterm": "Search term" + "searchterm": "Search term", + "globalsearch": "Global Search" }, "submit": "Submit", "content": "Content", @@ -295,5 +297,8 @@ }, "genre": { "withoutBand": "without Band" + }, + "admin": { + "adminpanel": "Admin Panel" } } diff --git a/src/pages/misc/homePage/index.vue b/src/pages/misc/homePage/index.vue index ef55a90..795be2e 100644 --- a/src/pages/misc/homePage/index.vue +++ b/src/pages/misc/homePage/index.vue @@ -1,24 +1,24 @@ @@ -33,7 +33,7 @@ if (preferencesStore.firstStartup) { - + @@ -42,4 +42,4 @@ if (preferencesStore.firstStartup) { - \ No newline at end of file +