match-result simplification
This commit is contained in:
@@ -7,18 +7,14 @@
|
||||
<b>{{ data.group.name }} {{ data.round.name }}</b>
|
||||
</div>
|
||||
</mat-grid-tile>
|
||||
<mat-grid-tile>
|
||||
<button type="button" class="btn btn-primary btn-lg" (click)="set21(1, 1)">21</button>
|
||||
</mat-grid-tile>
|
||||
<mat-grid-tile>
|
||||
<button type="button" class="btn btn-primary btn-lg" (click)="set21(1, 2)">21</button>
|
||||
</mat-grid-tile>
|
||||
<mat-grid-tile>
|
||||
<button type="button" class="btn btn-primary btn-lg" (click)="set21(1, 3)">21</button>
|
||||
</mat-grid-tile>
|
||||
|
||||
@for (gameNum of [1, 2, 3]; track gameNum) {
|
||||
<mat-grid-tile>
|
||||
<button type="button" class="btn btn-primary btn-lg" (click)="set21(1, gameNum)">21</button>
|
||||
</mat-grid-tile>
|
||||
}
|
||||
<mat-grid-tile colspan="2">
|
||||
<div class="w-100" [ngClass]="{'winner': validateResult() == 1}">
|
||||
<div class="w-100" [ngClass]="{'winner': isValidResult == 1}">
|
||||
<app-team-display
|
||||
[team]="data.match.team1"
|
||||
[event]="data.event"
|
||||
@@ -28,24 +24,23 @@
|
||||
</div>
|
||||
</mat-grid-tile>
|
||||
|
||||
<mat-grid-tile>
|
||||
<mat-form-field appearance="outline" (change)="validateResult()">
|
||||
<input matInput type="number" min="0" max="30" [(ngModel)]="result.games[0].score1">
|
||||
</mat-form-field>
|
||||
</mat-grid-tile>
|
||||
<mat-grid-tile>
|
||||
<mat-form-field appearance="outline" (change)="validateResult()">
|
||||
<input matInput type="number" min="0" max="30" [(ngModel)]="result.games[1].score1">
|
||||
</mat-form-field>
|
||||
</mat-grid-tile>
|
||||
<mat-grid-tile>
|
||||
<mat-form-field appearance="outline" (change)="validateResult()">
|
||||
<input matInput type="number" min="0" max="30" [(ngModel)]="result.games[2].score1">
|
||||
</mat-form-field>
|
||||
</mat-grid-tile>
|
||||
@for (game of result.games; track $index; let i = $index) {
|
||||
<mat-grid-tile>
|
||||
<mat-form-field appearance="outline">
|
||||
<input matInput
|
||||
type="number"
|
||||
min="0"
|
||||
max="30"
|
||||
[(ngModel)]="game.score1"
|
||||
(blur)="complementScores()"
|
||||
(ngModelChange)="validateResult()"
|
||||
[tabindex]="i * 2 + 1">
|
||||
</mat-form-field>
|
||||
</mat-grid-tile>
|
||||
}
|
||||
|
||||
<mat-grid-tile colspan="2">
|
||||
<div class="w-100" [ngClass]="{'winner': validateResult() == -1}">
|
||||
<div class="w-100" [ngClass]="{'winner': isValidResult == -1}">
|
||||
<app-team-display
|
||||
[team]="data.match.team2"
|
||||
[event]="data.event"
|
||||
@@ -54,39 +49,34 @@
|
||||
</app-team-display>
|
||||
</div>
|
||||
</mat-grid-tile>
|
||||
<mat-grid-tile>
|
||||
<mat-form-field appearance="outline" (change)="validateResult()">
|
||||
<input matInput type="number" min="0" max="30" [(ngModel)]="result.games[0].score2">
|
||||
</mat-form-field>
|
||||
</mat-grid-tile>
|
||||
<mat-grid-tile>
|
||||
<mat-form-field appearance="outline" (change)="validateResult()">
|
||||
<input matInput type="number" min="0" max="30" [(ngModel)]="result.games[1].score2">
|
||||
</mat-form-field>
|
||||
</mat-grid-tile>
|
||||
<mat-grid-tile>
|
||||
<mat-form-field appearance="outline" (change)="validateResult()">
|
||||
<input matInput type="number" min="0" max="30" [(ngModel)]="result.games[2].score2">
|
||||
</mat-form-field>
|
||||
</mat-grid-tile>
|
||||
|
||||
<mat-grid-tile>
|
||||
@for (game of result.games; track $index; let i = $index) {
|
||||
<mat-grid-tile>
|
||||
<mat-form-field appearance="outline">
|
||||
<input matInput
|
||||
type="number"
|
||||
min="0"
|
||||
max="30"
|
||||
[(ngModel)]="game.score2"
|
||||
(blur)="complementScores()"
|
||||
(ngModelChange)="validateResult()"
|
||||
[tabindex]="i * 2 + 2">
|
||||
</mat-form-field>
|
||||
</mat-grid-tile>
|
||||
}
|
||||
<mat-grid-tile></mat-grid-tile>
|
||||
<mat-grid-tile></mat-grid-tile>
|
||||
|
||||
@for (gameNum of [1, 2, 3]; track gameNum) {
|
||||
<mat-grid-tile>
|
||||
<button type="button" class="btn btn-primary btn-lg" (click)="set21(2, gameNum)">21</button>
|
||||
</mat-grid-tile>
|
||||
}
|
||||
|
||||
</mat-grid-tile>
|
||||
<mat-grid-tile>
|
||||
</mat-grid-tile>
|
||||
<mat-grid-tile>
|
||||
<button type="button" class="btn btn-primary btn-lg" (click)="set21(2, 1)">21</button>
|
||||
</mat-grid-tile>
|
||||
<mat-grid-tile>
|
||||
<button type="button" class="btn btn-primary btn-lg" (click)="set21(2, 2)">21</button>
|
||||
</mat-grid-tile>
|
||||
<mat-grid-tile>
|
||||
<button type="button" class="btn btn-primary btn-lg" (click)="set21(2, 3)">21</button>
|
||||
</mat-grid-tile>
|
||||
</mat-grid-list>
|
||||
</mat-dialog-content>
|
||||
|
||||
<mat-dialog-actions>
|
||||
<button mat-button (click)="onAnnulerenClick()">Annuleren</button>
|
||||
<button mat-button [disabled]="validateResult() == 0" [mat-dialog-close]="result">Opslaan</button>
|
||||
<button mat-button [disabled]="isValidResult == 0" [mat-dialog-close]="result">Opslaan</button>
|
||||
</mat-dialog-actions>
|
||||
|
||||
Reference in New Issue
Block a user