funky-framadate-front/src/app/features/consultation/poll-results-compact/poll-results-compact.compon...

50 lines
1.8 KiB
HTML

{{ poll.choices.length }} choix
<div
class="box"
*ngFor="let choice of poll.choices"
[ngClass]="{ 'active has-background-success': choice.enabled }"
(click)="choice.enabled = !choice.enabled"
>
<div class="columns is-vcentered is-mobile">
<div class="column">
<label class="label" *ngIf="poll.kind == 'text'">{{ choice.name }} </label>
<label class="label" *ngIf="poll.kind == 'date'">
{{ choice.name }} : {{ choice.name | date: 'short':'Europe/Paris':'fr_FR' }}
</label>
</div>
<div class="column is-narrow">
<span class="max_score" *ngIf="poll.max_score > 0 && choice.score == poll.max_score">
<i class="fa fa-star fa-2x"></i>
</span>
</div>
<div class="column is-narrow">
<button class="button is-white" (click)="openModal(poll, choice)">
<i class="fa fa-info-circle"></i>
</button>
</div>
<div class="column is-narrow">
<div class="buttons has-addons is-right">
<button class="button is-white" (click)="toggleAnswer(choice.id, 'yes')">
<img class="image is-24x24" src="../../../assets/img/icon_voter_YES.svg" />
<span class="counter" *ngIf="choice[answerEnum.YES].count * 1 > 0">
{{ choice[answerEnum.YES].count }}
</span>
</button>
<button class="button is-white" *ngIf="poll.allowed_answers.indexOf('maybe') !== -1">
<img class="image is-24x24" src="../../../assets/img/icon_voter_MAYBE.svg" />
<span class="counter" *ngIf="choice[answerEnum.YES].count * 1 > 0">
{{ choice[answerEnum.MAYBE].count }}
</span>
</button>
<button class="button is-white" *ngIf="poll.allowed_answers.indexOf('no') !== -1">
<img class="image is-24x24" src="../../../assets/img/croix.svg" />
<span class="counter" *ngIf="choice[answerEnum.YES].count * 1 > 0">
{{ choice[answerEnum.NO].count }}
</span>
</button>
</div>
</div>
</div>
</div>