diff --git a/software/backend/images/artists/alex-turner.jpg b/software/backend/images/artists/alex-turner.jpg new file mode 100644 index 0000000..6869e13 Binary files /dev/null and b/software/backend/images/artists/alex-turner.jpg differ diff --git a/software/backend/images/artists/andy-nicholson.jpg b/software/backend/images/artists/andy-nicholson.jpg new file mode 100644 index 0000000..052d411 Binary files /dev/null and b/software/backend/images/artists/andy-nicholson.jpg differ diff --git a/software/backend/images/artists/unknown-artist.jpg b/software/backend/images/artists/unknown-artist.jpg new file mode 100644 index 0000000..17ba455 Binary files /dev/null and b/software/backend/images/artists/unknown-artist.jpg differ diff --git a/software/backend/images/bands/red-hot-chili-peppers-2.jpg b/software/backend/images/bands/red-hot-chili-peppers-2.jpg new file mode 100644 index 0000000..1725e3a Binary files /dev/null and b/software/backend/images/bands/red-hot-chili-peppers-2.jpg differ diff --git a/software/backend/routes/band.routes.ts b/software/backend/routes/band.routes.ts index f8d8da0..87f99f4 100644 --- a/software/backend/routes/band.routes.ts +++ b/software/backend/routes/band.routes.ts @@ -3,13 +3,54 @@ import { Band } from "../models/acts/band.model"; import { Request, Response, Router } from "express"; import { Rating } from "../models/acts/rating.model"; import { Genre } from "../models/acts/genre.model"; +import { Tour } from "../models/acts/tour.model"; +import { Concert } from "../models/acts/concert.model"; +import { Location } from "../models/acts/location.model"; +import { City } from "../models/acts/city.model"; export const band = Router() // Get all bands band.get("/", (req: Request, res: Response) => { Band.findAll({ - include: [ Genre, Rating ] + include: [ + { + model: Member, + attributes: { + exclude: [ "id", "bandId" ] + } + }, + { + model: Rating, + attributes: { + exclude: [ "id", "bandId" ] + } + }, + { + model: Tour, + include: [ + { + model: Concert, + include: [ + { + model: Location, + include: [ City ], + attributes: { + exclude: [ "id" ] + } + } + ], + attributes: { + exclude: [ "id", "tourId", "locationId" ] + } + } + ], + attributes: { + exclude: [ "id", "bandId" ] + } + }, + Genre + ] }) .then(bands => { res.status(200).json(bands) diff --git a/software/src/components/cardWithLeftImage.vue b/software/src/components/cardWithLeftImage.vue index 833536e..57e2c21 100644 --- a/software/src/components/cardWithLeftImage.vue +++ b/software/src/components/cardWithLeftImage.vue @@ -1,21 +1,30 @@ - + - + {{ title }} @@ -25,7 +34,16 @@ defineProps({ - + + + + + diff --git a/software/src/components/cardWithTopImage.vue b/software/src/components/cardWithTopImage.vue index 29618dc..df0c43b 100644 --- a/software/src/components/cardWithTopImage.vue +++ b/software/src/components/cardWithTopImage.vue @@ -1,6 +1,10 @@ @@ -44,48 +45,6 @@ const concertStore = useConcertStore() - - - - - - - - - - - {{ concertStore.bands[i - 1].genres.name }} - - - - - - - - - - - - {{ $t('menu.allBands') }} - - - - - diff --git a/software/src/pages/shows/bandDetailPage/index.vue b/software/src/pages/shows/bandDetailPage/index.vue index 3daec83..5ff882e 100644 --- a/software/src/pages/shows/bandDetailPage/index.vue +++ b/software/src/pages/shows/bandDetailPage/index.vue @@ -1,6 +1,191 @@ - Tour Detail + + + + {{ band.name }} + {{ band.descriptionDe }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ concert.location.name }} + + + + {{ concert.location.address }} + + + + {{ concert.location.city.name }} + + + + + {{ concert.price.toFixed(2) }} € + + + + + Hinzufügen + + + + + + + + + + + + + + + + + + {{ calcRating(band.ratings).toFixed(1) }} + /5 + + + + + {{ band.ratings.length }} Bewertungen + + + + + + + + {{ ratingValue.value }} + + + + + + + {{ ratingValue.count }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/software/src/pages/shows/bandsPage/index.vue b/software/src/pages/shows/bandsPage/index.vue deleted file mode 100644 index 98e67a6..0000000 --- a/software/src/pages/shows/bandsPage/index.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/software/src/pages/shows/toursPage/index.vue b/software/src/pages/shows/toursPage/index.vue index 626a1f0..ec6a834 100644 --- a/software/src/pages/shows/toursPage/index.vue +++ b/software/src/pages/shows/toursPage/index.vue @@ -3,7 +3,9 @@ import cardWithLeftImage from '@/components/cardWithLeftImage.vue'; import { useConcertStore } from '@/data/stores/concertStore'; import { createDateRangeString, lowestTicketPrice } from '@/scripts/concertScripts'; import filterBar from './filterBar.vue'; +import { useRouter } from 'vue-router'; +const router = useRouter() const concertStore = useConcertStore() @@ -27,14 +29,13 @@ const concertStore = useConcertStore() {{ createDateRangeString(tour) }} {{ tour.concerts.length }} {{ $t('tours.concert', tour.concerts.length) }} - - ab {{ lowestTicketPrice(tour) }} € - + ab {{ lowestTicketPrice(tour) }} € diff --git a/software/src/router/show.routes.ts b/software/src/router/show.routes.ts index ac7e55d..ccd9b1d 100644 --- a/software/src/router/show.routes.ts +++ b/software/src/router/show.routes.ts @@ -1,11 +1,11 @@ import ToursPage from "@/pages/shows/toursPage/index.vue"; -import BandsPage from "@/pages/shows/bandsPage/index.vue"; import LocationsPage from "@/pages/shows/locationsPage/index.vue" import SearchPage from "@/pages/shows/searchPage/index.vue" +import BandDetailPage from "@/pages/shows/bandDetailPage/index.vue" export const showRoutes = [ { path: '/shows/tours', component: ToursPage }, - { path: '/shows/bands', component: BandsPage }, { path: '/shows/locations', component: LocationsPage }, { path: '/shows/search', component: SearchPage }, + { path: '/shows/band/:bandName', component: BandDetailPage } ] \ No newline at end of file diff --git a/software/src/scripts/concertScripts.ts b/software/src/scripts/concertScripts.ts index f3f0f81..ab33053 100644 --- a/software/src/scripts/concertScripts.ts +++ b/software/src/scripts/concertScripts.ts @@ -32,6 +32,22 @@ export function calcRating(ratings: Array) { return sum / ratings.length } +export function calcRatingValues(ratings: Array) { + let ratingValues = [ + { value: 1, count: 0 }, + { value: 2, count: 0 }, + { value: 3, count: 0 }, + { value: 4, count: 0 }, + { value: 5, count: 0 } + ] + + for (let rating of ratings) { + ratingValues[rating.rating - 1].count += 1 + } + + return ratingValues +} + export function createDateRangeString(tour: TourModel) { const dateArray = [] diff --git a/software/src/scripts/dateTimeScripts.ts b/software/src/scripts/dateTimeScripts.ts index 7c27c35..77f39ab 100644 --- a/software/src/scripts/dateTimeScripts.ts +++ b/software/src/scripts/dateTimeScripts.ts @@ -2,4 +2,8 @@ export function dateToHumanReadableString(date: Date) { return String(date.getDate()).padStart(2, '0') + '.' + String(date.getMonth() + 1).padStart(2, '0') + '.' + date.getFullYear() +} + +export function dateStringToHumanReadableString(string: string) { + return dateToHumanReadableString(new Date(string)) } \ No newline at end of file
{{ band.name }}
{{ band.descriptionDe }}