mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
creation : split all steps
This commit is contained in:
parent
b559f6caba
commit
2546d0d813
@ -1,8 +1,8 @@
|
||||
<div class="admin-form">
|
||||
<header>
|
||||
<h1>
|
||||
<h2 classs="title is-2">
|
||||
{{ 'creation.title' | translate }}
|
||||
</h1>
|
||||
</h2>
|
||||
<app-stepper [step_current]="step_current" [step_max]="step_max"></app-stepper>
|
||||
</header>
|
||||
<section class="step-container">
|
||||
@ -13,324 +13,15 @@
|
||||
<footer>
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<button class="button is-large is-secondary" [routerLink]="previousRouteName">précédent</button>
|
||||
<button class="button is-large is-secondary" [routerLink]="previousRouteName" *ngIf="step_current != 1">
|
||||
précédent
|
||||
</button>
|
||||
</div>
|
||||
<div class="column">
|
||||
<button class="button is-primary is-large is-pulled-right">suivant</button>
|
||||
<button class="button is-primary is-large is-pulled-right" [disabled]="form.invalid">suivant</button>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<hr />
|
||||
|
||||
<form [formGroup]="form">
|
||||
<hr />
|
||||
|
||||
<app-stepper [step_current]="2" [step_max]="step_max"></app-stepper>
|
||||
<div class="form-field poll-kind">
|
||||
<h2 class="title is-2">
|
||||
{{ 'creation.want' | translate }}
|
||||
</h2>
|
||||
<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-list-ul"></i>
|
||||
{{ 'creation.kind.classic' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- choix spécialement pour les dates-->
|
||||
<div class="dates-list">
|
||||
<div class="title">
|
||||
<span class="count-dates">
|
||||
{{ timeList.length }}
|
||||
</span>
|
||||
<span class="count-dates-txt">
|
||||
{{ 'dates.count_time' | translate }}
|
||||
(pour chaque jour)
|
||||
</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button
|
||||
(click)="addTime()"
|
||||
*ngIf="'false' === allowSeveralHours"
|
||||
class="btn btn--primary"
|
||||
id="add_time_button"
|
||||
>
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
{{ 'dates.add_time' | translate }}
|
||||
</button>
|
||||
<button
|
||||
(click)="removeAllTimes()"
|
||||
*ngIf="'false' === allowSeveralHours"
|
||||
class="btn btn--warning"
|
||||
id="remove_time_button"
|
||||
>
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
Aucune plage horaire
|
||||
</button>
|
||||
<button
|
||||
(click)="resetTimes()"
|
||||
*ngIf="'false' === allowSeveralHours"
|
||||
class="btn btn--warning"
|
||||
id="reset_time_button"
|
||||
>
|
||||
<i class="fa fa-refresh" aria-hidden="true"></i>
|
||||
réinitialiser
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div *ngIf="'false' === allowSeveralHours" class="identical-dates">
|
||||
<div cdkDropList class="example-list" (cdkDropListDropped)="drop($event)">
|
||||
<div *ngFor="let time of timeList; index as id" class="time-choice" cdkDrag>
|
||||
<label for="timeChoices_{{ id }}">
|
||||
<i class="fa fa-clock-o" aria-hidden="true"></i>
|
||||
</label>
|
||||
<input
|
||||
[(ngModel)]="time.literal"
|
||||
name="timeChoices_{{ id }}"
|
||||
type="text"
|
||||
id="timeChoices_{{ id }}"
|
||||
/>
|
||||
<button (click)="time.timeList.splice(id, 1)" class="btn btn-warning">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<span class="count-dates title">
|
||||
{{ dateList.length }}
|
||||
</span>
|
||||
<span>
|
||||
{{ 'dates.count_dates' | translate }}
|
||||
</span>
|
||||
<button class="btn btn--primary" (click)="addChoice()">
|
||||
{{ 'dates.add' | translate }}
|
||||
</button>
|
||||
<div *ngFor="let choice of dateList; index as id" class="date-choice">
|
||||
<input
|
||||
[(ngModel)]="choice.date_object"
|
||||
name="dateChoices_{{ id }}"
|
||||
id="dateChoices_{{ id }}"
|
||||
useValueAsDate
|
||||
type="date"
|
||||
/>
|
||||
<button (click)="dateList.splice(id, 1)" class="btn btn-warning">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button
|
||||
(click)="addTimeToDate(choice, id)"
|
||||
*ngIf="'true' === allowSeveralHours"
|
||||
class="btn btn--primary"
|
||||
>
|
||||
{{ 'dates.add_time' | translate }}
|
||||
</button>
|
||||
<div *ngIf="'true' === allowSeveralHours" class="several-times">
|
||||
<div *ngFor="let timeItem of choice.timeList; index as idTime" class="time-choice">
|
||||
<input
|
||||
[(ngModel)]="timeItem.literal"
|
||||
name="dateTime_{{ id }}_Choices_{{ idTime }}"
|
||||
id="dateTime_{{ id }}_Choices_{{ idTime }}"
|
||||
type="text"
|
||||
/>
|
||||
<button (click)="choice.timeList.splice(idTime, 1)" class="btn btn-warning">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
(click)="showDateInterval = !showDateInterval"
|
||||
[ngClass]="{ active: showDateInterval }"
|
||||
class="btn btn--primary"
|
||||
id="toggle_interval_button"
|
||||
>
|
||||
<i class="fa fa-clock-o" aria-hidden="true"></i>
|
||||
{{ 'dates.add_interval' | translate }}
|
||||
</button>
|
||||
<section *ngIf="showDateInterval" class="date-interval form-row">
|
||||
<h2>{{ 'dates.add_interval' | translate }}</h2>
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
{{ 'dates.interval_propose' | translate }}
|
||||
</div>
|
||||
<div class="column">
|
||||
<label for="start_interval" class="hidden">start</label>
|
||||
<input id="start_interval" (change)="countDays()" formControlName="startDateInterval" type="date" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
{{ 'dates.interval_span' | translate }}
|
||||
</div>
|
||||
<div class="column">
|
||||
<label for="end_interval" class="hidden">end</label>
|
||||
<input id="end_interval" formControlName="endDateInterval" type="date" />
|
||||
</div>
|
||||
</div>
|
||||
<button (click)="addIntervalOfDates()" class="btn btn-block btn--primary">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
{{ 'dates.interval_button' | translate }}
|
||||
{{ intervalDays }}
|
||||
{{ 'dates.interval_button_dates' | translate }}
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<app-stepper [step_current]="3" [step_max]="step_max"></app-stepper>
|
||||
|
||||
<div class="creator-infos">
|
||||
<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
|
||||
placeholder="mon-email@example.com"
|
||||
formControlName="creatorEmail"
|
||||
id="creatorEmail"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
<app-stepper [step_current]="4" [step_max]="step_max"></app-stepper>
|
||||
|
||||
<fieldset class="advanced-config">
|
||||
<button class="btn is-info" (click)="advancedDisplayEnabled = !advancedDisplayEnabled">
|
||||
<i class="fa fa-save"></i>
|
||||
{{ 'creation.advanced' | translate }}
|
||||
</button>
|
||||
<fieldset class="complete well" *ngIf="advancedDisplayEnabled">
|
||||
<h2>{{ 'creation.advanced' | translate }}</h2>
|
||||
|
||||
<br />
|
||||
|
||||
<label for="slug">Url pour les participants </label>
|
||||
<br />
|
||||
<span
|
||||
>{{ urlPrefix }} <strong> {{ form.controls.slug.value }} </strong>
|
||||
</span>
|
||||
<app-copy-text [textToCopy]="urlPrefix + form.controls.slug.value"></app-copy-text>
|
||||
|
||||
<button
|
||||
mat-button
|
||||
*ngIf="form.controls.slug.value"
|
||||
matSuffix
|
||||
mat-icon-button
|
||||
aria-label="Clear"
|
||||
(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>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="areResultsPublic">
|
||||
Les participants pourront consulter les résultats
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isAboutDate">
|
||||
Les choix possibles concerneront des dates
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isProtectedByPassword">
|
||||
Le sondage sera protégé par un mot de passe
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewVote">
|
||||
Vous recevrez un mail à chaque nouvelle participation
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewComment">
|
||||
Vous recevrez un mail à chaque nouveau commentaire
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isMaybeAnswerAvailable">
|
||||
La réponse « peut-être » sera disponible
|
||||
</mat-checkbox>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
<hr />
|
||||
<app-stepper [step_current]="5" [step_max]="step_max"></app-stepper>
|
||||
<div class="columns">
|
||||
<div class="column"></div>
|
||||
<div class="column">
|
||||
<button class="btn is-primary" (click)="createPoll()" [disabled]="!form.valid || !form.valid">
|
||||
<i class="fa fa-save"></i>
|
||||
Enregistrer le sondage
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="supplement">
|
||||
<img src="assets/img/undraw_Moving_twwf.svg" alt="image WIP" />
|
||||
<button class="btn btn--warning" (click)="askInitFormDefault()">
|
||||
<i class="fa fa-refresh"></i>
|
||||
Tout réinitialiser
|
||||
</button>
|
||||
<button class="btn is-success" (click)="createPoll()">
|
||||
<i class="fa fa-save"></i>
|
||||
Enregistrer le sondage
|
||||
</button>
|
||||
<button class="btn is-default" (click)="automaticSlug()">
|
||||
<i class="fa fa-save"></i>
|
||||
Slug automatique
|
||||
</button>
|
||||
|
||||
<div class="well">
|
||||
{{ poll.slug }}
|
||||
</div>
|
||||
<div class="has-background-danger" *ngIf="!form.valid">
|
||||
le formulaire est invalide
|
||||
<pre> {{ form.errors | json }}</pre>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -69,11 +69,6 @@ export class FormComponent implements OnInit {
|
||||
this.apiService.createPoll(newpoll);
|
||||
}
|
||||
|
||||
public updateSlug(): void {
|
||||
const newValueFormatted = 'TODO';
|
||||
this.form.patchValue({ slug: newValueFormatted });
|
||||
}
|
||||
|
||||
addChoice(optionalLabel = ''): void {
|
||||
const newControlGroup = this.fb.group({
|
||||
label: this.fb.control('', [Validators.required]),
|
||||
|
@ -1 +1,34 @@
|
||||
<p>step-five works!</p>
|
||||
<app-stepper [step_current]="5" [step_max]="step_max"></app-stepper>
|
||||
<div class="columns">
|
||||
<div class="column"></div>
|
||||
<div class="column">
|
||||
<button class="btn is-primary" (click)="createPoll()" [disabled]="!form.valid || !form.valid">
|
||||
<i class="fa fa-save"></i>
|
||||
Enregistrer le sondage
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="supplement">
|
||||
<img src="assets/img/undraw_Moving_twwf.svg" alt="image WIP" />
|
||||
<button class="btn btn--warning" (click)="askInitFormDefault()">
|
||||
<i class="fa fa-refresh"></i>
|
||||
Tout réinitialiser
|
||||
</button>
|
||||
<button class="btn is-success" (click)="createPoll()">
|
||||
<i class="fa fa-save"></i>
|
||||
Enregistrer le sondage
|
||||
</button>
|
||||
<button class="btn is-default" (click)="automaticSlug()">
|
||||
<i class="fa fa-save"></i>
|
||||
Slug automatique
|
||||
</button>
|
||||
|
||||
<div class="well">
|
||||
{{ poll.slug }}
|
||||
</div>
|
||||
<div class="has-background-danger" *ngIf="!form.valid">
|
||||
le formulaire est invalide
|
||||
<pre> {{ form.errors | json }}</pre>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'app-step-five',
|
||||
@ -6,7 +7,15 @@ import { Component, OnInit } from '@angular/core';
|
||||
styleUrls: ['./step-five.component.scss'],
|
||||
})
|
||||
export class StepFiveComponent implements OnInit {
|
||||
@Input() step_max: any;
|
||||
@Input() public form: FormGroup;
|
||||
poll: any;
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
askInitFormDefault() {}
|
||||
|
||||
createPoll() {}
|
||||
|
||||
automaticSlug() {}
|
||||
}
|
||||
|
@ -1 +1,77 @@
|
||||
<p>step-four works!</p>
|
||||
<app-stepper [step_current]="4" [step_max]="step_max"></app-stepper>
|
||||
|
||||
<fieldset class="advanced-config">
|
||||
<button class="btn is-info" (click)="advancedDisplayEnabled = !advancedDisplayEnabled">
|
||||
<i class="fa fa-save"></i>
|
||||
{{ 'creation.advanced' | translate }}
|
||||
</button>
|
||||
<fieldset class="complete well" *ngIf="advancedDisplayEnabled">
|
||||
<h2>{{ 'creation.advanced' | translate }}</h2>
|
||||
|
||||
<br />
|
||||
|
||||
<label for="slug">Url pour les participants </label>
|
||||
<br />
|
||||
<span
|
||||
>{{ urlPrefix }} <strong> {{ form.controls.slug.value }} </strong>
|
||||
</span>
|
||||
<app-copy-text [textToCopy]="urlPrefix + form.controls.slug.value"></app-copy-text>
|
||||
|
||||
<button
|
||||
mat-button
|
||||
*ngIf="form.controls.slug.value"
|
||||
matSuffix
|
||||
mat-icon-button
|
||||
aria-label="Clear"
|
||||
(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>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="areResultsPublic">
|
||||
Les participants pourront consulter les résultats
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isAboutDate">
|
||||
Les choix possibles concerneront des dates
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isProtectedByPassword">
|
||||
Le sondage sera protégé par un mot de passe
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewVote">
|
||||
Vous recevrez un mail à chaque nouvelle participation
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewComment">
|
||||
Vous recevrez un mail à chaque nouveau commentaire
|
||||
</mat-checkbox>
|
||||
<br />
|
||||
<mat-checkbox class="is-not-flex" formControlName="isMaybeAnswerAvailable">
|
||||
La réponse « peut-être » sera disponible
|
||||
</mat-checkbox>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-step-four',
|
||||
@ -6,6 +6,12 @@ import { Component, OnInit } from '@angular/core';
|
||||
styleUrls: ['./step-four.component.scss'],
|
||||
})
|
||||
export class StepFourComponent implements OnInit {
|
||||
urlPrefix: any;
|
||||
advancedDisplayEnabled: any;
|
||||
@Input()
|
||||
step_max: any;
|
||||
@Input()
|
||||
form: any;
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
@ -1,51 +1,59 @@
|
||||
<div class="step">
|
||||
Nom de sondage
|
||||
|
||||
<section class="poll-title">
|
||||
<span>
|
||||
{{ 'creation.choose_title' | translate }}
|
||||
</span>
|
||||
<label class="hidden" for="title">Titre</label>
|
||||
<input
|
||||
#title
|
||||
matInput
|
||||
[placeholder]="'creation.choose_title_placeholder' | translate"
|
||||
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>
|
||||
</section>
|
||||
<div class="poll-description">
|
||||
<label for="descr">Description (optionnel)</label>
|
||||
<span class="rich-text-toggle">
|
||||
mode de saisie avancée
|
||||
<i class="fa fa-text"></i><input type="checkbox" formControlName="richTextMode" />
|
||||
</span>
|
||||
<textarea
|
||||
#description
|
||||
matInput
|
||||
id="descr"
|
||||
placeholder="Description"
|
||||
formControlName="description"
|
||||
required
|
||||
></textarea>
|
||||
<div class="text-info">
|
||||
300 caractères maximum
|
||||
<form [formGroup]="form">
|
||||
<section class="poll-title">
|
||||
<h2 class="title is-2">
|
||||
{{ 'creation.choose_title' | translate }}
|
||||
</h2>
|
||||
<label class="hidden" for="title">Titre</label>
|
||||
<input
|
||||
class="input input-lg"
|
||||
#title
|
||||
matInput
|
||||
[placeholder]="'creation.choose_title_placeholder' | translate"
|
||||
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>
|
||||
</section>
|
||||
<div class="poll-description">
|
||||
<label for="descr">Description (optionnel)</label>
|
||||
<span class="rich-text-toggle">
|
||||
mode de saisie avancée
|
||||
<i class="fa fa-text"></i><input type="checkbox" formControlName="richTextMode" />
|
||||
</span>
|
||||
<textarea
|
||||
#description
|
||||
matInput
|
||||
id="descr"
|
||||
placeholder="Description"
|
||||
formControlName="description"
|
||||
required
|
||||
></textarea>
|
||||
<div class="text-info">
|
||||
300 caractères maximum
|
||||
</div>
|
||||
<button
|
||||
mat-button
|
||||
*ngIf="description.value"
|
||||
matSuffix
|
||||
mat-icon-button
|
||||
aria-label="Clear"
|
||||
(click)="description.value = ''"
|
||||
>
|
||||
<i class="fa fa-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
mat-button
|
||||
*ngIf="description.value"
|
||||
matSuffix
|
||||
mat-icon-button
|
||||
aria-label="Clear"
|
||||
(click)="description.value = ''"
|
||||
>
|
||||
<i class="fa fa-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { PollService } from '../../../../core/services/poll.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-step-one',
|
||||
@ -6,9 +8,17 @@ import { Component, OnInit } from '@angular/core';
|
||||
styleUrls: ['./step-one.component.scss'],
|
||||
})
|
||||
export class StepOneComponent implements OnInit {
|
||||
constructor() {}
|
||||
constructor(private pollService: PollService) {}
|
||||
|
||||
@Input()
|
||||
step_max: any;
|
||||
@Input()
|
||||
form: FormGroup;
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
updateSlug() {}
|
||||
public updateSlug(): void {
|
||||
const newValueFormatted = 'TODO';
|
||||
this.form.patchValue({ slug: this.pollService.makeSlug(this.form.value['custom_url']) });
|
||||
}
|
||||
}
|
||||
|
@ -1 +1,23 @@
|
||||
<p>step-three works!</p>
|
||||
<app-stepper [step_current]="3" [step_max]="step_max"></app-stepper>
|
||||
|
||||
<div class="creator-infos">
|
||||
<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
|
||||
placeholder="mon-email@example.com"
|
||||
formControlName="creatorEmail"
|
||||
id="creatorEmail"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-step-three',
|
||||
@ -6,6 +6,10 @@ import { Component, OnInit } from '@angular/core';
|
||||
styleUrls: ['./step-three.component.scss'],
|
||||
})
|
||||
export class StepThreeComponent implements OnInit {
|
||||
@Input()
|
||||
step_max: any;
|
||||
@Input()
|
||||
form: any;
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
@ -1 +1,154 @@
|
||||
<p>step-two works!</p>
|
||||
<app-stepper [step_current]="2" [step_max]="step_max"></app-stepper>
|
||||
<div class="form-field poll-kind">
|
||||
<h2 class="title is-2">
|
||||
{{ 'creation.want' | translate }}
|
||||
</h2>
|
||||
<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-list-ul"></i>
|
||||
{{ 'creation.kind.classic' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- choix spécialement pour les dates-->
|
||||
<div class="dates-list">
|
||||
<div class="title">
|
||||
<span class="count-dates">
|
||||
{{ timeList.length }}
|
||||
</span>
|
||||
<span class="count-dates-txt">
|
||||
{{ 'dates.count_time' | translate }}
|
||||
(pour chaque jour)
|
||||
</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button (click)="addTime()" *ngIf="'false' === allowSeveralHours" class="btn btn--primary" id="add_time_button">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
{{ 'dates.add_time' | translate }}
|
||||
</button>
|
||||
<button
|
||||
(click)="removeAllTimes()"
|
||||
*ngIf="'false' === allowSeveralHours"
|
||||
class="btn btn--warning"
|
||||
id="remove_time_button"
|
||||
>
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
Aucune plage horaire
|
||||
</button>
|
||||
<button
|
||||
(click)="resetTimes()"
|
||||
*ngIf="'false' === allowSeveralHours"
|
||||
class="btn btn--warning"
|
||||
id="reset_time_button"
|
||||
>
|
||||
<i class="fa fa-refresh" aria-hidden="true"></i>
|
||||
réinitialiser
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div *ngIf="'false' === allowSeveralHours" class="identical-dates">
|
||||
<div cdkDropList class="example-list" (cdkDropListDropped)="drop($event)">
|
||||
<div *ngFor="let time of timeList; index as id" class="time-choice" cdkDrag>
|
||||
<label for="timeChoices_{{ id }}">
|
||||
<i class="fa fa-clock-o" aria-hidden="true"></i>
|
||||
</label>
|
||||
<input [(ngModel)]="time.literal" name="timeChoices_{{ id }}" type="text" id="timeChoices_{{ id }}" />
|
||||
<button (click)="time.timeList.splice(id, 1)" class="btn btn-warning">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<span class="count-dates title">
|
||||
{{ dateList.length }}
|
||||
</span>
|
||||
<span>
|
||||
{{ 'dates.count_dates' | translate }}
|
||||
</span>
|
||||
<button class="btn btn--primary" (click)="addChoice()">
|
||||
{{ 'dates.add' | translate }}
|
||||
</button>
|
||||
<div *ngFor="let choice of dateList; index as id" class="date-choice">
|
||||
<input
|
||||
[(ngModel)]="choice.date_object"
|
||||
name="dateChoices_{{ id }}"
|
||||
id="dateChoices_{{ id }}"
|
||||
useValueAsDate
|
||||
type="date"
|
||||
/>
|
||||
<button (click)="dateList.splice(id, 1)" class="btn btn-warning">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button (click)="addTimeToDate(choice, id)" *ngIf="'true' === allowSeveralHours" class="btn btn--primary">
|
||||
{{ 'dates.add_time' | translate }}
|
||||
</button>
|
||||
<div *ngIf="'true' === allowSeveralHours" class="several-times">
|
||||
<div *ngFor="let timeItem of choice.timeList; index as idTime" class="time-choice">
|
||||
<input
|
||||
[(ngModel)]="timeItem.literal"
|
||||
name="dateTime_{{ id }}_Choices_{{ idTime }}"
|
||||
id="dateTime_{{ id }}_Choices_{{ idTime }}"
|
||||
type="text"
|
||||
/>
|
||||
<button (click)="choice.timeList.splice(idTime, 1)" class="btn btn-warning">
|
||||
<i class="fa fa-times" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
(click)="showDateInterval = !showDateInterval"
|
||||
[ngClass]="{ active: showDateInterval }"
|
||||
class="btn btn--primary"
|
||||
id="toggle_interval_button"
|
||||
>
|
||||
<i class="fa fa-clock-o" aria-hidden="true"></i>
|
||||
{{ 'dates.add_interval' | translate }}
|
||||
</button>
|
||||
<section *ngIf="showDateInterval" class="date-interval form-row">
|
||||
<h2>{{ 'dates.add_interval' | translate }}</h2>
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
{{ 'dates.interval_propose' | translate }}
|
||||
</div>
|
||||
<div class="column">
|
||||
<label for="start_interval" class="hidden">start</label>
|
||||
<input id="start_interval" (change)="countDays()" formControlName="startDateInterval" type="date" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
{{ 'dates.interval_span' | translate }}
|
||||
</div>
|
||||
<div class="column">
|
||||
<label for="end_interval" class="hidden">end</label>
|
||||
<input id="end_interval" formControlName="endDateInterval" type="date" />
|
||||
</div>
|
||||
</div>
|
||||
<button (click)="addIntervalOfDates()" class="btn btn-block btn--primary">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>
|
||||
{{ 'dates.interval_button' | translate }}
|
||||
{{ intervalDays }}
|
||||
{{ 'dates.interval_button_dates' | translate }}
|
||||
</button>
|
||||
</section>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-step-two',
|
||||
@ -9,4 +9,9 @@ export class StepTwoComponent implements OnInit {
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
@Input()
|
||||
form: any;
|
||||
@Input()
|
||||
step_max: any;
|
||||
addIntervalOfDates() {}
|
||||
}
|
||||
|
@ -33,13 +33,13 @@
|
||||
"classic": "classique",
|
||||
"date": "spécial dates"
|
||||
},
|
||||
"choose_title": "Dont le titre sera",
|
||||
"choose_title_placeholder": "titre",
|
||||
"choose_title": "Renseignez un nom pour votre sondage",
|
||||
"choose_title_placeholder": "Quel resto ce soir?",
|
||||
"choices_hint": "Utilisez les flèches haut ⬆️ et bas ⬇️ pour passer d'un choix à un autre",
|
||||
"name": "Je peux aussi préciser mon nom si je le souhaite",
|
||||
"name_placeholder": "mon nom",
|
||||
"description": "et la description serait",
|
||||
"description_placeholder": "description"
|
||||
"description": "Description (facultatif)",
|
||||
"description_placeholder": "ma description"
|
||||
},
|
||||
"dates": {
|
||||
"title": "Config spécialement pour les dates",
|
||||
|
Loading…
x
Reference in New Issue
Block a user