2020-10-29 18:43:19 +01:00
|
|
|
<div class="admin-form">
|
|
|
|
<h1 i18n>
|
|
|
|
{{ 'creation.title' | translate }}
|
|
|
|
</h1>
|
|
|
|
<span class="pre-selector" i18n>
|
|
|
|
{{ 'creation.want' | translate }}
|
|
|
|
</span>
|
|
|
|
<button class="btn btn--warning">
|
|
|
|
Reset all
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<div class="simple">
|
|
|
|
<form [formGroup]="pollFormGroup">
|
|
|
|
<label for="title">Titre</label>
|
|
|
|
<input
|
|
|
|
#title
|
|
|
|
matInput
|
|
|
|
placeholder="title posée, sujet"
|
|
|
|
formControlName="title"
|
|
|
|
id="title"
|
|
|
|
autofocus="autofocus"
|
|
|
|
(change)="updateSlug()"
|
|
|
|
required
|
|
|
|
/>
|
|
|
|
<button
|
|
|
|
mat-button
|
|
|
|
*ngIf="title.value"
|
|
|
|
matSuffix
|
|
|
|
mat-icon-button
|
|
|
|
aria-label="Clear"
|
|
|
|
(click)="title.value = ''"
|
|
|
|
>
|
|
|
|
<i class="fa fa-close"></i>
|
|
|
|
</button>
|
|
|
|
|
2020-10-31 17:36:54 +01:00
|
|
|
<br />
|
|
|
|
<h2>Choix de réponse</h2>
|
|
|
|
<div formArrayName="choicesFormArray">
|
|
|
|
<h3>Aliases</h3>
|
|
|
|
<button (click)="addChoice()">Add Alias</button>
|
|
|
|
|
|
|
|
<div *ngFor="let choice of choices.controls; let i = index">
|
|
|
|
<!-- The repeated alias template -->
|
|
|
|
<pre class="debug padded warning">
|
|
|
|
choice :
|
|
|
|
{{ choice | json }}
|
|
|
|
</pre
|
|
|
|
>
|
|
|
|
<label>
|
|
|
|
choices:
|
|
|
|
<input type="text" [formControlName]="i" />
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<label for="descr">Description (optionnel)</label>
|
2020-10-29 18:43:19 +01:00
|
|
|
<textarea
|
|
|
|
#description
|
|
|
|
matInput
|
|
|
|
id="descr"
|
|
|
|
placeholder="Description"
|
|
|
|
formControlName="description"
|
|
|
|
required
|
|
|
|
></textarea>
|
|
|
|
<button
|
|
|
|
mat-button
|
|
|
|
*ngIf="description.value"
|
|
|
|
matSuffix
|
|
|
|
mat-icon-button
|
|
|
|
aria-label="Clear"
|
|
|
|
(click)="description.value = ''"
|
|
|
|
>
|
|
|
|
<i class="fa fa-close"></i>
|
|
|
|
</button>
|
2020-10-29 21:30:33 +01:00
|
|
|
<h2>Choix de réponses</h2>
|
|
|
|
<pre class="debug padded warning">
|
|
|
|
choicesFormArray :
|
|
|
|
{{ choicesFormArray | json }}
|
|
|
|
</pre
|
|
|
|
>
|
2020-10-29 18:43:19 +01:00
|
|
|
|
|
|
|
<label for="slug"
|
|
|
|
>Url pour les participants
|
|
|
|
|
|
|
|
<button
|
|
|
|
mat-button
|
|
|
|
*ngIf="slug.value"
|
|
|
|
matSuffix
|
|
|
|
mat-icon-button
|
|
|
|
aria-label="Clear"
|
|
|
|
(click)="slug.value = ''"
|
|
|
|
>
|
|
|
|
<i class="fa fa-close"></i>
|
|
|
|
</button>
|
|
|
|
</label>
|
|
|
|
<br />
|
|
|
|
<span
|
|
|
|
>{{ urlPrefix }}
|
|
|
|
<strong>
|
|
|
|
{{ slug.value }}
|
|
|
|
</strong>
|
|
|
|
</span>
|
|
|
|
<input #slug matInput id="slug" placeholder="Url" formControlName="slug" required />
|
|
|
|
<br />
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="complete" *ngIf="longFormVersionEnabled">
|
|
|
|
<form [formGroup]="configurationFormGroup">
|
2020-10-31 17:36:54 +01:00
|
|
|
<h2>
|
|
|
|
Type de sondage
|
|
|
|
</h2>
|
|
|
|
<button class="btn" [ngClass]="{ 'is-primary': isAboutDate.value }" (click)="isAboutDate = true">
|
|
|
|
Spécial date
|
|
|
|
</button>
|
|
|
|
<button [ngClass]="{ 'is-primary': !isAboutDate.value }" (click)="isAboutDate = false">
|
|
|
|
Classique - textes
|
|
|
|
</button>
|
|
|
|
|
2020-10-29 18:43:19 +01:00
|
|
|
<h2>Version complète du formulaire</h2>
|
|
|
|
<mat-form-field appearance="outline" class="is-flex">
|
|
|
|
<mat-label>Nombre de jours avant expiration</mat-label>
|
|
|
|
<input
|
|
|
|
#expiracy
|
|
|
|
matInput
|
|
|
|
type="number"
|
|
|
|
placeholder="Nombre de jours avant expiration"
|
|
|
|
formControlName="expiracyNumberOfDays"
|
|
|
|
required
|
|
|
|
/>
|
|
|
|
<button
|
|
|
|
mat-button
|
|
|
|
*ngIf="expiracy.value"
|
|
|
|
matSuffix
|
|
|
|
mat-icon-button
|
|
|
|
aria-label="Clear"
|
|
|
|
(click)="expiracy.value = ''"
|
|
|
|
>
|
|
|
|
<i class="fa fa-close"></i>
|
|
|
|
</button>
|
|
|
|
</mat-form-field>
|
|
|
|
<mat-checkbox class="is-flex" formControlName="areResultsPublic">
|
|
|
|
Les participants pourront consulter les résultats
|
|
|
|
</mat-checkbox>
|
|
|
|
<mat-checkbox class="is-flex" formControlName="isAboutDate">
|
|
|
|
Les choix possibles concerneront des dates
|
|
|
|
</mat-checkbox>
|
|
|
|
<mat-checkbox class="is-flex" formControlName="isProtectedByPassword">
|
|
|
|
Le sondage sera protégé par un mot de passe
|
|
|
|
</mat-checkbox>
|
|
|
|
<mat-checkbox class="is-flex" formControlName="isOwnerNotifiedByEmailOnNewVote">
|
|
|
|
Vous recevrez un mail à chaque nouvelle participation
|
|
|
|
</mat-checkbox>
|
|
|
|
<mat-checkbox class="is-flex" formControlName="isOwnerNotifiedByEmailOnNewComment">
|
|
|
|
Vous recevrez un mail à chaque nouveau commentaire
|
|
|
|
</mat-checkbox>
|
|
|
|
<mat-checkbox class="is-flex" formControlName="isMaybeAnswerAvailable">
|
|
|
|
La réponse « peut-être » sera disponible
|
|
|
|
</mat-checkbox>
|
|
|
|
|
|
|
|
<button
|
|
|
|
mat-button
|
|
|
|
(click)="createPoll()"
|
|
|
|
[disabled]="!pollFormGroup.valid || !configurationFormGroup.valid"
|
|
|
|
>
|
|
|
|
Enregistrer le sondage
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<pre class="debug padded warning">
|
|
|
|
poll :
|
|
|
|
{{ poll | json }}
|
|
|
|
</pre
|
|
|
|
>
|
|
|
|
</div>
|