From 1d4daac9aea83af3dd7af38fc750ae4743f29530 Mon Sep 17 00:00:00 2001 From: Tobias Zoghaib Date: Fri, 11 Oct 2024 18:59:19 +0200 Subject: [PATCH] Finish search page --- software/backend/routes/band.routes.ts | 13 +- software/backend/routes/location.routes.ts | 3 +- .../src/components/pageParts/bandListItem.vue | 68 +++++++ software/src/locales/de.json | 4 +- software/src/locales/en.json | 4 +- software/src/pages/searchPage/index.vue | 168 ++++++++++++------ software/src/pages/searchPage/searchBar.vue | 1 + software/src/scripts/concertScripts.ts | 20 +++ 8 files changed, 227 insertions(+), 54 deletions(-) create mode 100644 software/src/components/pageParts/bandListItem.vue diff --git a/software/backend/routes/band.routes.ts b/software/backend/routes/band.routes.ts index 8632cbc..04fc8d1 100644 --- a/software/backend/routes/band.routes.ts +++ b/software/backend/routes/band.routes.ts @@ -118,8 +118,19 @@ band.get("/search", (req: Request, res: Response) => { where: { name: { [Op.substring]: req.query.value + }, + }, + include: [ + { + model: Event, + include: [ + Concert + ] + }, + { + model: Genre } - } + ] }) .then(bands => { res.status(200).json(bands) diff --git a/software/backend/routes/location.routes.ts b/software/backend/routes/location.routes.ts index 209c787..33c10eb 100644 --- a/software/backend/routes/location.routes.ts +++ b/software/backend/routes/location.routes.ts @@ -116,7 +116,8 @@ location.get("/search", (req: Request, res: Response) => { name: { [Op.substring]: req.query.value } - } + }, + include: [ Concert ] }) .then(locations => { res.status(200).json(locations) diff --git a/software/src/components/pageParts/bandListItem.vue b/software/src/components/pageParts/bandListItem.vue new file mode 100644 index 0000000..8852127 --- /dev/null +++ b/software/src/components/pageParts/bandListItem.vue @@ -0,0 +1,68 @@ + + + \ No newline at end of file diff --git a/software/src/locales/de.json b/software/src/locales/de.json index 8c1cd72..5f820ef 100644 --- a/software/src/locales/de.json +++ b/software/src/locales/de.json @@ -171,5 +171,7 @@ }, "goToTheConcert": "Zum Konzert", "selectedConcert": "Ausgewähltes Konzert", - "enterSomeKeywords": "Füge Schlagworte ein um nach Bands, Events, Konzerten und Veranstaltungsorten zu suchen" + "enterSomeKeywords": "Füge Schlagworte ein um nach Bands, Events, Konzerten und Veranstaltungsorten zu suchen", + "noBandFound": "Keine Band gefunden", + "noLocationsFound": "Keine Veranstaltungsorte gefunden" } diff --git a/software/src/locales/en.json b/software/src/locales/en.json index b8feb18..284b3d4 100644 --- a/software/src/locales/en.json +++ b/software/src/locales/en.json @@ -171,5 +171,7 @@ }, "goToTheConcert": "To the concert", "selectedConcert": "Selected Concert", - "enterSomeKeywords": "Enter keywords to search for bands, events, concerts and locations" + "enterSomeKeywords": "Enter keywords to search for bands, events, concerts and locations", + "noBandFound": "No band found", + "noLocationsFound": "No location found" } diff --git a/software/src/pages/searchPage/index.vue b/software/src/pages/searchPage/index.vue index 90adbae..588399f 100644 --- a/software/src/pages/searchPage/index.vue +++ b/software/src/pages/searchPage/index.vue @@ -2,6 +2,10 @@ import searchBar from './searchBar.vue'; import eventListItem from '@/components/pageParts/eventListItem.vue'; import sectionDivider from '@/components/basics/sectionDivider.vue'; +import cardViewHorizontal from '@/components/basics/cardViewHorizontal.vue'; +import locationListItem from '@/components/pageParts/locationListItem.vue'; +import cardViewTopImage from '@/components/basics/cardViewTopImage.vue'; +import bandListItem from '@/components/pageParts/bandListItem.vue'; import { useSearchStore } from '@/data/stores/searchStore'; const searchStore = useSearchStore() @@ -19,62 +23,126 @@ const searchStore = useSearchStore() - - - {{ searchStore.bands }} - - +
+ + + + + - - - {{ searchStore.locations }} - - + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + - - - Loading... - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - - diff --git a/software/src/pages/searchPage/searchBar.vue b/software/src/pages/searchPage/searchBar.vue index 840fba6..b4ffc32 100644 --- a/software/src/pages/searchPage/searchBar.vue +++ b/software/src/pages/searchPage/searchBar.vue @@ -12,6 +12,7 @@ const searchStore = useSearchStore() hide-details v-model="searchStore.searchTerm" :placeholder="$t('enterSomeKeywords')" + @keyup.enter="searchStore.startSearch" >