forked from tykayn/funky-framadate-front
info in modal
This commit is contained in:
parent
9a4a72a24c
commit
729dac9599
@ -14,7 +14,7 @@ import { Comment } from '../../core/models/comment.model';
|
||||
styleUrls: ['./consultation.component.scss'],
|
||||
})
|
||||
export class ConsultationComponent implements OnInit, OnDestroy {
|
||||
public isCompactMode = false;
|
||||
public isCompactMode = true;
|
||||
public poll: Poll;
|
||||
public pollSlug: string;
|
||||
public passHash: string;
|
||||
|
@ -18,7 +18,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="column is-narrow">
|
||||
<button class="button is-white" (click)="openModal(choice)">
|
||||
<button class="button is-white" (click)="openModal(poll, choice)">
|
||||
<i class="fa fa-info-circle"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -22,8 +22,8 @@ export class PollResultsCompactComponent implements OnInit {
|
||||
console.log('this.poll', this.poll);
|
||||
}
|
||||
|
||||
public openModal(choice: Choice): void {
|
||||
const config: MatDialogConfig<Choice> = { data: choice };
|
||||
public openModal(poll: Poll, choice: Choice): void {
|
||||
const config: MatDialogConfig<any> = { data: choice };
|
||||
this.modalService.openModal<ChoiceDetailsComponent, Choice>(ChoiceDetailsComponent, config);
|
||||
}
|
||||
}
|
||||
|
@ -1,34 +1,32 @@
|
||||
<div class="columns is-mobile">
|
||||
<div class="column">
|
||||
<table class="table is-narrow is-fullwidth">
|
||||
<h1 class="title is-1">Détail des réponses pour "{{ choice.name }}"</h1>
|
||||
<hr />
|
||||
<table class="is-fullwidth">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="is-flex">
|
||||
<img class="image is-24x24" src="../../../assets/img/icon_voter_YES.svg" />
|
||||
{{ choice.counts.get(answerEnum.YES) }}
|
||||
</th>
|
||||
<th>oui</th>
|
||||
<th>peut être</th>
|
||||
<th>non</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let user of choice.participants.get(answerEnum.YES)">
|
||||
<td>{{ user.pseudo }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="column">
|
||||
<table class="table is-narrow is-fullwidth">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="is-flex">
|
||||
<img class="image is-24x24" src="../../../assets/img/icon_voter_MAYBE.svg" />
|
||||
{{ choice.counts.get(answerEnum.MAYBE) }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let user of choice.participants.get(answerEnum.MAYBE)">
|
||||
<td>{{ user.pseudo }}</td>
|
||||
<td>
|
||||
<div class="pseudo" *ngFor="let people of choice.yes.people">
|
||||
{{ people }}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="pseudo" *ngFor="let people of choice.maybe.people">
|
||||
{{ people }}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="pseudo" *ngFor="let people of choice.no.people">
|
||||
{{ people }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -3,6 +3,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
import { Answer } from '../../../core/enums/answer.enum';
|
||||
import { Choice } from '../../../core/models/choice.model';
|
||||
import { Poll } from '../../../core/models/poll.model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-choice-details',
|
||||
@ -14,7 +15,8 @@ export class ChoiceDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<ChoiceDetailsComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public choice: Choice
|
||||
@Inject(MAT_DIALOG_DATA) public choice: Choice,
|
||||
@Inject(MAT_DIALOG_DATA) public poll: Poll
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
Loading…
Reference in New Issue
Block a user