unoffical wafrn mirror wafrn.net
atproto social-network activitypub
at angular21 35 lines 1.2 kB view raw
1<form [formGroup]="form"> 2 @if (poll().multiChoice) { 3 @for (option of poll().questionPollQuestions; track $index) { 4 <div class="w-full"> 5 <mat-checkbox [formControlName]="option.id">{{ option.questionText }}</mat-checkbox> 6 <mat-progress-bar 7 mode="determinate" 8 color="primary" 9 [value]="(option.remoteReplies * 100) / total" 10 ></mat-progress-bar> 11 </div> 12 } 13 } @else { 14 <mat-radio-group 15 aria-labelledby="example-radio-group-label" 16 class="example-radio-group" 17 formControlName="singleValue" 18 > 19 @for (option of poll().questionPollQuestions; track $index) { 20 <div class="w-full"> 21 <mat-radio-button [value]="option.id">{{ option.questionText }}</mat-radio-button> 22 <mat-progress-bar 23 mode="determinate" 24 color="primary" 25 [value]="(option.remoteReplies * 100) / total" 26 ></mat-progress-bar> 27 </div> 28 } 29 </mat-radio-group> 30 } 31</form> 32 33@if (!alreadyVoted && this.loginService.loggedIn.value && this.openPoll) { 34 <button mat-flat-button color="primary" class="w-full mt-2" [disabled]="!form.valid" (click)="vote()"> Vote </button> 35}