Invallers
This commit is contained in:
@@ -25,15 +25,7 @@
|
||||
<mat-icon>settings</mat-icon>
|
||||
Beheer
|
||||
</ng-template>
|
||||
<mat-tab-group animationDuration="0ms" disableRipple="true">
|
||||
<mat-tab>
|
||||
<ng-template mat-tab-label>
|
||||
<mat-icon>group</mat-icon>
|
||||
Spelerslijst
|
||||
</ng-template>
|
||||
<app-tournament-players [tournament]="tournament"></app-tournament-players>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
<app-tournament-players [tournament]="tournament"></app-tournament-players>
|
||||
</mat-tab>
|
||||
}
|
||||
|
||||
@@ -117,15 +109,7 @@
|
||||
<mat-icon>settings</mat-icon>
|
||||
Beheer
|
||||
</ng-template>
|
||||
<mat-tab-group animationDuration="0ms" disableRipple="true">
|
||||
<mat-tab>
|
||||
<ng-template mat-tab-label>
|
||||
<mat-icon>group</mat-icon>
|
||||
Spelerslijst
|
||||
</ng-template>
|
||||
<app-tournament-players [tournament]="tournament"></app-tournament-players>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
<app-tournament-players [tournament]="tournament"></app-tournament-players>
|
||||
</mat-tab>
|
||||
}
|
||||
|
||||
@@ -270,7 +254,20 @@
|
||||
<tbody>
|
||||
@for (match of round.matches; track match.id) {
|
||||
<tr>
|
||||
<td class="align-middle w-team">{{ match.team1 | teamText }}</td>
|
||||
<td class="align-middle w-team">
|
||||
@if (playerHasSubstituteForEvent(match.team1.player1, event)) {
|
||||
<span class="has-substitute" matTooltip="Valt in voor {{ match.team1.player1 | fullName }}" matTooltipPosition="below">
|
||||
{{ getSubstituteForEvent(match.team1.player1, event) }}
|
||||
</span>
|
||||
} @else {
|
||||
{{ match.team1.player1 | fullName }}
|
||||
}
|
||||
@if (event.doublesEvent && match.team1.player2 != null) {
|
||||
<span [ngClass]="playerHasSubstituteForEvent(match.team1.player2, event) ? 'has-substitute' : ''">
|
||||
/ {{ match.team1.player2 | fullName }}
|
||||
</span>
|
||||
}
|
||||
</td>
|
||||
<td class="align-middle w-sep">-</td>
|
||||
<td class="align-middle w-team">{{ match.team2 | teamText }}</td>
|
||||
<td class="align-middle w-fill"></td>
|
||||
|
||||
@@ -35,7 +35,11 @@ td.w-fill {
|
||||
width: 95% !important;
|
||||
}
|
||||
|
||||
|
||||
.mat-menu-panel {
|
||||
z-index: 1000 !important;
|
||||
}
|
||||
|
||||
.has-substitute {
|
||||
text-decoration-line: underline;
|
||||
text-decoration-style: dotted;
|
||||
}
|
||||
|
||||
@@ -26,13 +26,14 @@ import {MatDialog} from "@angular/material/dialog";
|
||||
import {MatchResultPipe} from "../../pipes/match-result-pipe";
|
||||
import {Event} from "../../model/event";
|
||||
import {TournamentValidateComponent} from "../tournament-validate/tournament-validate.component";
|
||||
import {Strength} from "../../model/player";
|
||||
import {Player, Strength} from "../../model/player";
|
||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||
import {CourtSelectionComponent} from "../court-selection/court-selection.component";
|
||||
import {Standings} from "../../model/standings";
|
||||
import {HeaderService} from "../../service/header.service";
|
||||
import {TournamentPlayersComponent} from "../tournament-players/tournament-players.component";
|
||||
import {TournamentPlayer} from "../../model/tournamentPlayer";
|
||||
import {MatTooltip} from "@angular/material/tooltip";
|
||||
|
||||
@Component({
|
||||
selector: 'app-tournament-manage',
|
||||
@@ -62,6 +63,7 @@ import {TournamentPlayer} from "../../model/tournamentPlayer";
|
||||
TournamentValidateComponent,
|
||||
TournamentPlayersComponent,
|
||||
MatExpansionPanelActionRow,
|
||||
MatTooltip,
|
||||
],
|
||||
providers: [
|
||||
FullNamePipe,
|
||||
@@ -412,6 +414,35 @@ export class TournamentManageComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
playerHasSubstituteForEvent(player: Player, event: Event) : boolean {
|
||||
return this.getSubstituteForEvent(player, event) != undefined;
|
||||
}
|
||||
|
||||
getSubstituteForEvent(player: Player, event: Event) : string | undefined {
|
||||
var tournamentPlayer = this.getTournamentPlayerFromPlayer(player);
|
||||
if (tournamentPlayer === null) return undefined;
|
||||
if (tournamentPlayer.name == 'Inge Brehler') console.log(tournamentPlayer.name);
|
||||
|
||||
for (let substitution of tournamentPlayer.substitutions) {
|
||||
if (substitution.event == event.type) {
|
||||
var substitute = this.tournament.tournamentPlayers.find(p => p.id == substitution.substitute);
|
||||
return substitute?.name;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
getTournamentPlayerFromPlayer(player: Player) : TournamentPlayer | null {
|
||||
for (let tournamentPlayer of this.tournament.tournamentPlayers) {
|
||||
if (tournamentPlayer.playerId == player.id) {
|
||||
return tournamentPlayer;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ActiveMatch {
|
||||
|
||||
Reference in New Issue
Block a user