wahlrecht-frontend/src/app/elections/election/election.component.html

66 lines
3.0 KiB
HTML

<h1 class="mat-headline-5">{{viewModel.election.name}}</h1>
<app-election-result [electedCandidates]="electedCandidates" [parties]="viewModel.parties"></app-election-result>
<button class="mt-2" mat-raised-button i18n #calculateButton (keyup.enter)="onCalculate()" (click)="onCalculate()">
<mat-spinner class="spinner" *ngIf="showSpinner"></mat-spinner>
Calculate
</button>
<form [formGroup]="form">
<mat-tab-group>
<mat-tab i18n-label label="Overall results"
formGroupName="overallResults">
<mat-tab-group>
<mat-tab *ngFor="let overallResult of viewModel.electionResult.overallResults"
label="{{overallResult.partyAbbreviation}}"
formGroupName="{{overallResult.partyAbbreviation}}">
<mat-form-field>
<mat-label i18n>Votes on nomination</mat-label>
<input matInput type="number" formControlName="votesOnNomination"
value="{{overallResult.votesOnNomination}}">
</mat-form-field>
<mat-form-field>
<mat-label i18n>Votes through healing</mat-label>
<input matInput type="number" formControlName="votesThroughHealing"
value="{{overallResult.votesThroughHealing}}">
</mat-form-field>
<div formArrayName="votesPerPosition">
<mat-form-field *ngFor="let entry of overallResult.votesPerPosition | keyvalue: keyAscOrder">
<mat-label>{{entry.key}}
: {{getCandidateNameOverall(overallResult.partyAbbreviation, +entry.key)}}</mat-label>
<input matInput type="number" value="{{entry.value}}" [formControlName]="entry.key">
</mat-form-field>
</div>
</mat-tab>
</mat-tab-group>
</mat-tab>
<mat-tab i18n-label label="Constituency results"
formGroupName="constituencyResults">
<mat-tab-group>
<mat-tab *ngFor="let constituency of getConstituencies()"
label="{{constituency.name}}"
formGroupName="{{constituency.name}}">
<mat-tab-group>
<mat-tab
*ngFor="let constituencyResult of getConstituencyResults(constituency.number)"
label="{{constituencyResult.partyAbbreviation}}"
formGroupName="{{constituencyResult.partyAbbreviation}}">
<div formArrayName="votesPerPosition">
<mat-form-field
*ngFor="let entry of constituencyResult.votesPerPosition | keyvalue: keyAscOrder">
<mat-label>{{entry.key}}
: {{getCandidateNameConstituency(constituency.number, constituencyResult.partyAbbreviation, +entry.key)}}
</mat-label>
<input matInput type="number" value="{{entry.value}}" [formControlName]="entry.key">
</mat-form-field>
</div>
</mat-tab>
</mat-tab-group>
</mat-tab>
</mat-tab-group>
</mat-tab>
</mat-tab-group>
</form>