Various improvements

This commit is contained in:
2025-08-25 23:38:30 +02:00
parent 5a5c134002
commit d6de1c43fb
6 changed files with 81 additions and 60 deletions

View File

@@ -157,7 +157,9 @@
@for (group of event.groups; track group.id) {
<mat-tab label="{{group.id}}">
<ng-template mat-tab-label>
{{ group.name }}
@if (group.status == "FINISHED") {
<mat-icon>check</mat-icon>
&nbsp;}{{ group.name }}
&nbsp;
@if (getActiveMatchCountForGroup(group) > 0) {
<span class="badge text-bg-success">{{ getActiveMatchCountForGroup(group) }}</span>
@@ -232,7 +234,7 @@
<h6 class="mt-3">Wedstrijden</h6>
@if (round.status == 'NOT_STARTED') {
<table class="table table-hover m-4 wide w-100">
<table class="table table-hover m-4 wide w-95">
<tbody>
@for (match of round.matches; track match.id) {
<tr>
@@ -250,7 +252,7 @@
</tbody>
</table>
} @else if (round.status == 'IN_PROGRESS') {
<table class="table table-hover m-4 wide w-100">
<table class="table table-hover m-4 wide w-95">
<tbody>
@for (match of round.matches; track match.id) {
<tr>
@@ -303,7 +305,7 @@
</tbody>
</table>
} @else if (round.status == 'FINISHED') {
<table class="table table-hover m-4 wide {{ this.groupIsDoublesType(group) ? 'w-100' : 'w-100' }}">
<table class="table table-hover m-4 wide {{ this.groupIsDoublesType(group) ? 'w-95' : 'w-95' }}">
<tbody>
@for (match of round.matches; track match.id) {
<tr>
@@ -331,51 +333,53 @@
</table>
}
<h6 class="mt-3">Stand</h6>
@if (!round.isFinalsRound) {
<h6 class="mt-3">Stand</h6>
<table class="table w-75 m-4">
<caption>Tussen haakjes de gemiddelden per gespeelde wedstrijd</caption>
<thead>
<tr>
<th>#</th>
<th>
@if (event.doublesEvent) {
Team
} @else {
Speler
<table class="table w-75 m-4">
<caption>Tussen haakjes de gemiddelden per gespeelde wedstrijd</caption>
<thead>
<tr>
<th>#</th>
<th>
@if (event.doublesEvent) {
Team
} @else {
Speler
}
</th>
<th>Gespeeld</th>
<th>Punten</th>
<th>Games</th>
<th>Wedstrijdpunten</th>
</tr>
</thead>
<tbody class="table-group-divider">
@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">{{ entry.played }}</td>
<td class="align-middle">
@if (entry.played > 0 ) {
{{ entry.points }} ({{ entry.points / entry.played | number: '1.0-2' }})
}
</td>
<td class="align-middle">
@if (entry.played > 0 ) {
{{ entry.gamesWon }}-{{ entry.gamesLost}} ({{ (entry.gamesWon - entry.gamesLost) / entry.played | number: '1.0-2' }})
}
</td>
<td class="align-middle">
@if (entry.played > 0 ) {
{{ entry.pointsWon }}-{{ entry.pointsLost }} ({{ (entry.pointsWon - entry.pointsLost) / entry.played | number: '1.0-2' }})
}
</td>
</tr>
}
</th>
<th>Gespeeld</th>
<th>Punten</th>
<th>Games</th>
<th>Wedstrijdpunten</th>
</tr>
</thead>
<tbody class="table-group-divider">
@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">{{ entry.played }}</td>
<td class="align-middle">
@if (entry.played > 0 ) {
{{ entry.points }} ({{ entry.points / entry.played | number: '1.0-2' }})
}
</td>
<td class="align-middle">
@if (entry.played > 0 ) {
{{ entry.gamesWon }}-{{ entry.gamesLost}} ({{ (entry.gamesWon - entry.gamesLost) / entry.played | number: '1.0-2' }})
}
</td>
<td class="align-middle">
@if (entry.played > 0 ) {
{{ entry.pointsWon }}-{{ entry.pointsLost }} ({{ (entry.pointsWon - entry.pointsLost) / entry.played | number: '1.0-2' }})
}
</td>
</tr>
}
</tbody>
</table>
</tbody>
</table>
}
</mat-tab>
}
</mat-tab-group>
@@ -396,7 +400,7 @@
<mat-icon>group</mat-icon>
&nbsp;Spelerslijst
</ng-template>
<app-tournament-players></app-tournament-players>
<app-tournament-players [tournament]="tournament"></app-tournament-players>
</mat-tab>
</mat-tab-group>
</mat-tab>

View File

@@ -29,6 +29,10 @@ td.w-fill {
width: 90% !important;
}
.w-95 {
width: 95% !important;
}
.material-tooltip {
white-space: pre-line;
}

View File

@@ -61,7 +61,6 @@ import {MatTooltip} from "@angular/material/tooltip";
MatIconButton,
DecimalPipe,
TournamentValidateComponent,
MatMenuContent,
TournamentPlayersComponent,
MatExpansionPanelActionRow,
],
@@ -75,7 +74,7 @@ import {MatTooltip} from "@angular/material/tooltip";
})
export class TournamentManageComponent implements OnInit, OnDestroy {
@Input() tournament: Tournament;
tournament: Tournament;
activeRoundTab: number = 0;
@@ -124,7 +123,7 @@ export class TournamentManageComponent implements OnInit, OnDestroy {
});
}
getRoundIcon(status: String) {
getRoundIcon(status: string) {
if (status == "FINISHED") {
return "check";
} else if (status == "IN_PROGRESS") {
@@ -205,7 +204,7 @@ export class TournamentManageComponent implements OnInit, OnDestroy {
match: match,
availableCourts: this.getAvailableCourts(),
totalCourts: this.tournament.courts,
availableCounters: this.getAvailableCounters()
availableCounters: this.getAvailableCounters(match)
},
minWidth: '800px',
minHeight: '250px'
@@ -263,7 +262,7 @@ export class TournamentManageComponent implements OnInit, OnDestroy {
return courts.filter(court => activeCourts.indexOf(court) < 0);
}
getAvailableCounters(): TournamentPlayer[] {
getAvailableCounters(match: Match): TournamentPlayer[] {
const activePlayerIds = new Set(
this.activeMatches().flatMap(activeMatch => [
activeMatch.match.team1.player1.id,
@@ -273,8 +272,18 @@ export class TournamentManageComponent implements OnInit, OnDestroy {
].filter(id => id !== undefined))
);
const playerIdsInMatchToBeStarted = new Set([
match.team1.player1.id,
match.team1.player2?.id,
match.team2.player1.id,
match.team2.player2?.id
].filter(id => id !== undefined));
return this.tournament.tournamentPlayers.filter(
player => !player.counting && !activePlayerIds.has(player.playerId)
player =>
!player.counting
&& !activePlayerIds.has(player.playerId)
&& !playerIdsInMatchToBeStarted.has(player.playerId)
);
}