|
|
|
@ -13,25 +13,27 @@
|
|
|
|
|
<span class="pre-selector">
|
|
|
|
|
{{ 'creation.want' | translate }}
|
|
|
|
|
</span>
|
|
|
|
|
<div class="kind-of-poll">
|
|
|
|
|
<h1 class="title is-1">
|
|
|
|
|
<i class="fa fa-calendar" aria-hidden="true"></i> {{ 'dates.title' | translate }}
|
|
|
|
|
</h1>
|
|
|
|
|
<button
|
|
|
|
|
class="btn"
|
|
|
|
|
[ngClass]="{ 'is-primary': form.controls.isAboutDate.value }"
|
|
|
|
|
(click)="form.controls.isAboutDate.setValue(true)"
|
|
|
|
|
>
|
|
|
|
|
<i class="fa fa-calendar"></i>
|
|
|
|
|
{{ 'creation.kind.date' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
[ngClass]="{ 'is-primary': !form.controls.isAboutDate.value }"
|
|
|
|
|
(click)="form.controls.isAboutDate.setValue(false)"
|
|
|
|
|
>
|
|
|
|
|
<i class="fa fa-stats"></i>
|
|
|
|
|
{{ 'creation.kind.classic' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<div class="kind-of-poll columns">
|
|
|
|
|
<div class="column">
|
|
|
|
|
<button
|
|
|
|
|
class="btn-block btn"
|
|
|
|
|
[ngClass]="{ 'is-primary': form.controls.isAboutDate.value }"
|
|
|
|
|
(click)="form.controls.isAboutDate.setValue(true)"
|
|
|
|
|
>
|
|
|
|
|
<i class="fa fa-calendar"></i>
|
|
|
|
|
{{ 'creation.kind.date' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="column">
|
|
|
|
|
<button
|
|
|
|
|
class="btn-block btn btn-default"
|
|
|
|
|
[ngClass]="{ 'is-primary': !form.controls.isAboutDate.value }"
|
|
|
|
|
(click)="form.controls.isAboutDate.setValue(false)"
|
|
|
|
|
>
|
|
|
|
|
<i class="fa fa-stats"></i>
|
|
|
|
|
{{ 'creation.kind.classic' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<span>
|
|
|
|
@ -60,8 +62,22 @@
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<fieldset class="date-kind">
|
|
|
|
|
<!-- choix spécialement pour les dates-->
|
|
|
|
|
</fieldset>
|
|
|
|
|
<div class="form-field">
|
|
|
|
|
<h2>Choix de réponse</h2>
|
|
|
|
|
<h2>
|
|
|
|
|
{{ 'choices.title' | translate }}
|
|
|
|
|
</h2>
|
|
|
|
|
{{ 'dates.add' | translate }}
|
|
|
|
|
<p>
|
|
|
|
|
<i>
|
|
|
|
|
{{ 'choices.helper' | translate }}
|
|
|
|
|
</i>
|
|
|
|
|
</p>
|
|
|
|
|
{{ 'choices.answer_preset_1' | translate }}
|
|
|
|
|
{{ 'choices.add' | translate }}
|
|
|
|
|
{{ 'choices.continue' | translate }}
|
|
|
|
|
<span>
|
|
|
|
|
<span class="columns">
|
|
|
|
|
<span class="column">
|
|
|
|
@ -81,19 +97,19 @@
|
|
|
|
|
<span *ngFor="let choice of choices.controls; let i = index">
|
|
|
|
|
<div class="form-row" [formGroup]="choice">
|
|
|
|
|
<div class="columns">
|
|
|
|
|
<div class="column">{{ i * 1 + 1 }})</div>
|
|
|
|
|
<div class="column">
|
|
|
|
|
<button class="btn btn-warning" (click)="deleteChoiceField(i)">
|
|
|
|
|
<i class="fa fa-times"></i>
|
|
|
|
|
</button>
|
|
|
|
|
{{ i * 1 + 1 }})
|
|
|
|
|
</div>
|
|
|
|
|
<div class="column">
|
|
|
|
|
<label for="label" class="hidden">label</label>
|
|
|
|
|
<input formControlName="label" id="label" placeholder="Enter a choice description" />
|
|
|
|
|
<br />
|
|
|
|
|
<label for="imageUrl" class="imageUrl">image Url</label>
|
|
|
|
|
<label for="imageUrl" class="hidden">image Url</label>
|
|
|
|
|
<input formControlName="imageUrl" id="imageUrl" placeholder="URL de l' image" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="column">
|
|
|
|
|
<button class="btn btn-warning" (click)="deleteChoiceField(i)">
|
|
|
|
|
<i class="fa fa-times"></i>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</span>
|
|
|
|
@ -101,7 +117,17 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<label class="hidden" for="creatorEmail">creator email</label>
|
|
|
|
|
<label class="" for="creatorEmail">
|
|
|
|
|
<span>
|
|
|
|
|
{{ 'creation.name' | translate }}
|
|
|
|
|
</span>
|
|
|
|
|
</label>
|
|
|
|
|
<label class="hidden" for="creatorPseudo">
|
|
|
|
|
<span>
|
|
|
|
|
{{ 'creation.email' | translate }}
|
|
|
|
|
</span>
|
|
|
|
|
</label>
|
|
|
|
|
<input #title matInput placeholder="pseudo" formControlName="creatorPseudo" id="creatorPseudo" required />
|
|
|
|
|
<input
|
|
|
|
|
#title
|
|
|
|
|
matInput
|
|
|
|
@ -111,116 +137,103 @@
|
|
|
|
|
required
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<label class="hidden" for="selector">kind</label>
|
|
|
|
|
<select formControlName="isAboutDate" id="selector">
|
|
|
|
|
<option value="true" name="polltype_date">
|
|
|
|
|
{{ 'creation.kind.date' | translate }}
|
|
|
|
|
</option>
|
|
|
|
|
<option value="false" name="polltype_classic">
|
|
|
|
|
{{ 'creation.kind.classic' | translate }}
|
|
|
|
|
</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
|
<label for="descr">Description (optionnel)</label>
|
|
|
|
|
<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 class="btn is-info" (click)="advancedDisplayEnabled = !advancedDisplayEnabled">
|
|
|
|
|
<i class="fa fa-save"></i>
|
|
|
|
|
{{ 'creation.advanced' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<hr />
|
|
|
|
|
|
|
|
|
|
<label for="slug"
|
|
|
|
|
>Url pour les participants
|
|
|
|
|
|
|
|
|
|
<fieldset class="complete well" *ngIf="advancedDisplayEnabled">
|
|
|
|
|
<h2>{{ 'creation.advanced' | translate }}</h2>
|
|
|
|
|
<label for="descr">Description (optionnel)</label>
|
|
|
|
|
<textarea
|
|
|
|
|
#description
|
|
|
|
|
matInput
|
|
|
|
|
id="descr"
|
|
|
|
|
placeholder="Description"
|
|
|
|
|
formControlName="description"
|
|
|
|
|
required
|
|
|
|
|
></textarea>
|
|
|
|
|
<button
|
|
|
|
|
mat-button
|
|
|
|
|
*ngIf="slug.value"
|
|
|
|
|
*ngIf="description.value"
|
|
|
|
|
matSuffix
|
|
|
|
|
mat-icon-button
|
|
|
|
|
aria-label="Clear"
|
|
|
|
|
(click)="slug.value = ''"
|
|
|
|
|
(click)="description.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 />
|
|
|
|
|
<h2>Version complète du formulaire</h2>
|
|
|
|
|
<div appearance="outline" class="is-flex">
|
|
|
|
|
<mat-label>Nombre de jours avant expiration</mat-label>
|
|
|
|
|
<input
|
|
|
|
|
#expiracy
|
|
|
|
|
id="expiracy"
|
|
|
|
|
matInput
|
|
|
|
|
type="number"
|
|
|
|
|
placeholder="Nombre de jours avant expiration"
|
|
|
|
|
formControlName="expiracyNumberOfDays"
|
|
|
|
|
required
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
<label for="slug"
|
|
|
|
|
>Url pour les participants
|
|
|
|
|
|
|
|
|
|
<i class="fa fa-close"></i>
|
|
|
|
|
</label>
|
|
|
|
|
<br />
|
|
|
|
|
<span
|
|
|
|
|
>{{ urlPrefix }}
|
|
|
|
|
<strong>
|
|
|
|
|
{{ form.controls.slug.value }}
|
|
|
|
|
</strong>
|
|
|
|
|
</span>
|
|
|
|
|
<button
|
|
|
|
|
mat-button
|
|
|
|
|
*ngIf="expiracy.value"
|
|
|
|
|
*ngIf="form.controls.slug.value"
|
|
|
|
|
matSuffix
|
|
|
|
|
mat-icon-button
|
|
|
|
|
aria-label="Clear"
|
|
|
|
|
(click)="expiracy.value = ''"
|
|
|
|
|
>
|
|
|
|
|
<i class="fa fa-close"></i>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<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 class="btn is-info" (click)="advancedDisplayEnabled = !advancedDisplayEnabled">
|
|
|
|
|
<i class="fa fa-save"></i>
|
|
|
|
|
Options avancées
|
|
|
|
|
</button>
|
|
|
|
|
<div class="columns">
|
|
|
|
|
<div class="column">
|
|
|
|
|
<span class="complete well" *ngIf="advancedDisplayEnabled">
|
|
|
|
|
version longue du formulaire activée
|
|
|
|
|
</span>
|
|
|
|
|
(click)="slug.value = ''"
|
|
|
|
|
></button>
|
|
|
|
|
<input #slug matInput id="slug" placeholder="Url" formControlName="slug" required />
|
|
|
|
|
<br />
|
|
|
|
|
<div appearance="outline" class="is-not-flex">
|
|
|
|
|
<mat-label>Nombre de jours avant expiration</mat-label>
|
|
|
|
|
<input
|
|
|
|
|
#expiracy
|
|
|
|
|
id="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>
|
|
|
|
|
</div>
|
|
|
|
|
<mat-checkbox class="is-not-flex" formControlName="areResultsPublic">
|
|
|
|
|
Les participants pourront consulter les résultats
|
|
|
|
|
</mat-checkbox>
|
|
|
|
|
<mat-checkbox class="is-not-flex" formControlName="isAboutDate">
|
|
|
|
|
Les choix possibles concerneront des dates
|
|
|
|
|
</mat-checkbox>
|
|
|
|
|
<mat-checkbox class="is-not-flex" formControlName="isProtectedByPassword">
|
|
|
|
|
Le sondage sera protégé par un mot de passe
|
|
|
|
|
</mat-checkbox>
|
|
|
|
|
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewVote">
|
|
|
|
|
Vous recevrez un mail à chaque nouvelle participation
|
|
|
|
|
</mat-checkbox>
|
|
|
|
|
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewComment">
|
|
|
|
|
Vous recevrez un mail à chaque nouveau commentaire
|
|
|
|
|
</mat-checkbox>
|
|
|
|
|
<mat-checkbox class="is-not-flex" formControlName="isMaybeAnswerAvailable">
|
|
|
|
|
La réponse « peut-être » sera disponible
|
|
|
|
|
</mat-checkbox>
|
|
|
|
|
</fieldset>
|
|
|
|
|
<div class="columns">
|
|
|
|
|
<div class="column"></div>
|
|
|
|
|
<div class="column">
|
|
|
|
|
<button class="btn is-success" (click)="createPoll()" [disabled]="!form.valid || !form.valid">
|
|
|
|
|
<i class="fa fa-save"></i>
|
|
|
|
|