Only show divided events that have groups

This commit is contained in:
Michel ten Voorde
2024-10-30 11:44:07 +01:00
parent 5689b60b60
commit e654a103f9

View File

@@ -46,44 +46,48 @@
</button> </button>
</mat-menu> </mat-menu>
</ng-template> </ng-template>
<mat-card *ngFor="let event of tournament.events" appearance="outlined" class="m-3"> @for (event of tournament.events; track event) {
<mat-card-header> @if (event.groups.length > 0) {
<h6>Indeling {{ TournamentEvent.getType(event.type) }}</h6> <mat-card appearance="outlined" class="m-3">
</mat-card-header> <mat-card-header>
<mat-card-content> <h6>Indeling {{ TournamentEvent.getType(event.type) }}</h6>
<mat-accordion multi="true"> </mat-card-header>
<mat-expansion-panel *ngFor="let group of event.groups"> <mat-card-content>
<mat-expansion-panel-header> <mat-accordion multi="true">
<mat-panel-title> <mat-expansion-panel *ngFor="let group of event.groups">
{{ group.name }}&nbsp;<span class="badge text-bg-success">{{ group.teams.length }}</span> <mat-expansion-panel-header>
</mat-panel-title> <mat-panel-title>
</mat-expansion-panel-header> {{ group.name }}&nbsp;<span class="badge text-bg-success">{{ group.teams.length }}</span>
<table class="table {{ event.doublesEvent ? 'w-100' : 'w-50' }}"> </mat-panel-title>
<thead class="thead-dark"> </mat-expansion-panel-header>
<tr> <table class="table {{ event.doublesEvent ? 'w-100' : 'w-50' }}">
<th scope="col" class="w-20">Naam</th> <thead class="thead-dark">
<th scope="col" class="w-20">Club</th> <tr>
<th scope="col" class="w-10">Speelsterkte</th> <th scope="col" class="w-20">Naam</th>
<th *ngIf="event.doublesEvent" scope="col" class="w-20">Partner</th> <th scope="col" class="w-20">Club</th>
<th *ngIf="event.doublesEvent" scope="col" class="w-20">Club</th> <th scope="col" class="w-10">Speelsterkte</th>
<th *ngIf="event.doublesEvent" scope="col" class="w-10">Speelsterkte</th> <th *ngIf="event.doublesEvent" scope="col" class="w-20">Partner</th>
</tr> <th *ngIf="event.doublesEvent" scope="col" class="w-20">Club</th>
</thead> <th *ngIf="event.doublesEvent" scope="col" class="w-10">Speelsterkte</th>
<tbody> </tr>
<tr *ngFor="let team of group.teams"> </thead>
<td class="align-middle">{{ team.player1 | fullName }}</td> <tbody>
<td class="align-middle">{{ team.player1.club }}</td> <tr *ngFor="let team of group.teams">
<td class="align-middle">{{ getStrength(team.player1.strength.valueOf()) }}</td> <td class="align-middle">{{ team.player1 | fullName }}</td>
<td *ngIf="event.doublesEvent" class="align-middle">{{ team.player2 | fullName }}</td> <td class="align-middle">{{ team.player1.club }}</td>
<td *ngIf="event.doublesEvent" class="align-middle">{{ team.player2?.club }}</td> <td class="align-middle">{{ getStrength(team.player1.strength.valueOf()) }}</td>
<td *ngIf="event.doublesEvent" class="align-middle">{{ getStrength(team.player2?.strength?.valueOf()) }}</td> <td *ngIf="event.doublesEvent" class="align-middle">{{ team.player2 | fullName }}</td>
</tr> <td *ngIf="event.doublesEvent" class="align-middle">{{ team.player2?.club }}</td>
</tbody> <td *ngIf="event.doublesEvent" class="align-middle">{{ getStrength(team.player2?.strength?.valueOf()) }}</td>
</table> </tr>
</mat-expansion-panel> </tbody>
</mat-accordion> </table>
</mat-card-content> </mat-expansion-panel>
</mat-card> </mat-accordion>
</mat-card-content>
</mat-card>
}
}
</mat-tab> </mat-tab>
} }