Move to new server
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
@if (round) {
|
||||
<h6>{{ group.name }}, {{ round.name }}:</h6>
|
||||
@if (round.status != 'FINISHED') {
|
||||
<table class="table table-sm m-4 wide w-100">
|
||||
<tbody>
|
||||
<tr *ngFor="let match of round.matches">
|
||||
<td class="align-middle" style="width: 45%;">{{ match.team1 | teamText }}</td>
|
||||
<td class="align-middle w-sep">-</td>
|
||||
<td class="align-middle" style="width: 45%;">{{ match.team2 | teamText }}</td>
|
||||
<td class="align-middle w-sep"></td>
|
||||
</tr>
|
||||
@if (round.drawnOut) {
|
||||
<tr>
|
||||
<td class="align-middle w-100" colspan="4"><b>Deze ronde uitgeloot:</b> {{ round.drawnOut | teamText }}</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
} @else {
|
||||
<table class="table table-sm m-4 wide w-100">
|
||||
<tbody>
|
||||
<tr *ngFor="let match of round.matches">
|
||||
<td class="align-middle" style="width: 30%;">
|
||||
@if (event.doublesEvent) {
|
||||
{{ match.team1.player1 | fullName }} /<br>{{ match.team1.player2 | fullName }}
|
||||
} @else {
|
||||
{{ match.team1.player1 | fullName }}
|
||||
}
|
||||
<td class="align-middle w-sep">-</td>
|
||||
<td class="align-middle" style="width: 30%;">
|
||||
@if (event.doublesEvent) {
|
||||
{{ match.team2.player1 | fullName }} /<br>{{ match.team2.player2 | fullName }}
|
||||
} @else {
|
||||
{{ match.team2.player1 | fullName }}
|
||||
}
|
||||
</td>
|
||||
<td class="align-middle" style="width: 35%;">
|
||||
<div class="row result align-items-center">
|
||||
<span *ngFor="let game of match.games" class="col-3">{{ game.score1 }}-{{ game.score2 }}</span>
|
||||
@if (match.games.length == 2) {
|
||||
<span class="col-3"></span>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@if (round.drawnOut) {
|
||||
<tr>
|
||||
<td class="align-middle w-100" colspan="4"><b>Deze ronde uitgeloot:</b> {{ round.drawnOut | teamText }}</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
|
||||
@if (round.status == 'FINISHED' || prevRound) {
|
||||
@if (group.status == 'FINISHED') {
|
||||
<h6>Eindstand:</h6>
|
||||
} @else if (round.status == 'FINISHED') {
|
||||
<h6>Stand na {{ round.name }}:</h6>
|
||||
} @else {
|
||||
<h6>Stand na {{ prevRound?.name }}:</h6>
|
||||
}
|
||||
<table class="table table-sm w-100 m-4">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>
|
||||
@if (event.doublesEvent) {
|
||||
Team
|
||||
} @else {
|
||||
Speler
|
||||
}
|
||||
</th>
|
||||
<th>Gespeeld</th>
|
||||
<th>Punten/W</th>
|
||||
<th>Games/W</th>
|
||||
<th>#/W</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-group-divider">
|
||||
<tr *ngFor="let entry of round.standings.entries">
|
||||
<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">{{ entry.points / entry.played | number: '1.0-2' }}</td>
|
||||
<td class="align-middle">{{ (entry.gamesWon - entry.gamesLost) / entry.played | number: '1.0-2' }}</td>
|
||||
<td class="align-middle">{{ (entry.pointsWon - entry.pointsLost) / entry.played | number: '1.0-2' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
td.w-team {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
td.w-sep {
|
||||
width: 5%;
|
||||
}
|
||||
|
||||
td.w-fill {
|
||||
width: 35%;
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {Tournament} from "../../model/tournament";
|
||||
import {Event} from "../../model/event";
|
||||
import {Group} from "../../model/group";
|
||||
import {Round} from "../../model/round";
|
||||
import {TournamentService} from "../../service/tournament.service";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {DecimalPipe, NgForOf} from "@angular/common";
|
||||
import {TeamPipe} from "../../pipes/team-pipe";
|
||||
import {FullNamePipe} from "../../pipes/fullname-pipe";
|
||||
import {MatButton, MatIconButton} from "@angular/material/button";
|
||||
import {MatIcon} from "@angular/material/icon";
|
||||
import {MatMenu, MatMenuItem} from "@angular/material/menu";
|
||||
import {TitleService} from "../../service/title.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-round-overview',
|
||||
standalone: true,
|
||||
imports: [
|
||||
NgForOf,
|
||||
TeamPipe,
|
||||
DecimalPipe,
|
||||
MatButton,
|
||||
MatIcon,
|
||||
MatIconButton,
|
||||
MatMenu,
|
||||
MatMenuItem,
|
||||
FullNamePipe
|
||||
],
|
||||
providers: [
|
||||
TeamPipe,
|
||||
FullNamePipe
|
||||
],
|
||||
templateUrl: './round-overview.component.html',
|
||||
styleUrl: './round-overview.component.scss'
|
||||
})
|
||||
export class RoundOverviewComponent implements OnInit {
|
||||
|
||||
tournament: Tournament;
|
||||
event: Event;
|
||||
group: Group;
|
||||
round: Round;
|
||||
prevRound: Round | undefined;
|
||||
|
||||
constructor(
|
||||
private tournamentService: TournamentService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private titleService: TitleService
|
||||
) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.titleService.setTitle("Rondeoverzicht");
|
||||
const tournamentId = this.route.snapshot.paramMap.get('id');
|
||||
let roundId = Number(this.route.snapshot.paramMap.get('roundId'));
|
||||
|
||||
this.tournamentService.getById(Number(tournamentId)).subscribe(data => {
|
||||
this.tournament = data;
|
||||
for (let event of this.tournament.events) {
|
||||
for (let group of event.groups) {
|
||||
let roundIndex = 0;
|
||||
this.prevRound = undefined;
|
||||
for (let round of group.rounds) {
|
||||
roundIndex++;
|
||||
if (round.id == roundId) {
|
||||
this.event = event;
|
||||
this.group = group;
|
||||
this.round = round;
|
||||
return;
|
||||
}
|
||||
this.prevRound = round;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user