From 20b9a59257df3d005a2a2a4346c30eebb5d25db1 Mon Sep 17 00:00:00 2001 From: TobiZog Date: Thu, 14 Nov 2024 07:25:06 +0100 Subject: [PATCH] Improve UI for smaller screens --- software/backend/routes/exercise.routes.ts | 20 ++-- software/electron/index.ts | 2 + software/src/App.vue | 16 +--- software/src/components/basics/cardView.vue | 13 ++- .../src/components/basics/sectionDivider.vue | 20 +++- .../components/navigation/companyFooter.vue | 32 +++---- .../components/navigation/navigationBar.vue | 21 +++++ .../navigation/navigationPrependItems.vue | 51 ++++++++-- software/src/components/navigation/urlBar.vue | 25 +++-- .../src/components/pageParts/heroImage.vue | 2 +- .../models/exercises/exerciseGroupApiModel.ts | 6 -- .../data/models/exercises/exerciseModel.ts | 3 + software/src/locales/de.json | 2 +- software/src/locales/en.json | 2 +- .../bandDetailPage/bandMemberSection.vue | 4 +- .../bands/bandDetailPage/gallerySection.vue | 2 +- .../pages/locations/locationsPage/index.vue | 5 +- software/src/pages/misc/helpPage/index.vue | 64 ++++++++++--- .../src/pages/misc/helpPage/scoreCard.vue | 92 ------------------- .../misc/homePage/topLocationsSection.vue | 14 ++- .../misc/homePage/upcomingConcertsSection.vue | 10 +- software/src/pages/misc/searchPage/index.vue | 3 +- software/src/stores/exercise.store.ts | 6 +- 23 files changed, 224 insertions(+), 191 deletions(-) create mode 100644 software/src/components/navigation/navigationBar.vue delete mode 100644 software/src/data/models/exercises/exerciseGroupApiModel.ts delete mode 100644 software/src/pages/misc/helpPage/scoreCard.vue diff --git a/software/backend/routes/exercise.routes.ts b/software/backend/routes/exercise.routes.ts index f22da61..d12bd13 100644 --- a/software/backend/routes/exercise.routes.ts +++ b/software/backend/routes/exercise.routes.ts @@ -8,19 +8,13 @@ export const exercises = Router() * Get all Exercises grouped in ExerciseGroups */ exercises.get("/", (req: Request, res: Response) => { - ExerciseGroup.findAll( - { - include: [ - { - model: Exercise, - separate: true, - order: [ - [ 'id', 'ASC' ] - ] - } - ] - } - ).then(result => { + Exercise.findAll({ + include: [ ExerciseGroup ] + }).then(result => { + result.sort((a, b) => { + return (a.dataValues.exerciseGroup.dataValues.groupNr * 10 + a.dataValues.exerciseNr) > (b.dataValues.exerciseGroup.dataValues.groupNr * 10 + b.dataValues.exerciseNr) ? 1 : -1 + }) + res.status(200).json(result) }) }) diff --git a/software/electron/index.ts b/software/electron/index.ts index 7b1b23c..285ad50 100644 --- a/software/electron/index.ts +++ b/software/electron/index.ts @@ -9,6 +9,8 @@ function createWindow() { const win = new BrowserWindow({ width: 1400, height: 800, + minWidth: 800, + minHeigth: 600, webPreferences: { preload: path.join(__dirname, "preload.js"), }, diff --git a/software/src/App.vue b/software/src/App.vue index 9bb00f2..2611e43 100644 --- a/software/src/App.vue +++ b/software/src/App.vue @@ -9,6 +9,7 @@ import { useFeedbackStore } from './stores/feedback.store'; import companyFooter from './components/navigation/companyFooter.vue'; import urlBar from './components/navigation/urlBar.vue'; import { useRouter } from 'vue-router'; +import NavigationBar from './components/navigation/navigationBar.vue'; const preferencesStore = usePreferencesStore() const feedbackStore = useFeedbackStore() @@ -43,20 +44,7 @@ watch(() => feedbackStore.notFound, () => { - - - - - + diff --git a/software/src/components/basics/cardView.vue b/software/src/components/basics/cardView.vue index 7b2abb3..226373c 100644 --- a/software/src/components/basics/cardView.vue +++ b/software/src/components/basics/cardView.vue @@ -12,6 +12,10 @@ defineProps({ tonal: { type: Boolean, default: true + }, + color: { + type: String, + default: "primary" } }) @@ -20,15 +24,18 @@ defineProps({ - - + +
-
+
 {{ title }}
diff --git a/software/src/components/basics/sectionDivider.vue b/software/src/components/basics/sectionDivider.vue index 09f3aa4..9511928 100644 --- a/software/src/components/basics/sectionDivider.vue +++ b/software/src/components/basics/sectionDivider.vue @@ -7,7 +7,7 @@ defineProps({ \ No newline at end of file diff --git a/software/src/components/navigation/companyFooter.vue b/software/src/components/navigation/companyFooter.vue index b3bc29e..cc4f4eb 100644 --- a/software/src/components/navigation/companyFooter.vue +++ b/software/src/components/navigation/companyFooter.vue @@ -24,17 +24,17 @@ watch(() => route.path, () => { inset app > - - - - - - - + + + + + @@ -43,9 +43,11 @@ watch(() => route.path, () => { + - - Filter: + + +
@@ -55,14 +57,6 @@ watch(() => route.path, () => {
- - -
- - - - {{ new Date().getFullYear() }} — Tobias Zoghaib -
diff --git a/software/src/components/navigation/navigationBar.vue b/software/src/components/navigation/navigationBar.vue new file mode 100644 index 0000000..6084978 --- /dev/null +++ b/software/src/components/navigation/navigationBar.vue @@ -0,0 +1,21 @@ + + + \ No newline at end of file diff --git a/software/src/components/navigation/navigationPrependItems.vue b/software/src/components/navigation/navigationPrependItems.vue index 356631e..ee88d1f 100644 --- a/software/src/components/navigation/navigationPrependItems.vue +++ b/software/src/components/navigation/navigationPrependItems.vue @@ -1,7 +1,4 @@ \ No newline at end of file diff --git a/software/src/components/navigation/urlBar.vue b/software/src/components/navigation/urlBar.vue index 9dd02a7..e6e9150 100644 --- a/software/src/components/navigation/urlBar.vue +++ b/software/src/components/navigation/urlBar.vue @@ -19,9 +19,12 @@ watch(() => router.currentRoute.value.fullPath, () => { elevation="0" height="50" > - - - + + + router.currentRoute.value.fullPath, () => { icon="mdi-arrow-right" @click="router.go(1)" /> - + @@ -49,12 +48,20 @@ watch(() => router.currentRoute.value.fullPath, () => { /> - + + diff --git a/software/src/components/pageParts/heroImage.vue b/software/src/components/pageParts/heroImage.vue index 9fa9425..ba5bc5a 100644 --- a/software/src/components/pageParts/heroImage.vue +++ b/software/src/components/pageParts/heroImage.vue @@ -30,7 +30,7 @@ defineProps({
- + -} \ No newline at end of file diff --git a/software/src/data/models/exercises/exerciseModel.ts b/software/src/data/models/exercises/exerciseModel.ts index 11ce800..f65e2d9 100644 --- a/software/src/data/models/exercises/exerciseModel.ts +++ b/software/src/data/models/exercises/exerciseModel.ts @@ -1,3 +1,5 @@ +import { ExerciseGroupModel } from "./exerciseGroupModel" + export class ExerciseModel { id = -1 nameDe: string = "" @@ -6,4 +8,5 @@ export class ExerciseModel { descriptionDe: string = "" descriptionEn: string = "" solved: boolean = false + exerciseGroup: ExerciseGroupModel } \ No newline at end of file diff --git a/software/src/locales/de.json b/software/src/locales/de.json index dfdcc85..117f833 100644 --- a/software/src/locales/de.json +++ b/software/src/locales/de.json @@ -162,7 +162,7 @@ "help": { "scoreBoard": { "exerciseGroupNr": "Aufgabengruppe {0}: ", - "exerciseNr": "Aufgabe {0}" + "exerciseNr": "Aufgabe {0}.{1}: " } }, "bannerMessages": { diff --git a/software/src/locales/en.json b/software/src/locales/en.json index 292f5da..f166288 100644 --- a/software/src/locales/en.json +++ b/software/src/locales/en.json @@ -162,7 +162,7 @@ "help": { "scoreBoard": { "exerciseGroupNr": "Exercise Group {0}: ", - "exerciseNr": "Exercise {0}" + "exerciseNr": "Exercise {0}.{1}: " } }, "bannerMessages": { diff --git a/software/src/pages/bands/bandDetailPage/bandMemberSection.vue b/software/src/pages/bands/bandDetailPage/bandMemberSection.vue index 76a2c3b..5af4294 100644 --- a/software/src/pages/bands/bandDetailPage/bandMemberSection.vue +++ b/software/src/pages/bands/bandDetailPage/bandMemberSection.vue @@ -14,7 +14,7 @@ const bandStore = useBandStore() - + @@ -22,7 +22,7 @@ const bandStore = useBandStore() - +