From 5c846a6351a77b180e41f606ae893249485405a1 Mon Sep 17 00:00:00 2001 From: Michel ten Voorde Date: Thu, 11 Sep 2025 23:43:28 +0200 Subject: [PATCH] Invallers --- .../substitute-selection.component.html | 42 +++-- .../substitute-selection.component.ts | 10 +- .../tournament-manage.component.html | 10 +- .../tournament-players.component.html | 169 +++++++++++------- .../tournament-players.component.ts | 8 +- src/app/model/tournamentPlayer.ts | 7 + 6 files changed, 146 insertions(+), 100 deletions(-) diff --git a/src/app/components/substitute-selection/substitute-selection.component.html b/src/app/components/substitute-selection/substitute-selection.component.html index c103a6d..7286a6e 100644 --- a/src/app/components/substitute-selection/substitute-selection.component.html +++ b/src/app/components/substitute-selection/substitute-selection.component.html @@ -1,23 +1,29 @@ +

Kies een invaller voor {{ data.player.name }}:

-

Kies een invaller voor {{ data.player.name }}:

- -
- - Invaller - - Geen - @for (player of data.availablePlayers; track player.playerId) { - - {{ player.name }} - - } - - -
+ @for (substitution of data.player.substitutions; track $index) { +
+
+
{{ Event.getType(substitution.event) }}
+
+
+ + Invaller + + Geen + @for (player of data.availablePlayers; track player.playerId) { + + {{ player.name }} + + } + + +
+
+ }
- @if (substitute) { - - } + + + diff --git a/src/app/components/substitute-selection/substitute-selection.component.ts b/src/app/components/substitute-selection/substitute-selection.component.ts index 47a2f7b..afec578 100644 --- a/src/app/components/substitute-selection/substitute-selection.component.ts +++ b/src/app/components/substitute-selection/substitute-selection.component.ts @@ -5,33 +5,35 @@ import { MatDialogActions, MatDialogClose, MatDialogContent, - MatDialogRef + MatDialogRef, MatDialogTitle } from "@angular/material/dialog"; import {MatFormField} from "@angular/material/form-field"; import {MatLabel} from "@angular/material/form-field"; import {MatOption, MatSelect} from "@angular/material/select"; import {TournamentPlayer} from "../../model/tournamentPlayer"; import {FormsModule} from "@angular/forms"; +import {Event} from "../../model/event"; @Component({ selector: 'app-substitute-selection', imports: [ MatButton, MatDialogActions, + MatDialogTitle, MatDialogContent, MatFormField, MatLabel, MatOption, MatSelect, FormsModule, - MatDialogClose + MatDialogClose, ], templateUrl: './substitute-selection.component.html', styleUrl: './substitute-selection.component.scss' }) export class SubstituteSelectionComponent { - substitute: TournamentPlayer; + substitute: TournamentPlayer[]; readonly dialogRef = inject(MatDialogRef); @@ -43,4 +45,6 @@ export class SubstituteSelectionComponent { onAnnulerenClick() { this.dialogRef.close(); } + + protected readonly Event = Event; } diff --git a/src/app/components/tournament-manage/tournament-manage.component.html b/src/app/components/tournament-manage/tournament-manage.component.html index d49f09a..a920b8e 100644 --- a/src/app/components/tournament-manage/tournament-manage.component.html +++ b/src/app/components/tournament-manage/tournament-manage.component.html @@ -445,15 +445,7 @@ settings  Beheer - - - - group -  Spelerslijst - - - - + } diff --git a/src/app/components/tournament-players/tournament-players.component.html b/src/app/components/tournament-players/tournament-players.component.html index 78b2c47..6f09af8 100644 --- a/src/app/components/tournament-players/tournament-players.component.html +++ b/src/app/components/tournament-players/tournament-players.component.html @@ -1,73 +1,106 @@ @if (tournament) { - - - - - @if (tournament.status == 'ONGOING') { - - } - - - - @if (tournament.status == 'ONGOING') { - - - } - - - - @for (tournamentPlayer of tournament.tournamentPlayers; track tournamentPlayer.playerId) { - - - @if (tournament.status == 'ONGOING') { - - } - - - - @if (tournament.status == 'ONGOING') { - - +
NaamWedstrijden geteldOnderdelenKostenBetaaldAanwezig
{{ tournamentPlayer.name }}{{ tournamentPlayer.counts }} - @for (event of tournamentPlayer.events; track event) { - {{ event }}  - } - - {{ tournament.costsPerEvent[tournamentPlayer.events.length - 1] | currency:'EUR':'symbol':'1.2-2':'nl' }} - - - @if (tournamentPlayer.paid) { - Betaald - } @else { - Nog niet betaald - } - - - - @if (tournamentPlayer.present) { - Aanwezig - } @else { - Nog niet aanwezig - } - - - - - - - + + + + euro +  Administratie + -
+ + + + + + + @if (tournament.status == 'ONGOING') { + } - } - -
NaamOnderdelenKostenBetaaldAanwezig
+ + + @for (tournamentPlayer of tournament.tournamentPlayers; track tournamentPlayer.playerId) { + + {{ tournamentPlayer.name }} + + @for (event of tournamentPlayer.events; track event) { + {{ event }}  + } + + + {{ tournament.costsPerEvent[tournamentPlayer.events.length - 1] | currency:'EUR':'symbol':'1.2-2':'nl' }} + + + + @if (tournamentPlayer.paid) { + Betaald + } @else { + Nog niet betaald + } + + + @if (tournament.status == 'ONGOING') { + + + @if (tournamentPlayer.present) { + Aanwezig + } @else { + Nog niet aanwezig + } + + + } + + } + + + + @if (tournament.status == 'ONGOING') { + + + group +  Tellers en invallers + + + + + + + + + + + + + @for (tournamentPlayer of tournament.tournamentPlayers; track tournamentPlayer.playerId) { + + + + + + + } + +
NaamWedstrijden geteldOnderdelen
{{ tournamentPlayer.name }}{{ tournamentPlayer.counts }} + @for (event of tournamentPlayer.events; track event) { + {{ event }}  + } + + + + + + +
+
+ } + } diff --git a/src/app/components/tournament-players/tournament-players.component.ts b/src/app/components/tournament-players/tournament-players.component.ts index 200af39..f3b353a 100644 --- a/src/app/components/tournament-players/tournament-players.component.ts +++ b/src/app/components/tournament-players/tournament-players.component.ts @@ -13,6 +13,7 @@ import {CourtSelectionComponent} from "../court-selection/court-selection.compon import {MatDialog} from "@angular/material/dialog"; import {SubstituteSelectionComponent} from "../substitute-selection/substitute-selection.component"; import {TournamentPlayer} from "../../model/tournamentPlayer"; +import {MatTab, MatTabGroup, MatTabLabel} from "@angular/material/tabs"; @Component({ selector: 'app-tournament-players', @@ -24,7 +25,10 @@ import {TournamentPlayer} from "../../model/tournamentPlayer"; MatIconButton, MatMenu, MatMenuItem, - MatMenuTrigger + MatMenuTrigger, + MatTab, + MatTabGroup, + MatTabLabel ], templateUrl: './tournament-players.component.html', standalone: true, @@ -74,7 +78,7 @@ export class TournamentPlayersComponent implements OnInit { }).afterClosed().subscribe(result => { if (result != undefined) { console.log('Substitute selected for ' + player.name + ', namely: ' + result.substitute.name); - this.tournamentService.startMatch(this.tournament.id, match.id, result.court, result.counter.playerId).subscribe(data => { + this.tournamentService.playerSubstitute(this.tournament.id, player.playerId, result.substitute.playerId).subscribe(data => { this.tournament = data; }); } diff --git a/src/app/model/tournamentPlayer.ts b/src/app/model/tournamentPlayer.ts index 8d8bec2..4deadc6 100644 --- a/src/app/model/tournamentPlayer.ts +++ b/src/app/model/tournamentPlayer.ts @@ -7,4 +7,11 @@ export class TournamentPlayer { present: boolean; counting: boolean; counts: number; + substitutions: TournamentPlayerSubstitution[]; +} + +export class TournamentPlayerSubstitution { + substitutionId: number; + event: string; + substitute: TournamentPlayer; }