Sengi-Windows-MacOS-Linux/src/app/components/stream/status/poll/poll.component.html

30 lines
2.0 KiB
HTML
Raw Normal View History

2019-06-03 07:33:07 +02:00
<div class="poll">
2019-06-05 06:06:29 +02:00
<div *ngIf="!poll.voted && !poll.expired">
<div *ngFor="let o of options">
2019-06-15 20:58:24 +02:00
<label class="poll__container">
<span class="poll__container__title">{{o.title}}</span>
2019-06-05 06:06:29 +02:00
<input class="poll__container__input" type="{{choiceType}}" name="{{pollName}}" value="{{o.title}}"
(change)="onSelectionChange(o)">
2019-06-12 05:49:54 +02:00
<span class="poll__container__checkmark" *ngIf="!pollLocked"
2019-06-05 06:06:29 +02:00
[ngClass]="{'poll__container__checkmark--box' : choiceType=='checkbox', 'poll__container__checkmark--round': choiceType=='radio'}"></span>
2019-06-12 05:49:54 +02:00
<fa-icon *ngIf="pollLocked" class="poll__container__lock" title="Account can't access this poll" [icon]="faLock"></fa-icon>
2019-06-05 06:06:29 +02:00
</label>
</div>
</div>
<div *ngIf="poll.voted || poll.expired">
<div *ngFor="let o of options">
2019-06-06 07:38:32 +02:00
<div class="poll__result" title="{{ o.votes_count }} votes">
<div class="poll__result--progress-bar" [style.width]="o.percentage + '%'" [ngClass]="{ 'poll__result--progress-bar--most-votes': o.isMax }"></div>
<div class="poll__result--data"> <span class="poll__result--percentage">{{ o.percentage }}%</span>
2019-06-15 20:58:24 +02:00
<span class="poll__container__title">{{o.title}}</span></div>
2019-06-06 07:38:32 +02:00
2019-06-05 06:06:29 +02:00
</div>
</div>
2019-06-05 00:36:04 +02:00
</div>
<div class="poll__voting">
2019-06-12 05:49:54 +02:00
<button href *ngIf="!poll.voted && !poll.expired && !pollLocked" class="btn btn-sm btn-custom-primary poll__btn-vote"
2019-06-06 07:38:32 +02:00
title="don't boo, vote!" (click)="vote()">Vote</button>
2019-06-12 05:49:54 +02:00
<a href class="poll__refresh" *ngIf="(poll.voted || poll.expired) && !pollLocked" title="refresh poll" (click)="refresh()">refresh</a>
<div class="poll__statistics"><span *ngIf="(poll.voted || poll.expired) && !pollLocked" class="poll__separator">·</span>{{poll.votes_count}} votes<span *ngIf="!poll.expired" class="poll__separator" title="{{ poll.expires_at | timeLeft | async }}">· {{ poll.expires_at | timeLeft | async }}</span></div>
2019-06-03 07:33:07 +02:00
</div>
</div>