Compare commits
6 Commits
26c0c1a2da
...
71e5b5c912
| Author | SHA1 | Date | |
|---|---|---|---|
| 71e5b5c912 | |||
| 76acf809bd | |||
| 9bc0d5f362 | |||
| 348a2ab2c5 | |||
| 1b2f123683 | |||
| 1da6246d9a |
3049
package-lock.json
generated
3049
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -13,13 +13,14 @@ import {MatchSheetsComponent} from "./components/match-sheets/match-sheets.compo
|
||||
import {RoundOverviewComponent} from "./components/round-overview/round-overview.component";
|
||||
import {AuthGuard} from "./authentication/authguard";
|
||||
import {LoginComponent} from "./components/login/login.component";
|
||||
import {TournamentPlayersComponent} from "./components/tournament-players/tournament-players.component";
|
||||
|
||||
export const routes: Routes = [
|
||||
{ path: '', component: TournamentListComponent, canActivate: [AuthGuard], data: { header: 'Toernooien' }},
|
||||
{ path: 'tournaments', component: TournamentListComponent, canActivate: [AuthGuard], data: { header: 'Toernooien' }},
|
||||
{ path: 'tournaments/add', component: TournamentEditComponent, canActivate: [AuthGuard], data: { header: 'Nieuw Toernooi' }},
|
||||
{ path: 'tournaments/:id/edit', component: TournamentEditComponent, canActivate: [AuthGuard], data: { header: 'Bewerk Toernooi' }},
|
||||
{ path: 'tournaments/:id/registrations', component: TournamentRegistrationsComponent, canActivate: [AuthGuard], data: { header: 'Inschrijvingen' }},
|
||||
{ path: 'tournaments/:id/registrations', component: TournamentPlayersComponent, canActivate: [AuthGuard], data: { header: 'Inschrijvingen' }},
|
||||
{ path: 'tournaments/:id/validate', component: TournamentValidateComponent, canActivate: [AuthGuard], data: { header: 'Toernooi' }},
|
||||
{ path: 'tournaments/:id/divide', component: TournamentDivideComponent, canActivate: [AuthGuard], data: { header: 'Toernooi valideren' }},
|
||||
{ path: 'tournaments/:id/draw', component: TournamentDrawComponent, canActivate: [AuthGuard], data: { header: 'Toernooi loten' }},
|
||||
|
||||
@@ -51,8 +51,8 @@
|
||||
}
|
||||
@if (!this.showAll) {
|
||||
<button mat-button (click)="this.showAll = true">
|
||||
<mat-icon>search</mat-icon>
|
||||
Toon oude toernooien
|
||||
<mat-icon>expand</mat-icon>
|
||||
Toon inactieve toernooien
|
||||
</button>
|
||||
}
|
||||
</mat-card-content>
|
||||
|
||||
@@ -112,7 +112,7 @@ export class PlayerRegistrationsComponent implements OnInit {
|
||||
if (this.showAll) {
|
||||
return this.tournamentRegistrations;
|
||||
} else {
|
||||
return this.tournamentRegistrations.filter(t => (t.status == 'UPCOMING' || t.status == 'ONGOING'));
|
||||
return this.tournamentRegistrations.filter(t => t.active);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
@if (tournament) {
|
||||
<form (ngSubmit)="saveTournament()">
|
||||
<mat-card appearance="outlined">
|
||||
<!--
|
||||
<mat-card-header>
|
||||
<h5>{{ isEditMode ? 'Bewerk toernooi' : 'Toevoegen toernooi' }}</h5>
|
||||
</mat-card-header>
|
||||
-->
|
||||
<mat-card-content>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
@@ -65,7 +65,6 @@ export class TournamentEditComponent implements OnInit {
|
||||
this.tournamentService.getById(Number(id)).subscribe(data => {
|
||||
this.tournament = data;
|
||||
})
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,6 @@
|
||||
@for (group of event.groups; track group.id) {
|
||||
<mat-tab label="{{group.id}}">
|
||||
<ng-template mat-tab-label>
|
||||
<!--<mat-icon>list</mat-icon> -->
|
||||
{{ group.name }}
|
||||
|
||||
@if (getActiveMatchCountForGroup(group) > 0) {
|
||||
@@ -416,50 +415,7 @@
|
||||
<mat-icon>group</mat-icon>
|
||||
Spelerslijst
|
||||
</ng-template>
|
||||
<table class="table table-hover w-75 m-4">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Naam</th>
|
||||
<th>Onderdelen</th>
|
||||
<th>Kosten</th>
|
||||
<th>Betaald</th>
|
||||
<th>Aanwezig</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (tournamentPlayer of tournament.tournamentPlayers; track tournamentPlayer.playerId) {
|
||||
<tr>
|
||||
<td>{{ tournamentPlayer.name }}</td>
|
||||
<td>
|
||||
@for (event of tournamentPlayer.events; track event) {
|
||||
{{ event }}
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
{{ tournament.costsPerEvent[tournamentPlayer.events.length - 1] | currency:'EUR':'symbol':'1.2-2':'nl' }}
|
||||
</td>
|
||||
<td>
|
||||
<mat-slide-toggle [(ngModel)]="tournamentPlayer.paid" (change)="playerPaid($event, tournamentPlayer.playerId)">
|
||||
@if (tournamentPlayer.paid) {
|
||||
Betaald
|
||||
} @else {
|
||||
Nog niet betaald
|
||||
}
|
||||
</mat-slide-toggle>
|
||||
</td>
|
||||
<td>
|
||||
<mat-slide-toggle [(ngModel)]="tournamentPlayer.present" (change)="playerPresent($event, tournamentPlayer.playerId)">
|
||||
@if (tournamentPlayer.present) {
|
||||
Aanwezig
|
||||
} @else {
|
||||
Nog niet aanwezig
|
||||
}
|
||||
</mat-slide-toggle>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
<app-tournament-players></app-tournament-players>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
</mat-tab>
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
MatExpansionPanelTitle
|
||||
} from "@angular/material/expansion";
|
||||
import {MatCard, MatCardContent, MatCardHeader} from "@angular/material/card";
|
||||
import {CurrencyPipe, DatePipe, DecimalPipe, NgClass} from "@angular/common";
|
||||
import {DatePipe, DecimalPipe, NgClass} from "@angular/common";
|
||||
import {TeamPipe} from "../../pipes/team-pipe";
|
||||
import {TournamentService} from "../../service/tournament.service";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
@@ -26,43 +26,42 @@ 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 {MatSlideToggle, MatSlideToggleChange} from "@angular/material/slide-toggle";
|
||||
import {MatSlideToggleChange} from "@angular/material/slide-toggle";
|
||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||
import {CourtSelectionComponent} from "../court-selection/court-selection.component";
|
||||
import {Standings} from "../../model/standings";
|
||||
import {Title} from '@angular/platform-browser';
|
||||
import {HeaderService} from "../../service/header.service";
|
||||
import {TournamentPlayersComponent} from "../tournament-players/tournament-players.component";
|
||||
|
||||
@Component({
|
||||
selector: 'app-tournament-manage',
|
||||
imports: [
|
||||
FullNamePipe,
|
||||
MatAccordion,
|
||||
MatCard,
|
||||
MatCardContent,
|
||||
MatCardHeader,
|
||||
MatExpansionPanel,
|
||||
MatExpansionPanelHeader,
|
||||
MatExpansionPanelTitle,
|
||||
TeamPipe,
|
||||
MatIcon,
|
||||
NgClass,
|
||||
MatMenu,
|
||||
MatMenuItem,
|
||||
MatMenuTrigger,
|
||||
FormsModule,
|
||||
DatePipe,
|
||||
MatTabGroup,
|
||||
MatTab,
|
||||
MatTabLabel,
|
||||
MatButton,
|
||||
MatIconButton,
|
||||
DecimalPipe,
|
||||
TournamentValidateComponent,
|
||||
MatSlideToggle,
|
||||
CurrencyPipe,
|
||||
MatMenuContent
|
||||
],
|
||||
imports: [
|
||||
FullNamePipe,
|
||||
MatAccordion,
|
||||
MatCard,
|
||||
MatCardContent,
|
||||
MatCardHeader,
|
||||
MatExpansionPanel,
|
||||
MatExpansionPanelHeader,
|
||||
MatExpansionPanelTitle,
|
||||
TeamPipe,
|
||||
MatIcon,
|
||||
NgClass,
|
||||
MatMenu,
|
||||
MatMenuItem,
|
||||
MatMenuTrigger,
|
||||
FormsModule,
|
||||
DatePipe,
|
||||
MatTabGroup,
|
||||
MatTab,
|
||||
MatTabLabel,
|
||||
MatButton,
|
||||
MatIconButton,
|
||||
DecimalPipe,
|
||||
TournamentValidateComponent,
|
||||
MatMenuContent,
|
||||
TournamentPlayersComponent
|
||||
],
|
||||
providers: [
|
||||
FullNamePipe,
|
||||
TeamPipe,
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
@if (tournament) {
|
||||
<!-- <mat-card appearance="outlined" class="m-3">-->
|
||||
<!-- <mat-card-header>-->
|
||||
<!-- <h6>Toernooi</h6>-->
|
||||
<!-- </mat-card-header>-->
|
||||
<!-- <mat-card-content>-->
|
||||
<table class="table table-hover w-75 m-4">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Naam</th>
|
||||
<th>Onderdelen</th>
|
||||
<th>Kosten</th>
|
||||
<th>Betaald</th>
|
||||
<th>Aanwezig</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (tournamentPlayer of tournament.tournamentPlayers; track tournamentPlayer.playerId) {
|
||||
<tr>
|
||||
<td>{{ tournamentPlayer.name }}</td>
|
||||
<td>
|
||||
@for (event of tournamentPlayer.events; track event) {
|
||||
{{ event }}
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
{{ tournament.costsPerEvent[tournamentPlayer.events.length - 1] | currency:'EUR':'symbol':'1.2-2':'nl' }}
|
||||
</td>
|
||||
<td>
|
||||
<mat-slide-toggle [(ngModel)]="tournamentPlayer.paid" (change)="playerPaid($event, tournamentPlayer.playerId)">
|
||||
@if (tournamentPlayer.paid) {
|
||||
Betaald
|
||||
} @else {
|
||||
Nog niet betaald
|
||||
}
|
||||
</mat-slide-toggle>
|
||||
</td>
|
||||
<td>
|
||||
<mat-slide-toggle [(ngModel)]="tournamentPlayer.present" (change)="playerPresent($event, tournamentPlayer.playerId)">
|
||||
@if (tournamentPlayer.present) {
|
||||
Aanwezig
|
||||
} @else {
|
||||
Nog niet aanwezig
|
||||
}
|
||||
</mat-slide-toggle>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- </mat-card-content>-->
|
||||
<!-- </mat-card>-->
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {MatCard, MatCardContent, MatCardHeader} from "@angular/material/card";
|
||||
import {CurrencyPipe} from "@angular/common";
|
||||
import {MatSlideToggle, MatSlideToggleChange} from "@angular/material/slide-toggle";
|
||||
import {TournamentService} from "../../service/tournament.service";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {Tournament} from "../../model/tournament";
|
||||
import {FormsModule} from "@angular/forms";
|
||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||
|
||||
@Component({
|
||||
selector: 'app-tournament-players',
|
||||
imports: [
|
||||
MatCard,
|
||||
MatCardContent,
|
||||
MatCardHeader,
|
||||
// MatIcon,
|
||||
CurrencyPipe,
|
||||
MatSlideToggle,
|
||||
FormsModule
|
||||
],
|
||||
templateUrl: './tournament-players.component.html',
|
||||
styleUrl: './tournament-players.component.scss'
|
||||
})
|
||||
export class TournamentPlayersComponent implements OnInit {
|
||||
|
||||
tournament: Tournament;
|
||||
|
||||
constructor(
|
||||
private tournamentService: TournamentService,
|
||||
private _snackBar: MatSnackBar,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const id = this.route.snapshot.paramMap.get('id');
|
||||
this.tournamentService.getById(Number(id)).subscribe(data => {
|
||||
this.tournament = data;
|
||||
});
|
||||
}
|
||||
|
||||
playerPaid($event: MatSlideToggleChange, playerId: number) {
|
||||
this.tournamentService.playerPaid(this.tournament.id, playerId, $event.checked).subscribe(() => {
|
||||
this._snackBar.open('Opgeslagen.');
|
||||
});
|
||||
}
|
||||
|
||||
playerPresent($event: MatSlideToggleChange, playerId: number) {
|
||||
this.tournamentService.playerPresent(this.tournament.id, playerId, $event.checked).subscribe(() => {
|
||||
this._snackBar.open('Opgeslagen.');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,8 +8,8 @@ export class Tournament {
|
||||
status: string;
|
||||
events: Event[];
|
||||
tournamentPlayers: TournamentPlayer[];
|
||||
maxEvents: number;
|
||||
costsPerEvent: number[] = [0, 0, 0];
|
||||
maxEvents: number = 2;
|
||||
costsPerEvent: number[] = [10, 20, 0];
|
||||
courts: number;
|
||||
active: boolean;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ export class TournamentRegistration {
|
||||
editable: boolean;
|
||||
date: string;
|
||||
status: string;
|
||||
active: boolean;
|
||||
events: EventRegistration[];
|
||||
|
||||
static getStatus(tournamentRegistration: TournamentRegistration): string {
|
||||
|
||||
Reference in New Issue
Block a user