display detailled array of answers

This commit is contained in:
Tykayn 2021-06-10 12:35:14 +02:00 committed by tykayn
parent 13dbe0f89b
commit adc7c255d8
2 changed files with 14 additions and 11 deletions

View File

@ -15,7 +15,7 @@ import { ToastService } from '../../core/services/toast.service';
styleUrls: ['./consultation.component.scss'],
})
export class ConsultationComponent implements OnInit, OnDestroy {
public isCompactMode = true;
public isCompactMode = false;
public poll: Poll;
public pollSlug: string;
public pass_hash: string;

View File

@ -6,7 +6,10 @@
</th>
<th *ngFor="let choice of poll.choices">
<!-- {{choice.id}}-->
<span class="label" *ngIf="poll.kind == 'text'">{{ choice.name }} </span>
<span class="label" *ngIf="poll.kind == 'text'">
{{ choice.id }}
{{ choice.name }}
</span>
<span class="label" *ngIf="poll.kind == 'date'">
{{ make_date(choice.name) | date: 'fullDate':'Europe/Paris':'fr_FR' }}
</span>
@ -26,8 +29,11 @@
<td>
Favori
</td>
<td *ngFor="let choice of poll.choices">
<span class="max_score" *ngIf="poll.max_score > 0 && choice.score == poll.max_score">
<td
*ngFor="let choice of poll.choices"
[ngClass]="{ 'background-yes': poll.max_score > 0 && choice.score == poll.max_score }"
>
<span class="max_score background-yes" *ngIf="poll.max_score > 0 && choice.score == poll.max_score">
<i class="fa fa-star fa-2x"></i>
</span>
</td>
@ -47,13 +53,10 @@
<sub> le {{ stack.created_at | date: 'short':'Europe/Paris':'fr_FR' }} </sub>
</div>
</td>
<ng-container *ngFor="let item of poll.choices">
<td *ngIf="!stackHasVotesForChoice(stack, item.id)"></td>
<td
*ngIf="stackHasVotesForChoice(stack, item.id)"
class="stack-vote background-{{ getValue(stack, item.id) }}"
>
{{ getValue(stack, item.id) }}
<ng-container *ngFor="let vote of stack.votes">
<td *ngIf="vote.value" class="stack-vote background-{{ vote.value }}">
{{ vote.choice_id }})
{{ vote.value }}
</td>
</ng-container>
</tr>