funky-framadate-front/src/app/features/consultation/consultation.component.html

160 lines
4.9 KiB
HTML
Raw Normal View History

2021-11-18 13:00:29 +01:00
<section class="poll_loaded padded consultation" *ngIf="!fetching && poll">
2021-04-26 10:32:42 +02:00
<!-- messages-->
2021-06-07 12:36:49 +02:00
<div class="message is-warning" *ngIf="isArchived">
2021-04-26 10:32:42 +02:00
<div class="message-body">
2022-02-03 10:02:08 +01:00
{{ 'participation.poll_expired' | translate }}
2021-04-26 10:32:42 +02:00
</div>
2021-06-07 12:36:49 +02:00
</div>
<div class="message is-warning" *ngIf="poll && poll.admin_key">
<div class="message-body">
2022-02-03 10:02:08 +01:00
{{ 'participation.you_are_admin' | translate }}
</div>
</div>
2021-06-07 12:36:49 +02:00
<div class="message is-info" *ngIf="poll.modification_policy == 'self'">
<div class="message-body">
2022-02-03 10:02:08 +01:00
{{ 'participation.edit_only_self' | translate }}
</div>
2021-06-07 12:36:49 +02:00
</div>
2021-06-10 10:52:32 +02:00
<router-outlet></router-outlet>
2021-04-26 11:27:44 +02:00
<!-- actions-->
2021-04-26 10:32:42 +02:00
<!-- affichage des possibilités de réponse -->
2021-04-21 12:43:05 +02:00
<div class="columns">
<div class="column">
<div class="card">
2021-06-07 12:36:49 +02:00
<header class="card-header padded">
<div class="columns">
<div class="column">
<p class="card-header-title is-1 title">{{ poll.title }}</p>
<p class="descr">{{ poll.description }}</p>
<div class="voters-count padded">
2022-02-03 10:02:08 +01:00
<i class="fa fa-users"></i> {{ poll.stacks.length }}
{{ 'participation.voters' | translate }}
2021-06-07 12:36:49 +02:00
</div>
2022-02-03 10:02:08 +01:00
<p class="card-header-icon" *ngIf="poll.owner">
{{ 'participation.author' | translate }} {{ poll.owner?.pseudo }}
</p>
2021-06-07 12:36:49 +02:00
</div>
<div class="column">
<app-actions-menu></app-actions-menu>
2021-06-07 12:36:49 +02:00
</div>
</div>
2021-04-21 12:43:05 +02:00
</header>
2021-04-24 12:52:51 +02:00
2021-04-21 12:43:05 +02:00
<div class="card-content">
<div class="content">
2021-11-18 13:00:29 +01:00
<div class="columns">
<div class="column">
<button
class="btn is-info"
(click)="isCompactMode = !isCompactMode"
[ngClass]="{ 'is-primary': isCompactMode, 'is-default': !isCompactMode }"
>
changer d'affichage
</button>
</div>
<div class="column">
2022-02-03 10:02:08 +01:00
<!-- le bouton affiche l'état alternatif possible, et non l'état actuel-->
2021-11-18 13:00:29 +01:00
<div class="buttons has-addons is-small is-right">
<button
class="button"
[class.is-active]="isCompactMode"
(click)="isCompactMode = true"
>
2022-02-03 10:02:08 +01:00
{{ 'participation.mode_detailed' | translate }}
2021-11-18 13:00:29 +01:00
</button>
<button
class="button"
[class.is-active]="!isCompactMode"
(click)="isCompactMode = false"
>
2022-02-03 10:02:08 +01:00
{{ 'participation.mode_compact' | translate }}
2021-11-18 13:00:29 +01:00
</button>
</div>
</div>
2021-04-21 12:43:05 +02:00
</div>
2021-11-18 13:00:29 +01:00
<div class="pseudo-land" *ngIf="isCompactMode && !isArchived">
2021-06-08 10:41:46 +02:00
<label for="vote_pseudo_vote_stack">
Votre pseudo:
</label>
<input
class="is-block"
2021-06-08 10:41:46 +02:00
type="text"
id="vote_pseudo_vote_stack"
[(ngModel)]="storageService.vote_stack.pseudo"
/>
</div>
<app-poll-results-compact *ngIf="isCompactMode" [poll]="poll"></app-poll-results-compact>
2021-04-26 11:27:44 +02:00
<app-poll-results-detailed *ngIf="!isCompactMode" [poll]="poll"></app-poll-results-detailed>
</div>
</div>
2021-06-07 12:36:49 +02:00
<!-- static buttons-->
<div class="padded">
<div class="message is-info" *ngIf="poll.stacks.length == 0">
<div class="message-body">
aucun vote pour le moment
</div>
</div>
<section class="loading_poll" *ngIf="fetching">
<i class="fa fa-spinner fa-4x"></i>
</section>
2021-06-07 12:36:49 +02:00
<button
class="button is-block submit-votestack is-primary"
2021-06-07 12:36:49 +02:00
(click)="addVoteStack()"
2021-11-18 13:00:29 +01:00
*ngIf="(!isArchived && !storageService.vote_stack) || !storageService.vote_stack.id"
2021-06-07 12:36:49 +02:00
>
<i class="fa fa-paper-plane" aria-hidden="true"></i> Envoyer
</button>
<button
class="btn btn--primary btn-block submit-votestack update"
(click)="updateVoteStack()"
*ngIf="storageService.vote_stack && storageService.vote_stack.id"
>
<i class="fa fa-edit" aria-hidden="true"></i> Mettre à jour
</button>
</div>
2021-04-26 11:27:44 +02:00
<div class="columns">
<div class="column">
<app-comments
*ngIf="poll.allow_comments"
[poll]="poll"
[vote_stack]="storageService.vote_stack"
></app-comments>
2021-11-18 13:00:29 +01:00
<div class="alert has-background-info" *ngIf="!poll.allow_comments">
Ce sondage ne permet pas d'ajouter de commentaires
</div>
2020-05-12 19:16:23 +02:00
</div>
</div>
2021-04-26 11:27:44 +02:00
2021-06-07 12:36:49 +02:00
<!-- fixed bottom buttons-->
<div class="bar-votestack" *ngIf="!isArchived">
2021-04-26 11:27:44 +02:00
<button
class="btn btn-block submit-votestack"
(click)="addVoteStack()"
2021-04-29 10:17:13 +02:00
*ngIf="!storageService.vote_stack || !storageService.vote_stack.id"
2021-04-26 11:27:44 +02:00
>
<i class="fa fa-paper-plane" aria-hidden="true"></i> Envoyer
</button>
<button
class="btn btn--primary btn-block submit-votestack update"
2021-06-07 12:16:56 +02:00
(click)="updateVoteStack()"
2021-04-29 10:17:13 +02:00
*ngIf="storageService.vote_stack && storageService.vote_stack.id"
2021-04-26 11:27:44 +02:00
>
<i class="fa fa-edit" aria-hidden="true"></i> Mettre à jour
</button>
</div>
2021-11-18 13:00:29 +01:00
<div class="alert has-background-info" *ngIf="isArchived">
Ce sondage est archivé
</div>
2020-05-12 19:16:23 +02:00
</div>
</div>
2020-06-18 16:15:26 +02:00
</div>
2021-04-21 12:43:05 +02:00
</section>