Various improvements
This commit is contained in:
@@ -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>
|
||||
}{{ group.name }}
|
||||
|
||||
@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,6 +333,7 @@
|
||||
</table>
|
||||
}
|
||||
|
||||
@if (!round.isFinalsRound) {
|
||||
<h6 class="mt-3">Stand</h6>
|
||||
|
||||
<table class="table w-75 m-4">
|
||||
@@ -376,6 +379,7 @@
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</mat-tab>
|
||||
}
|
||||
</mat-tab-group>
|
||||
@@ -396,7 +400,7 @@
|
||||
<mat-icon>group</mat-icon>
|
||||
Spelerslijst
|
||||
</ng-template>
|
||||
<app-tournament-players></app-tournament-players>
|
||||
<app-tournament-players [tournament]="tournament"></app-tournament-players>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
</mat-tab>
|
||||
|
||||
@@ -29,6 +29,10 @@ td.w-fill {
|
||||
width: 90% !important;
|
||||
}
|
||||
|
||||
.w-95 {
|
||||
width: 95% !important;
|
||||
}
|
||||
|
||||
.material-tooltip {
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Naam</th>
|
||||
<th>Wedstrijden geteld</th>
|
||||
<th>Onderdelen</th>
|
||||
<th>Kosten</th>
|
||||
<th>Betaald</th>
|
||||
@@ -13,6 +14,7 @@
|
||||
@for (tournamentPlayer of tournament.tournamentPlayers; track tournamentPlayer.playerId) {
|
||||
<tr>
|
||||
<td>{{ tournamentPlayer.name }}</td>
|
||||
<td>{{ tournamentPlayer.counts }}</td>
|
||||
<td>
|
||||
@for (event of tournamentPlayer.events; track event) {
|
||||
{{ event }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {Component, Input, OnInit} from '@angular/core';
|
||||
import {CurrencyPipe} from "@angular/common";
|
||||
import {MatSlideToggle, MatSlideToggleChange} from "@angular/material/slide-toggle";
|
||||
import {TournamentService} from "../../service/tournament.service";
|
||||
@@ -19,7 +19,7 @@ import {MatSnackBar} from "@angular/material/snack-bar";
|
||||
})
|
||||
export class TournamentPlayersComponent implements OnInit {
|
||||
|
||||
tournament: Tournament;
|
||||
@Input() tournament: Tournament;
|
||||
|
||||
constructor(
|
||||
private tournamentService: TournamentService,
|
||||
@@ -29,10 +29,11 @@ export class TournamentPlayersComponent implements OnInit {
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const id = this.route.snapshot.paramMap.get('id');
|
||||
this.tournamentService.getById(Number(id)).subscribe(data => {
|
||||
this.tournament = data;
|
||||
});
|
||||
console.log('Tournament received from parent:', this.tournament);
|
||||
// const id = this.route.snapshot.paramMap.get('id');
|
||||
// this.tournamentService.getById(Number(id)).subscribe(data => {
|
||||
// this.tournament = data;
|
||||
// });
|
||||
}
|
||||
|
||||
playerPaid($event: MatSlideToggleChange, playerId: number) {
|
||||
|
||||
@@ -10,4 +10,5 @@ export class Round {
|
||||
quit: Team[];
|
||||
drawnOut: Team;
|
||||
standings: Standings;
|
||||
isFinalsRound: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user