<div *ngIf="data">
    <div class="slidetitle">
        <h1>{{ data.data.title }}</h1>
        <h2 translate>Election result</h2>
    </div>

    <div class="spacer-top-10"></div>
    <div *ngIf="!data.data.poll.published"><span translate>Waiting for results</span><span>...</span></div>
    <div *ngIf="data.data.poll.published">
        <div *ngIf="data.data.poll.has_votes" class="result-table">
            <div class="row">
                <div class="option-name heading">
                    <h3 translate>Candidates</h3>
                </div>
                <div class="option-percents heading">
                    <h3 translate>Votes</h3>
                </div>
            </div>
            <div *ngFor="let option of data.data.poll.options">
                <div class="row">
                    <div class="option-name">
                        <span class="bold">{{ option.user }}</span>
                        <mat-icon *ngIf="option.is_elected">star</mat-icon>
                    </div>
                    <div class="option-percents">
                        <div *ngFor="let vote of option.votes" class="bold">
                            <span *ngIf="vote.value !== 'Votes'">{{ getLabel(vote.value) }}:</span>
                            <span> {{ getVotePercent(vote.value, option) }}</span>
                        </div>
                    </div>
                </div>
            </div>
            <div *ngFor="let value of pollValues" class="row">
                <div class="option-name grey">
                    <span>{{ getLabel(value) }}</span>
                </div>
                <div class="option-percents grey">
                    {{ getPollPercent(value) }}
                </div>
            </div>
        </div>
    </div>
</div>
