Various improvements
This commit is contained in:
@@ -157,7 +157,9 @@
|
|||||||
@for (group of event.groups; track group.id) {
|
@for (group of event.groups; track group.id) {
|
||||||
<mat-tab label="{{group.id}}">
|
<mat-tab label="{{group.id}}">
|
||||||
<ng-template mat-tab-label>
|
<ng-template mat-tab-label>
|
||||||
{{ group.name }}
|
@if (group.status == "FINISHED") {
|
||||||
|
<mat-icon>check</mat-icon>
|
||||||
|
}{{ group.name }}
|
||||||
|
|
||||||
@if (getActiveMatchCountForGroup(group) > 0) {
|
@if (getActiveMatchCountForGroup(group) > 0) {
|
||||||
<span class="badge text-bg-success">{{ getActiveMatchCountForGroup(group) }}</span>
|
<span class="badge text-bg-success">{{ getActiveMatchCountForGroup(group) }}</span>
|
||||||
@@ -232,7 +234,7 @@
|
|||||||
<h6 class="mt-3">Wedstrijden</h6>
|
<h6 class="mt-3">Wedstrijden</h6>
|
||||||
|
|
||||||
@if (round.status == 'NOT_STARTED') {
|
@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>
|
<tbody>
|
||||||
@for (match of round.matches; track match.id) {
|
@for (match of round.matches; track match.id) {
|
||||||
<tr>
|
<tr>
|
||||||
@@ -250,7 +252,7 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
} @else if (round.status == 'IN_PROGRESS') {
|
} @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>
|
<tbody>
|
||||||
@for (match of round.matches; track match.id) {
|
@for (match of round.matches; track match.id) {
|
||||||
<tr>
|
<tr>
|
||||||
@@ -303,7 +305,7 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
} @else if (round.status == 'FINISHED') {
|
} @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>
|
<tbody>
|
||||||
@for (match of round.matches; track match.id) {
|
@for (match of round.matches; track match.id) {
|
||||||
<tr>
|
<tr>
|
||||||
@@ -331,6 +333,7 @@
|
|||||||
</table>
|
</table>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@if (!round.isFinalsRound) {
|
||||||
<h6 class="mt-3">Stand</h6>
|
<h6 class="mt-3">Stand</h6>
|
||||||
|
|
||||||
<table class="table w-75 m-4">
|
<table class="table w-75 m-4">
|
||||||
@@ -376,6 +379,7 @@
|
|||||||
}
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
}
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
}
|
}
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
@@ -396,7 +400,7 @@
|
|||||||
<mat-icon>group</mat-icon>
|
<mat-icon>group</mat-icon>
|
||||||
Spelerslijst
|
Spelerslijst
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<app-tournament-players></app-tournament-players>
|
<app-tournament-players [tournament]="tournament"></app-tournament-players>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ td.w-fill {
|
|||||||
width: 90% !important;
|
width: 90% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.w-95 {
|
||||||
|
width: 95% !important;
|
||||||
|
}
|
||||||
|
|
||||||
.material-tooltip {
|
.material-tooltip {
|
||||||
white-space: pre-line;
|
white-space: pre-line;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ import {MatTooltip} from "@angular/material/tooltip";
|
|||||||
MatIconButton,
|
MatIconButton,
|
||||||
DecimalPipe,
|
DecimalPipe,
|
||||||
TournamentValidateComponent,
|
TournamentValidateComponent,
|
||||||
MatMenuContent,
|
|
||||||
TournamentPlayersComponent,
|
TournamentPlayersComponent,
|
||||||
MatExpansionPanelActionRow,
|
MatExpansionPanelActionRow,
|
||||||
],
|
],
|
||||||
@@ -75,7 +74,7 @@ import {MatTooltip} from "@angular/material/tooltip";
|
|||||||
})
|
})
|
||||||
export class TournamentManageComponent implements OnInit, OnDestroy {
|
export class TournamentManageComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
@Input() tournament: Tournament;
|
tournament: Tournament;
|
||||||
|
|
||||||
activeRoundTab: number = 0;
|
activeRoundTab: number = 0;
|
||||||
|
|
||||||
@@ -124,7 +123,7 @@ export class TournamentManageComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getRoundIcon(status: String) {
|
getRoundIcon(status: string) {
|
||||||
if (status == "FINISHED") {
|
if (status == "FINISHED") {
|
||||||
return "check";
|
return "check";
|
||||||
} else if (status == "IN_PROGRESS") {
|
} else if (status == "IN_PROGRESS") {
|
||||||
@@ -205,7 +204,7 @@ export class TournamentManageComponent implements OnInit, OnDestroy {
|
|||||||
match: match,
|
match: match,
|
||||||
availableCourts: this.getAvailableCourts(),
|
availableCourts: this.getAvailableCourts(),
|
||||||
totalCourts: this.tournament.courts,
|
totalCourts: this.tournament.courts,
|
||||||
availableCounters: this.getAvailableCounters()
|
availableCounters: this.getAvailableCounters(match)
|
||||||
},
|
},
|
||||||
minWidth: '800px',
|
minWidth: '800px',
|
||||||
minHeight: '250px'
|
minHeight: '250px'
|
||||||
@@ -263,7 +262,7 @@ export class TournamentManageComponent implements OnInit, OnDestroy {
|
|||||||
return courts.filter(court => activeCourts.indexOf(court) < 0);
|
return courts.filter(court => activeCourts.indexOf(court) < 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
getAvailableCounters(): TournamentPlayer[] {
|
getAvailableCounters(match: Match): TournamentPlayer[] {
|
||||||
const activePlayerIds = new Set(
|
const activePlayerIds = new Set(
|
||||||
this.activeMatches().flatMap(activeMatch => [
|
this.activeMatches().flatMap(activeMatch => [
|
||||||
activeMatch.match.team1.player1.id,
|
activeMatch.match.team1.player1.id,
|
||||||
@@ -273,8 +272,18 @@ export class TournamentManageComponent implements OnInit, OnDestroy {
|
|||||||
].filter(id => id !== undefined))
|
].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(
|
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>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Naam</th>
|
<th>Naam</th>
|
||||||
|
<th>Wedstrijden geteld</th>
|
||||||
<th>Onderdelen</th>
|
<th>Onderdelen</th>
|
||||||
<th>Kosten</th>
|
<th>Kosten</th>
|
||||||
<th>Betaald</th>
|
<th>Betaald</th>
|
||||||
@@ -13,6 +14,7 @@
|
|||||||
@for (tournamentPlayer of tournament.tournamentPlayers; track tournamentPlayer.playerId) {
|
@for (tournamentPlayer of tournament.tournamentPlayers; track tournamentPlayer.playerId) {
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ tournamentPlayer.name }}</td>
|
<td>{{ tournamentPlayer.name }}</td>
|
||||||
|
<td>{{ tournamentPlayer.counts }}</td>
|
||||||
<td>
|
<td>
|
||||||
@for (event of tournamentPlayer.events; track event) {
|
@for (event of tournamentPlayer.events; track event) {
|
||||||
{{ 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 {CurrencyPipe} from "@angular/common";
|
||||||
import {MatSlideToggle, MatSlideToggleChange} from "@angular/material/slide-toggle";
|
import {MatSlideToggle, MatSlideToggleChange} from "@angular/material/slide-toggle";
|
||||||
import {TournamentService} from "../../service/tournament.service";
|
import {TournamentService} from "../../service/tournament.service";
|
||||||
@@ -19,7 +19,7 @@ import {MatSnackBar} from "@angular/material/snack-bar";
|
|||||||
})
|
})
|
||||||
export class TournamentPlayersComponent implements OnInit {
|
export class TournamentPlayersComponent implements OnInit {
|
||||||
|
|
||||||
tournament: Tournament;
|
@Input() tournament: Tournament;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private tournamentService: TournamentService,
|
private tournamentService: TournamentService,
|
||||||
@@ -29,10 +29,11 @@ export class TournamentPlayersComponent implements OnInit {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
const id = this.route.snapshot.paramMap.get('id');
|
console.log('Tournament received from parent:', this.tournament);
|
||||||
this.tournamentService.getById(Number(id)).subscribe(data => {
|
// const id = this.route.snapshot.paramMap.get('id');
|
||||||
this.tournament = data;
|
// this.tournamentService.getById(Number(id)).subscribe(data => {
|
||||||
});
|
// this.tournament = data;
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
playerPaid($event: MatSlideToggleChange, playerId: number) {
|
playerPaid($event: MatSlideToggleChange, playerId: number) {
|
||||||
|
|||||||
@@ -10,4 +10,5 @@ export class Round {
|
|||||||
quit: Team[];
|
quit: Team[];
|
||||||
drawnOut: Team;
|
drawnOut: Team;
|
||||||
standings: Standings;
|
standings: Standings;
|
||||||
|
isFinalsRound: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user