diff --git a/src/app/models/game.ts b/src/app/models/game.ts index 10572eab..b4d05e86 100644 --- a/src/app/models/game.ts +++ b/src/app/models/game.ts @@ -1,47 +1,47 @@ -import { Timestamp } from 'firebase/firestore'; +import { Timestamp } from "firebase/firestore"; export interface Game { - id: string - externalId: string - date: string - time: string - dateTime: Timestamp - location: string - city: string - longitude: string - latitude: string - liga: string - - name: string - description: string - - teamName: string - teamId: string - - teamHomeId: string - teamHome: string - teamHomeLogo: string - teamHomeLogoText: string - - teamAwayId: string - teamAway: string - teamAwayLogo: string - teamAwayLogoText: string - - referee1: string - referee2: string - spectators: string - - resut: string - type: string - updated: Date - clubRef: any - teamRef: any + id: string; + externalId: string; + date: string; + time: string; + dateTime: Timestamp; + location: string; + city: string; + longitude: string; + latitude: string; + liga: string; + + name: string; + description: string; + + teamName: string; + teamId: string; + + teamHomeId: string; + teamHome: string; + teamHomeLogo: string; + teamHomeLogoText: string; + + teamAwayId: string; + teamAway: string; + teamAwayLogo: string; + teamAwayLogoText: string; + + referee1: string; + referee2: string; + spectators: string; + + result: string; + type: string; + updated: Date; + clubRef: any; + teamRef: any; // Business Logic Fields - status: boolean - countAttendees: number - attendees: any + status: boolean; + countAttendees: number; + attendees: any; } export interface SwissUnihockeyGame extends Game {} diff --git a/src/app/pages/championship/championship-detail/championship-detail.page.html b/src/app/pages/championship/championship-detail/championship-detail.page.html index 84a7d454..03fae65a 100644 --- a/src/app/pages/championship/championship-detail/championship-detail.page.html +++ b/src/app/pages/championship/championship-detail/championship-detail.page.html @@ -1,15 +1,20 @@ - + + + + + + {{"common.details" | translate}} @@ -48,6 +53,12 @@

{{game.date}} {{game.time}} Uhr

{{game.location}} {{game.city}}

+ @@ -56,6 +67,27 @@

{{game.location}} {{game.city}}

{{game.liga}} {{game.teamName}}

+ + + + +

{{game.result}}

+
+
+ + + + +

{{game.referee1}} {{game.referee2}}

+
+
+ + + + +

{{game.spectators}}

+
+
diff --git a/src/app/pages/championship/championship-detail/championship-detail.page.ts b/src/app/pages/championship/championship-detail/championship-detail.page.ts index 74238574..0ce602e4 100644 --- a/src/app/pages/championship/championship-detail/championship-detail.page.ts +++ b/src/app/pages/championship/championship-detail/championship-detail.page.ts @@ -14,7 +14,12 @@ import { } from "@ionic/angular"; import { Game } from "src/app/models/game"; import { GoogleMap } from "@capacitor/google-maps"; -import { Geolocation, PermissionStatus } from "@capacitor/geolocation"; +import { Browser } from "@capacitor/browser"; +import { + Geolocation, + PermissionStatus, + Position, +} from "@capacitor/geolocation"; import { ChampionshipService } from "src/app/services/firebase/championship.service"; import { forkJoin, lastValueFrom, Observable, of } from "rxjs"; import { AuthService } from "src/app/services/auth.service"; @@ -45,9 +50,7 @@ export class ChampionshipDetailPage implements OnInit { user$: Observable; user: User; - attendeeListTrue: any[] = []; - attendeeListFalse: any[] = []; - attendeeListUndefined: any[] = []; + coordinates: Position; constructor( private readonly modalCtrl: ModalController, @@ -72,28 +75,24 @@ export class ChampionshipDetailPage implements OnInit { console.log(params); this.game = JSON.parse(params.data); */ - this.game$ = of(this.game); - - this.attendeeListTrue = []; - this.attendeeListFalse = []; - this.attendeeListUndefined = []; + this.game$ = of(this.game); - this.game$ = this.getGame(this.game.teamId, this.game.id); - this.game$.subscribe({ - next: (data) => { - console.log("GAMES Data received"); - this.game = { - ...this.game, - ...data, - }; - this.cdr.detectChanges(); + this.game$ = this.getGame(this.game.teamId, this.game.id); + this.game$.subscribe({ + next: (data) => { + console.log("GAMES Data received"); + this.game = { + ...this.game, + ...data, + }; + this.cdr.detectChanges(); - this.setMap(); - }, - error: (err) => console.error("GAMES Error in subscription:", err), - complete: () => console.log("GAMES Observable completed"), - }); - // }); + this.setMap(); + }, + error: (err) => console.error("GAMES Error in subscription:", err), + complete: () => console.log("GAMES Observable completed"), + }); + // }); // let this.mapRef = @ViewChild('map') abc; } @@ -262,13 +261,16 @@ export class ChampionshipDetailPage implements OnInit { console.log("No Permission Request possible"); } try { - const coordinates = await Geolocation.getCurrentPosition(); - if (coordinates.coords.latitude && coordinates.coords.longitude) { + this.coordinates = await Geolocation.getCurrentPosition(); + if ( + this.coordinates.coords.latitude && + this.coordinates.coords.longitude + ) { this.newMap.addMarker({ title: "Meine Position", coordinate: { - lat: coordinates.coords.latitude, - lng: coordinates.coords.longitude, + lat: this.coordinates.coords.latitude, + lng: this.coordinates.coords.longitude, }, isFlat: true, snippet: "Meine Position", @@ -278,4 +280,28 @@ export class ChampionshipDetailPage implements OnInit { console.log("no coordinates on map"); } } + + openMaps(game: Game) { + if (this.coordinates.coords.longitude && this.coordinates.coords.latitude) { + Browser.open({ + url: + "https://www.google.com/maps/dir/?api=1&destination=" + + game.latitude + + "," + + game.longitude + + "&origin=" + + this.coordinates.coords.latitude + + "," + + this.coordinates.coords.longitude, + }); + } else { + Browser.open({ + url: + "https://www.google.com/maps/dir/?api=1&destination=" + + game.latitude + + "," + + game.longitude, + }); + } + } } diff --git a/src/app/pages/championship/championship/championship.page.html b/src/app/pages/championship/championship/championship.page.html index 19e09159..abc19c6b 100644 --- a/src/app/pages/championship/championship/championship.page.html +++ b/src/app/pages/championship/championship/championship.page.html @@ -6,7 +6,7 @@ {{"common.championship" | translate}} - + @@ -39,60 +39,6 @@ {{"common.championship" | translate}}
- - - - - - {{entry.details.title}} - - - - - - # - {{"common.name" | translate}} - Sp/S/N - T - P - - - - - - - - - {{ranking.ranking}} - - - - {{ranking.name}} - - {{ranking.name}} - - - {{ranking.games}}/{{ranking.wins}}/{{ranking.loss}} - - {{ranking.goals}} - {{ranking.points}} - - - - - - -

{{"championship.legend" | translate}}:

-
    -
  • Sp = {{"championship.games__total" | translate}}
  • -
  • S = {{"championship.victories" | translate}}
  • -
  • N = {{"championship.defeat" | translate}}
  • -
  • T = {{"championship.goal__record" | translate}}
  • -
  • P = {{"championship.points" | translate}}
  • -
-
-
- @@ -151,6 +97,11 @@

{{game.liga}} {{game.teamName}}

+ +

+ + {{game.result}} +

-->
- + {{"championship.upcomming__games" | translate}} - Keine Spiele gefunden + + Keine Spiele gefunden +
@@ -250,6 +203,10 @@

{{game.liga}} {{game.teamName}}

+

+ + {{game.result}} +

--> - + {{"championship.past__games" | translate}} - Keine Spiele gefunden + + Keine Spiele gefunden +
+ + + + +
+ + + {{entry.details.title}} + +
+ + + {{entry.details.title}} + + + + + # + {{"common.name" | translate}} + Sp/S/N + T + P + + + + + + + + + {{ranking.ranking}} + + + + {{ranking.name}} + + {{ranking.name}} + + + {{ranking.games}}/{{ranking.wins}}/{{ranking.loss}} + + {{ranking.goals}} + {{ranking.points}} + + + + +
+
+
+
+ + +
+
+ +

{{"championship.legend" | translate}}:

+
    +
  • Sp = {{"championship.games__total" | translate}}
  • +
  • S = {{"championship.victories" | translate}}
  • +
  • N = {{"championship.defeat" | translate}}
  • +
  • T = {{"championship.goal__record" | translate}}
  • +
  • P = {{"championship.points" | translate}}
  • +
+
+
+
+ diff --git a/src/app/pages/championship/championship/championship.page.ts b/src/app/pages/championship/championship/championship.page.ts index 7d3acbed..ceb974b0 100644 --- a/src/app/pages/championship/championship/championship.page.ts +++ b/src/app/pages/championship/championship/championship.page.ts @@ -1,5 +1,5 @@ import { ChangeDetectorRef, Component, OnInit } from "@angular/core"; -import { Preferences, GetResult } from '@capacitor/preferences'; +import { Preferences, GetResult } from "@capacitor/preferences"; import { AlertController, IonItemSliding, @@ -45,24 +45,24 @@ export class ChampionshipPage implements OnInit { gameList$: Observable; gameListPast$: Observable; + teamRankings$: Observable; - gameListBackup$: Observable; + /*gameListBackup$: Observable; gameListPastBackup$: Observable; + teamRankingsBackup$: Observable; gameListBackup: Subscription; gameListPastBackup: Subscription; - + */ mode = "games"; teamList$: Observable; - filterList: any[] = []; + /*filterList: any[] = []; filterValue: string = ""; - - teamRankings$: Observable; - teamRankingsBackup$: Observable; + */ constructor( public toastController: ToastController, @@ -78,13 +78,14 @@ export class ChampionshipPage implements OnInit { private translate: TranslateService ) { this.menuCtrl.enable(true, "menu"); - } ngOnInit() { this.teamRankings$ = this.getTeamsWithRankingsForYear("2023"); - - this.teamRankingsBackup$ = this.getTeamsWithRankingsForYear("2023"); + this.gameList$ = this.getTeamGamesUpcoming(); + this.gameListPast$ = this.getTeamGamesPast(); + + /*this.teamRankingsBackup$ = this.getTeamsWithRankingsForYear("2023"); this.teamRankingsBackup$.subscribe({ next: () => { console.log("RANKING Backup Data received"); @@ -94,7 +95,6 @@ export class ChampionshipPage implements OnInit { complete: () => console.log("RANKING Backup Observable completed"), }); - this.gameList$ = this.getTeamGamesUpcoming(); this.gameListBackup$ = this.getTeamGamesUpcoming(); this.gameListBackup$.subscribe({ @@ -104,11 +104,9 @@ export class ChampionshipPage implements OnInit { }, error: (err) => console.error("GAMES Error in subscription:", err), complete: () => console.log("GAMES Observable completed"), - }); + });*/ - this.gameListPast$ = this.getTeamGamesPast(); - - this.gameListPastBackup$ = this.getTeamGamesPast(); + /*this.gameListPastBackup$ = this.getTeamGamesPast(); this.gameListPastBackup$.subscribe({ next: () => { console.log("GAMES PAST Data received"); @@ -116,19 +114,19 @@ export class ChampionshipPage implements OnInit { }, error: (err) => console.error("GAMES PAST Error in subscription:", err), complete: () => console.log("GAMES PAST Observable completed"), - }); + });*/ // Filter - this.teamList$ = this.fbService.getTeamList(); + /* this.teamList$ = this.fbService.getTeamList(); this.teamList$.subscribe({ next: (data) => { - this.filterList = data; + // this.filterList = data; console.log("Team Data received"); this.cdr.detectChanges(); }, error: (err) => console.error("Team Error in subscription:", err), complete: () => console.log("Team Observable completed"), - }); + });*/ } ngOnDestroy(): void { @@ -167,8 +165,8 @@ export class ChampionshipPage implements OnInit { map(({ teamDetails, rankingsTable, rankingDetails }) => ({ ...teamDetails, teamId: teamDetails.id, - rankings: rankingsTable.sort((a,b)=>{ - return a.ranking as number - b.ranking as number; + rankings: rankingsTable.sort((a, b) => { + return ((a.ranking as number) - b.ranking) as number; }), details: rankingDetails, })), @@ -342,7 +340,6 @@ export class ChampionshipPage implements OnInit { } async openChampionshipDetailModal(game: Game, isFuture: boolean) { - /*let extras: NavigationExtras = { queryParams: { data: JSON.stringify(game), @@ -414,8 +411,7 @@ export class ChampionshipPage implements OnInit { toast.present(); } - - async openFilter(ev: Event) { + /* async openFilter(ev: Event) { const alertInputs = []; for (const item of this.filterList) { @@ -476,5 +472,5 @@ export class ChampionshipPage implements OnInit { htmlAttributes: { 'aria-label': 'alert dialog' }, }); alert.present(); - } + }*/ } diff --git a/src/app/pages/event/event-detail/event-detail.page.html b/src/app/pages/event/event-detail/event-detail.page.html index af3ec128..48dd6100 100644 --- a/src/app/pages/event/event-detail/event-detail.page.html +++ b/src/app/pages/event/event-detail/event-detail.page.html @@ -3,7 +3,9 @@ - {{"common.close" | translate}} + {{"common.close" | translate}} @@ -37,13 +39,6 @@

{{event.streetAndNumber}} {{event.city}}

- - - -

{{event.liga}} {{event.teamName}}

-
-
- diff --git a/src/app/pages/event/event-detail/event-detail.page.ts b/src/app/pages/event/event-detail/event-detail.page.ts index e360295d..7e9ba9f5 100644 --- a/src/app/pages/event/event-detail/event-detail.page.ts +++ b/src/app/pages/event/event-detail/event-detail.page.ts @@ -35,10 +35,6 @@ export class EventDetailPage implements OnInit { user$: Observable; user: User; - attendeeListTrue: any[] = []; - attendeeListFalse: any[] = []; - attendeeListUndefined: any[] = []; - constructor( private readonly modalCtrl: ModalController, public navParams: NavParams, @@ -46,18 +42,12 @@ export class EventDetailPage implements OnInit { private readonly eventService: EventService, private readonly toastController: ToastController, private readonly authService: AuthService, - private cdr: ChangeDetectorRef, private translate: TranslateService ) {} ngOnInit() { this.event = this.navParams.get("data"); this.event$ = of(this.event); - - this.attendeeListTrue = []; - this.attendeeListFalse = []; - this.attendeeListUndefined = []; - this.event$ = this.getEvent(this.event.clubId, this.event.id); } @@ -129,7 +119,6 @@ export class EventDetailPage implements OnInit { `Set Status ${status} for user ${this.user.uid} and club ${this.event.clubId} and event ${event.id}` ); await this.eventService.setClubEventAttendeeStatus( - status, this.event.clubId, event.id diff --git a/src/app/pages/event/events/events.page.html b/src/app/pages/event/events/events.page.html index b82e9fb7..cdb7426e 100644 --- a/src/app/pages/event/events/events.page.html +++ b/src/app/pages/event/events/events.page.html @@ -97,21 +97,26 @@

- - - - - - - - + + + + + + + + + + + - + {{"events.upcomming__events" | translate}} - {{"common.no_event__found" | translate}} + + {{"common.no_event__found" | translate}} + @@ -168,18 +173,26 @@

- - - - - + + + + + + + + + + + - + {{"events.past__events" | translate}} - {{"common.no_event__found" | translate}} + + {{"common.no_event__found" | translate}} + diff --git a/src/app/pages/event/events/events.page.ts b/src/app/pages/event/events/events.page.ts index bf5fd465..e33f0f1a 100644 --- a/src/app/pages/event/events/events.page.ts +++ b/src/app/pages/event/events/events.page.ts @@ -1,4 +1,4 @@ -import { ChangeDetectorRef, Component, OnInit } from "@angular/core"; +import { Component, OnInit } from "@angular/core"; import { IonItemSliding, IonRouterOutlet, @@ -44,9 +44,6 @@ export class EventsPage implements OnInit { clubAdminList$: Observable; - filterList: any[] = []; - filterValue: string = ""; - constructor( public toastController: ToastController, private readonly routerOutlet: IonRouterOutlet, @@ -55,7 +52,6 @@ export class EventsPage implements OnInit { private readonly fbService: FirebaseService, private readonly eventService: EventService, private readonly menuCtrl: MenuController, - private cdr: ChangeDetectorRef, private translate: TranslateService ) { this.menuCtrl.enable(true, "menu"); @@ -67,7 +63,6 @@ export class EventsPage implements OnInit { //Create Events, Helfer, News this.clubAdminList$ = this.fbService.getClubAdminList(); - } getClubEvent() { return this.authService.getUser$().pipe( @@ -122,23 +117,23 @@ export class EventsPage implements OnInit { ) ); }), - map((gamesWithAttendees) => gamesWithAttendees), // Flatten games array for each team - catchError(() => of([])) // If error in fetching games, return empty array + map((eventsWithAttendees) => eventsWithAttendees), // Flatten events array for each team + catchError(() => of([])) // If error in fetching events, return empty array ) ) ).pipe( - map((teamsGames) => teamsGames.flat()), // Flatten to get all games across all teams + map((teamsevents) => teamsevents.flat()), // Flatten to get all events across all teams map( - (allGames) => - allGames.sort( + (allevents) => + allevents.sort( (a, b) => Timestamp.fromMillis(a.dateTime).seconds - Timestamp.fromMillis(b.dateTime).seconds - ) // Sort games by date + ) // Sort events by date ) ); }), - tap((results) => console.log("Final results with all games:", results)), + tap((results) => console.log("Final results with all events:", results)), catchError((err) => { console.error("Error in getClubEvent:", err); return of([]); // Return an empty array on error @@ -162,10 +157,10 @@ export class EventsPage implements OnInit { return combineLatest( teams.map((team) => this.eventService.getClubEventsPastRef(team.id).pipe( - switchMap((teamGames) => { - if (teamGames.length === 0) return of([]); + switchMap((teamevents) => { + if (teamevents.length === 0) return of([]); return combineLatest( - teamGames.map((game) => + teamevents.map((game) => this.eventService .getClubEventAttendeesRef(team.id, game.id) .pipe( @@ -199,23 +194,23 @@ export class EventsPage implements OnInit { ) ); }), - map((gamesWithAttendees) => gamesWithAttendees), // Flatten games array for each team - catchError(() => of([])) // If error in fetching games, return empty array + map((eventsWithAttendees) => eventsWithAttendees), // Flatten events array for each team + catchError(() => of([])) // If error in fetching events, return empty array ) ) ).pipe( - map((teamsGames) => teamsGames.flat()), // Flatten to get all games across all teams + map((teamsevents) => teamsevents.flat()), // Flatten to get all events across all teams map( - (allGames) => - allGames.sort( + (allevents) => + allevents.sort( (a, b) => Timestamp.fromMillis(a.dateTime).seconds - Timestamp.fromMillis(b.dateTime).seconds - ) // Sort games by date + ) // Sort events by date ) ); }), - tap((results) => console.log("Final results with all games:", results)), + tap((results) => console.log("Final results with all events:", results)), catchError((err) => { console.error("Error in getClubEventPast:", err); return of([]); // Return an empty array on error @@ -228,7 +223,6 @@ export class EventsPage implements OnInit { ); await this.eventService.setClubEventAttendeeStatus( - status, event.clubId, event.id @@ -247,7 +241,6 @@ export class EventsPage implements OnInit { `Set Status ${status} for user ${this.user.uid} and club ${event.clubId} and event ${event.id}` ); await this.eventService.setClubEventAttendeeStatus( - status, event.clubId, event.id diff --git a/src/app/pages/helfer/helfer/helfer.page.html b/src/app/pages/helfer/helfer/helfer.page.html index d5750845..74224025 100644 --- a/src/app/pages/helfer/helfer/helfer.page.html +++ b/src/app/pages/helfer/helfer/helfer.page.html @@ -94,22 +94,27 @@

- - - - - - - - + + + + + + + + + + + - + {{"helfer.upcomming__helper_event" | translate}} - {{"common.no_event__found" | translate}} + + {{"common.no_event__found" | translate}} + @@ -165,18 +170,26 @@

{{event.countAttendees}} - - - - - + + + + + + + + + + + {{"helfer.past__helper_events" | translate}} - {{"common.no_event__found" | translate}} + + {{"common.no_event__found" | translate}} + diff --git a/src/app/pages/helfer/helfer/helfer.page.ts b/src/app/pages/helfer/helfer/helfer.page.ts index da2fbbae..d84e91da 100644 --- a/src/app/pages/helfer/helfer/helfer.page.ts +++ b/src/app/pages/helfer/helfer/helfer.page.ts @@ -112,10 +112,10 @@ export class HelferPage implements OnInit { return combineLatest( teams.map((team) => this.eventService.getClubHelferEventRefs(team.id).pipe( - switchMap((teamGames) => { - if (teamGames.length === 0) return of([]); + switchMap((teamevents) => { + if (teamevents.length === 0) return of([]); return combineLatest( - teamGames.map((game) => + teamevents.map((game) => this.eventService .getClubHelferEventAttendeesRef(team.id, game.id) .pipe( @@ -149,25 +149,25 @@ export class HelferPage implements OnInit { ) ); }), - map((gamesWithAttendees) => gamesWithAttendees), // Flatten games array for each team - catchError(() => of([])) // If error in fetching games, return empty array + map((eventsWithAttendees) => eventsWithAttendees), // Flatten events array for each team + catchError(() => of([])) // If error in fetching events, return empty array ) ) ).pipe( - map((teamsGames) => teamsGames.flat()), // Flatten to get all games across all teams + map((teamsevents) => teamsevents.flat()), // Flatten to get all events across all teams map( - (allGames) => - allGames.sort( + (allevents) => + allevents.sort( (a, b) => Timestamp.fromMillis(a.dateTime).seconds - Timestamp.fromMillis(b.dateTime).seconds - ) // Sort games by date + ) // Sort events by date ) ); }), - tap((results) => console.log("Final results with all games:", results)), + tap((results) => console.log("Final results with all events:", results)), catchError((err) => { - console.error("Error in getTeamGamesUpcoming:", err); + console.error("Error in getTeameventsUpcoming:", err); return of([]); // Return an empty array on error }) ); @@ -189,10 +189,10 @@ export class HelferPage implements OnInit { return combineLatest( teams.map((team) => this.eventService.getClubHelferEventPastRefs(team.id).pipe( - switchMap((teamGames) => { - if (teamGames.length === 0) return of([]); + switchMap((teamevents) => { + if (teamevents.length === 0) return of([]); return combineLatest( - teamGames.map((game) => + teamevents.map((game) => this.eventService .getClubHelferEventAttendeesRef(team.id, game.id) .pipe( @@ -226,25 +226,25 @@ export class HelferPage implements OnInit { ) ); }), - map((gamesWithAttendees) => gamesWithAttendees), // Flatten games array for each team - catchError(() => of([])) // If error in fetching games, return empty array + map((eventsWithAttendees) => eventsWithAttendees), // Flatten events array for each team + catchError(() => of([])) // If error in fetching events, return empty array ) ) ).pipe( - map((teamsGames) => teamsGames.flat()), // Flatten to get all games across all teams + map((teamsevents) => teamsevents.flat()), // Flatten to get all events across all teams map( - (allGames) => - allGames.sort( + (allevents) => + allevents.sort( (a, b) => Timestamp.fromMillis(a.dateTime).seconds - Timestamp.fromMillis(b.dateTime).seconds - ) // Sort games by date + ) // Sort events by date ) ); }), - tap((results) => console.log("Final results with all games:", results)), + tap((results) => console.log("Final results with all events:", results)), catchError((err) => { - console.error("Error in getTeamGamesUpcoming:", err); + console.error("Error in getTeameventsUpcoming:", err); return of([]); // Return an empty array on error }) ); @@ -254,7 +254,6 @@ export class HelferPage implements OnInit { `Set Status ${status} for user ${this.user.uid} and team ${event.clubId} and training ${event.id}` ); await this.eventService.setClubHelferEventAttendeeStatus( - status, event.clubId, event.id @@ -273,7 +272,6 @@ export class HelferPage implements OnInit { `Set Status ${status} for user ${this.user.uid} and team ${event.clubId} and training ${event.id}` ); await this.eventService.setClubHelferEventAttendeeStatus( - status, event.clubId, event.id diff --git a/src/app/pages/profile/profile.page.html b/src/app/pages/profile/profile.page.html index 32db3963..92d2f181 100644 --- a/src/app/pages/profile/profile.page.html +++ b/src/app/pages/profile/profile.page.html @@ -22,7 +22,10 @@ - {{userProfile.firstName}} + {{userProfile.firstName}} @@ -31,16 +34,26 @@ - + - + @@ -52,82 +65,113 @@ --> - {{"profile.birthdate" | translate}}: - + + {{"profile.birthdate" | translate}}: + + - + - - - - {{"common.language__german" | translate}} - {{"common.language__french" | translate}} - {{"common.language__italian" | translate}} - {{"common.language__english" | translate}} + + {{"common.language__german" | translate}} + {{"common.language__french" | translate}} + {{"common.language__italian" | translate}} + {{"common.language__english" | translate}} - - - {{ "profile.contact__information" | translate}} - + {{ "profile.contact__information" | translate}} - + - + - - - + - + value="{{userProfile.streetAndNumber}}, {{userProfile.postalcode}} {{userProfile.city}}" + > - - {{ "profile.sport" | translate}} - + {{ "profile.sport" | translate}} - + (ionChange)="profileChange($event, 'licenseNumber')" + [(ngModel)]="userProfile.licenseNumber" + value="{{userProfile.licenseNumber}}" + > - - - - - + --> - - - {{"profile.push__message" | translate}} - + + {{"profile.push__message" | translate}}
- - - - + + + + {{"profile.push__message__aktivate" | translate}} - - - - {{"common.news" | translate}} - + + + {{"common.news" | translate}} - + - - - - {{"common.training" | translate}} - + + + {{"common.training" | translate}} - + - - - - {{"common.championship" | translate}} - + + + {{"common.championship" | translate}} - - - - {{"common.events" | translate}} - + + + {{"common.events" | translate}} - - - - {{"common.helper" | translate}} - + + + {{"common.helper" | translate}}
- - - {{"profile.email__messages" | translate}} - + + {{"profile.email__messages" | translate}}
- - - - - - {{"profile.email__messages" | translate}} - + + + + + {{"profile.email__messages" | translate}} - + {{"profile.email__messages_report" | translate}}
-
-
- - - - @@ -23,14 +23,15 @@ {{"common.training" | translate}} - - {{"training.upcomming__training_courses" | translate}} + {{"training.upcomming__training_courses" | translate}} @@ -42,12 +43,30 @@ - - - + + +

{{training.name}}

@@ -72,21 +91,33 @@

- + - + - + - + @@ -97,11 +128,15 @@

{{"training.upcomming__training" | translate}} - {{"training.no_training__found" | translate}} + + {{"training.no_training__found" | translate}} + - + {{"training.past__training" | translate}} @@ -116,12 +151,27 @@

- - - + + +

{{training.name}}

@@ -139,13 +189,19 @@

{{training.liga}} {{training.teamName}}

- + {{training.countAttendees}}
- + @@ -161,7 +217,12 @@

- + @@ -173,27 +234,54 @@

- + - + - + - - - - - + + + + + - \ No newline at end of file + diff --git a/src/app/pages/training/trainings/trainings.page.ts b/src/app/pages/training/trainings/trainings.page.ts index 584cd645..b696acc3 100644 --- a/src/app/pages/training/trainings/trainings.page.ts +++ b/src/app/pages/training/trainings/trainings.page.ts @@ -39,24 +39,24 @@ import { FilterService } from "src/app/services/filter.service"; }) export class TrainingsPage implements OnInit { skeleton = new Array(12); + user: User; user$: Observable; trainingList$: Observable; trainingListPast$: Observable; - trainingListBackup$: Observable; - trainingListPastBackup$: Observable; - - trainingListBackupSub: Subscription; - trainingListPastBackupSub: Subscription; - - teamList$: Observable; teamAdminList$: Observable; - filterList: any[] = []; - filterValue: string = ""; - private teamFilterSubscription: Subscription; + // teamList$: Observable; + // filterList: any[] = []; + // filterValue: string = ""; + // private teamFilterSubscription: Subscription; + // trainingListBackup$: Observable; + // trainingListPastBackup$: Observable; + + // trainingListBackupSub: Subscription; + // trainingListPastBackupSub: Subscription; constructor( public toastController: ToastController, @@ -75,9 +75,13 @@ export class TrainingsPage implements OnInit { } ngOnInit() { + // DATA this.trainingList$ = this.getTeamTraining(); + this.trainingListPast$ = this.getTeamTrainingPast(); + // CREATE + this.teamAdminList$ = this.fbService.getTeamAdminList(); - this.trainingListBackup$ = this.getTeamTraining(); + /*this.trainingListBackup$ = this.getTeamTraining(); this.trainingListBackupSub = this.trainingListBackup$.subscribe({ next: () => { console.log("Training Backup Data received"); @@ -88,7 +92,6 @@ export class TrainingsPage implements OnInit { complete: () => console.log("Training Observable completed"), }); - this.trainingListPast$ = this.getTeamTrainingPast(); this.trainingListPastBackup$ = this.getTeamTrainingPast(); this.trainingListPastBackup$.subscribe({ @@ -100,11 +103,10 @@ export class TrainingsPage implements OnInit { console.error("Training PAST Backup Error in subscription:", err), complete: () => console.log("Training PAST Backup Observable completed"), }); - //Create Events, Helfer, News - this.teamAdminList$ = this.fbService.getTeamAdminList(); - + */ // Filterlist + /* this.teamList$ = this.fbService.getTeamList(); this.teamList$.subscribe({ next: (data) => { @@ -122,11 +124,11 @@ export class TrainingsPage implements OnInit { console.log("Set new filter value: " + newTeamFilterValue); this.filterValue = newTeamFilterValue; } - ); + );*/ } ngOnDestroy(): void { - if (this.trainingListPastBackupSub){ + /*if (this.trainingListPastBackupSub){ this.trainingListPastBackupSub.unsubscribe(); } if (this.trainingListBackupSub){ @@ -136,7 +138,7 @@ export class TrainingsPage implements OnInit { // Unsubscribe to prevent memory leaks if (this.teamFilterSubscription) { this.teamFilterSubscription.unsubscribe(); - } + }*/ } getTeamTraining() { @@ -409,7 +411,7 @@ export class TrainingsPage implements OnInit { toast.present(); } - async openFilter(ev: Event) { + /* async openFilter(ev: Event) { const alertInputs = []; for (const item of this.filterList) { alertInputs.push({ @@ -462,5 +464,5 @@ export class TrainingsPage implements OnInit { htmlAttributes: { "aria-label": "alert dialog" }, }); alert.present(); - } + }*/ } diff --git a/src/app/services/firebase/news.service.ts b/src/app/services/firebase/news.service.ts index 2616edec..b635bd77 100644 --- a/src/app/services/firebase/news.service.ts +++ b/src/app/services/firebase/news.service.ts @@ -15,7 +15,7 @@ import { News } from "src/app/models/news"; providedIn: "root", }) export class NewsService { - twentyDaysAgo = new Date(Date.now() - 1000 * 3600 * 24 * 365); + twentyDaysAgo = new Date(Date.now() - 1000 * 3600 * 24 * 30); constructor(private firestore: Firestore = inject(Firestore)) {}