Show substitutions in standings

This commit is contained in:
Michel ten Voorde
2025-11-06 16:42:22 +01:00
parent 7fd84005f9
commit 19e4372006
4 changed files with 25 additions and 6 deletions

View File

@@ -12,15 +12,24 @@ import {MatTooltip} from '@angular/material/tooltip';
styleUrls: ['./player-display.component.scss'],
template: `
@let substitute = getSubstituteForEvent(player, event);
<span [class.has-substitute]="substitute"
[matTooltip]="substitute ? 'Valt in voor ' + (player | fullName) : ''"
matTooltipPosition="below">{{ substitute || (player | fullName) }}</span>
@if (exlicitSubstitute) {
@if (substitute) {
{{ substitute }} (valt in voor {{ player | fullName }})
} @else {
{{ player | fullName }}
}
} @else {
<span [class.has-substitute]="substitute"
[matTooltip]="substitute ? 'Valt in voor ' + (player | fullName) : ''"
matTooltipPosition="below">{{ substitute || (player | fullName) }}</span>
}
`
})
export class PlayerDisplayComponent {
@Input({ required: true }) player!: Player;
@Input({ required: true }) event!: Event;
@Input({ required: true }) tournament!: Tournament;
@Input({ required: false }) exlicitSubstitute: boolean = false;
getSubstituteForEvent(player: Player, event: Event): string | undefined {
const tournamentPlayer = this.tournament.tournamentPlayers.find(

View File

@@ -108,7 +108,8 @@
[team]="entry.team"
[event]="this.event"
[tournament]="this.tournament"
[inline]="true">
[inline]="true"
[explicitSubstitute]="true">
</app-team-display>
</td>
<td class="align-middle">{{ entry.played }}</td>

View File

@@ -12,7 +12,8 @@ import {Team} from "../../model/team";
<app-player-display
[player]="team.player1"
[event]="event"
[tournament]="tournament">
[tournament]="tournament"
[exlicitSubstitute]="explicitSubstitute">
</app-player-display>
@if (event.doublesEvent && team.player2) {
@@ -34,4 +35,5 @@ export class TeamDisplayComponent {
@Input({ required: true }) event!: Event;
@Input({ required: true }) tournament!: Tournament;
@Input({ required: false }) inline: boolean = true;
@Input({ required: false }) explicitSubstitute: boolean = false;
}

View File

@@ -437,7 +437,14 @@
@for (entry of getStandingsForRound(round, group).entries; track entry.position) {
<tr>
<td class="align-middle">{{ entry.position }}</td>
<td class="align-middle">{{ entry.team | teamText }}</td>
<td class="align-middle">
<app-team-display
[team]="entry.team"
[event]="event"
[tournament]="this.tournament"
[inline]="true">
</app-team-display>
</td>
<td class="align-middle">{{ entry.played }}</td>
<td class="align-middle">
@if (entry.played > 0 ) {