forked from tykayn/funky-framadate-front
display all on creation
This commit is contained in:
parent
1d8aeb2f54
commit
d7eac8d56c
@ -1,7 +1,8 @@
|
||||
<form [formGroup]="form">
|
||||
<form [formGroup]="form" class="box">
|
||||
<fieldset class="complete well">
|
||||
<h2>{{ 'creation.advanced' | translate }}</h2>
|
||||
<label for="descr">Description (optionnel)</label>
|
||||
<br />
|
||||
<textarea
|
||||
#description
|
||||
matInput
|
||||
@ -23,41 +24,32 @@
|
||||
|
||||
<br />
|
||||
|
||||
<label for="slug">
|
||||
<label for="custom_url">
|
||||
Url personnalisée pour les participants
|
||||
<i class="fa fa-close"></i>
|
||||
</label>
|
||||
<br />
|
||||
<span
|
||||
>{{ urlPrefix }}
|
||||
<strong>
|
||||
{{ form.controls.custom_url.value }}
|
||||
</strong>
|
||||
</span>
|
||||
<app-copy-text [textToCopy]="form.controls.custom_url.value"></app-copy-text>
|
||||
|
||||
<button
|
||||
mat-button
|
||||
*ngIf="form.controls.custom_url.value"
|
||||
matSuffix
|
||||
mat-icon-button
|
||||
aria-label="Clear"
|
||||
(click)="slug.value = ''"
|
||||
(click)="form.patchValue({ custom_url: '' })"
|
||||
></button>
|
||||
<input #slug matInput id="slug" placeholder="Url" formControlName="slug" required />
|
||||
<input #custom_url matInput id="custom_url" placeholder="Url" formControlName="custom_url" required />
|
||||
<br />
|
||||
<div appearance="outline" class="is-not-flex">
|
||||
<mat-label
|
||||
>Nombre de jours avant expiration de la possibilité de voter, après le sondage reste
|
||||
consultable</mat-label
|
||||
>
|
||||
>Nombre de jours avant expiration de la possibilité de voter, après le sondage reste consultable
|
||||
</mat-label>
|
||||
<input
|
||||
#expiresDaysDelay
|
||||
id="expiresDaysDelay"
|
||||
matInput
|
||||
type="number"
|
||||
placeholder="Nombre de jours avant fin des votes"
|
||||
formControlName="expiracyNumberOfDays"
|
||||
formControlName="expiresDaysDelay"
|
||||
required
|
||||
/>
|
||||
<button
|
||||
@ -71,30 +63,6 @@
|
||||
<i class="fa fa-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div appearance="outline" class="is-not-flex">
|
||||
<mat-label
|
||||
>Nombre de jours avant archivage, après quoi le sondage n'est plus visible par le public</mat-label
|
||||
>
|
||||
<input
|
||||
#archive
|
||||
id="archive"
|
||||
matInput
|
||||
type="number"
|
||||
placeholder="Nombre de jours avant archivage"
|
||||
formControlName="archiveNumberOfDays"
|
||||
required
|
||||
/>
|
||||
<button
|
||||
mat-button
|
||||
*ngIf="archive.value"
|
||||
matSuffix
|
||||
mat-icon-button
|
||||
aria-label="Clear"
|
||||
(click)="archive.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>
|
||||
@ -119,7 +87,7 @@
|
||||
/>
|
||||
|
||||
<h3 class="title is-3">
|
||||
<i class="fa fa-enveloppe"></i>
|
||||
<i class="fa fa-envelope-open"></i>
|
||||
Notifications
|
||||
</h3>
|
||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewVote">
|
||||
@ -128,19 +96,29 @@
|
||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewComment">
|
||||
Vous recevrez un mail à chaque nouveau commentaire
|
||||
</mat-checkbox>
|
||||
<h3 class="title is-3">
|
||||
<i class="fa fa-check-square"></i>
|
||||
Réponses proposées
|
||||
</h3>
|
||||
|
||||
<img class="image is-24x24 pull-right" src="assets/img/icon_voter_YES.svg" />
|
||||
<img class="image is-24x24 pull-right" src="assets/img/icon_voter_MAYBE.svg" />
|
||||
<img class="image is-24x24 pull-right" src="assets/img/icon_voter_NO.svg" />
|
||||
|
||||
<mat-checkbox class="is-not-flex" formControlName="isYesAnswerAvailable">
|
||||
La réponse « oui » sera disponible
|
||||
</mat-checkbox>
|
||||
<mat-checkbox class="is-not-flex" formControlName="isMaybeAnswerAvailable">
|
||||
La réponse « peut-être » sera disponible
|
||||
</mat-checkbox>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<h2>
|
||||
Fonctionnalités pas encore disponibles:
|
||||
</h2>
|
||||
<app-wip-todo></app-wip-todo>
|
||||
<mat-checkbox class="is-not-flex" formControlName="isProtectedByPassword">
|
||||
Spécifier un lien unique de vote à des participants définis
|
||||
<mat-checkbox class="is-not-flex" formControlName="isNoAnswerAvailable">
|
||||
La réponse « non » sera disponible
|
||||
</mat-checkbox>
|
||||
|
||||
<h3 class="title is-3">
|
||||
<i class="fa fa-user-secret"></i>
|
||||
Restrictions visiteurs
|
||||
</h3>
|
||||
<mat-checkbox class="is-not-flex" formControlName="allowComments">
|
||||
Autoriser les commentaires
|
||||
</mat-checkbox>
|
||||
@ -157,7 +135,29 @@
|
||||
formControlName="maxCountOfAnswers"
|
||||
required
|
||||
/>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<h2 class="title is-2">
|
||||
<i class="fa fa-wikidata"></i>
|
||||
Fonctionnalités pas encore disponibles:
|
||||
</h2>
|
||||
<app-wip-todo></app-wip-todo>
|
||||
|
||||
<div>
|
||||
<mat-checkbox class="is-not-flex" formControlName="isProtectedByPassword">
|
||||
Spécifier un lien unique de vote à des participants définis
|
||||
</mat-checkbox>
|
||||
<p>
|
||||
lister les email des participants et leur fournir un lien unique pour voter à chacun, au lieu d'un lien
|
||||
avec une clé permettant de voter pour n'importe qui ayant le lien. Nécessite: évolution de la BDD et de
|
||||
l'API
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<mat-checkbox class="is-not-flex" formControlName="allowNewDateTime">
|
||||
Permettre au public de proposer un créneau de vote supplémentaire
|
||||
</mat-checkbox>
|
||||
<mat-checkbox class="is-not-flex" formControlName="isZeroKnoledge">
|
||||
Les informations du sondage seront chiffrés en base de données
|
||||
</mat-checkbox>
|
||||
|
@ -0,0 +1,3 @@
|
||||
.title {
|
||||
margin-top: 2em;
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Poll } from '../../../../core/models/poll.model';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-advanced-config',
|
||||
@ -9,6 +10,7 @@ import { FormGroup } from '@angular/forms';
|
||||
})
|
||||
export class AdvancedConfigComponent implements OnInit {
|
||||
public urlPrefix = '/participation/';
|
||||
public environment = environment;
|
||||
@Input()
|
||||
public poll?: Poll;
|
||||
@Input()
|
||||
|
@ -29,12 +29,13 @@
|
||||
Ce champ est requis
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<label for="creatorPseudo">
|
||||
<span>
|
||||
{{ 'creation.email' | translate }}
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<br />
|
||||
<input
|
||||
#creatorEmail
|
||||
matInput
|
||||
|
@ -8,14 +8,18 @@
|
||||
</h1>
|
||||
</div>
|
||||
</header>
|
||||
<button class="btn is-success is-fixed-bottom" (click)="createPoll()" *ngIf="!environment.production">
|
||||
<i class="fa fa-save"></i>
|
||||
Enregistrer le sondage (sans vérifier)
|
||||
</button>
|
||||
<main class="columns">
|
||||
<div class="column">
|
||||
<p class="label is-medium">
|
||||
{{ 'creation.want' | translate }}
|
||||
</p>
|
||||
<!-- <div class="step-choices" *ngIf="currentStep === 'base'">-->
|
||||
<!-- <app-kind-select [form]="form"></app-kind-select>-->
|
||||
<!-- <app-base-config [form]="form"></app-base-config>-->
|
||||
<app-kind-select [form]="form"></app-kind-select>
|
||||
<app-base-config [form]="form"></app-base-config>
|
||||
<!-- </div>-->
|
||||
<!-- <div class="step-choices" *ngIf="currentStep === 'choices'"> </div>-->
|
||||
<app-date-select *ngIf="form.value && form.value.kind == 'date'" [form]="form"></app-date-select>
|
||||
@ -73,7 +77,7 @@
|
||||
<i class="fa fa-save"></i>
|
||||
Enregistrer le sondage (vérifier la validité)
|
||||
</button>
|
||||
<button class="btn is-success is-fixed-bottom" (click)="createPoll()">
|
||||
<button class="btn is-success is-fixed-bottom" (click)="createPoll()" *ngIf="!environment.production">
|
||||
<i class="fa fa-save"></i>
|
||||
Enregistrer le sondage (sans vérifier)
|
||||
</button>
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { ChangeDetectorRef, Component, Inject, Input, OnInit } from '@angular/core';
|
||||
import { Poll } from '../../../core/models/poll.model';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { UuidService } from '../../../core/services/uuid.service';
|
||||
import { ApiService } from '../../../core/services/api.service';
|
||||
import { ToastService } from '../../../core/services/toast.service';
|
||||
import { PollService } from '../../../core/services/poll.service';
|
||||
@ -9,7 +8,6 @@ import { DOCUMENT } from '@angular/common';
|
||||
import { Router } from '@angular/router';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { PollUtilitiesService } from '../../../core/services/poll.utilities.service';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { StorageService } from '../../../core/services/storage.service';
|
||||
|
||||
@Component({
|
||||
@ -22,10 +20,13 @@ export class FormComponent implements OnInit {
|
||||
public poll?: Poll;
|
||||
public form: FormGroup;
|
||||
|
||||
public advancedDisplayEnabled = false;
|
||||
public advancedDisplayEnabled = true;
|
||||
public show_debug_data = false;
|
||||
public currentStep = 'base';
|
||||
public steps = ['base', 'choices', 'advanced'];
|
||||
|
||||
public environment = environment;
|
||||
|
||||
constructor(
|
||||
private fb: FormBuilder,
|
||||
private cd: ChangeDetectorRef,
|
||||
@ -79,9 +80,12 @@ export class FormComponent implements OnInit {
|
||||
areResultsPublic: [true, [Validators.required]],
|
||||
whoCanChangeAnswers: ['everybody', [Validators.required]],
|
||||
isProtectedByPassword: [false, [Validators.required]],
|
||||
allowNewDateTime: [false, [Validators.required]],
|
||||
isOwnerNotifiedByEmailOnNewVote: [false, [Validators.required]],
|
||||
isOwnerNotifiedByEmailOnNewComment: [false, [Validators.required]],
|
||||
isYesAnswerAvailable: [false, [Validators.required]],
|
||||
isMaybeAnswerAvailable: [false, [Validators.required]],
|
||||
isNoAnswerAvailable: [false, [Validators.required]],
|
||||
isAboutDate: [true, [Validators.required]],
|
||||
isZeroKnoledge: [false, [Validators.required]],
|
||||
expiresDaysDelay: [60, [Validators.required, Validators.min(1)]],
|
||||
@ -125,11 +129,15 @@ export class FormComponent implements OnInit {
|
||||
isProtectedByPassword: false,
|
||||
isOwnerNotifiedByEmailOnNewVote: false,
|
||||
isOwnerNotifiedByEmailOnNewComment: false,
|
||||
isYesAnswerAvailable: true,
|
||||
isMaybeAnswerAvailable: false,
|
||||
isNoAnswerAvailable: false,
|
||||
isZeroKnoledge: true,
|
||||
areResultsPublic: true,
|
||||
allowComments: true,
|
||||
expiresDaysDelay: 60,
|
||||
maxCountOfAnswers: 150,
|
||||
allowNewDateTime: false,
|
||||
comments: [],
|
||||
choices: [
|
||||
{
|
||||
@ -149,6 +157,7 @@ export class FormComponent implements OnInit {
|
||||
goPreviousStep() {
|
||||
alert('todo');
|
||||
}
|
||||
|
||||
goNextStep() {
|
||||
console.log('this.steps', this.steps);
|
||||
let indexCurrentStep = this.steps.indexOf(this.currentStep);
|
||||
|
Loading…
x
Reference in New Issue
Block a user