forked from tykayn/funky-framadate-front
include advanced choices and toggle visibility of sub component
This commit is contained in:
parent
1717f738d1
commit
feb0de8270
@ -1,89 +1,91 @@
|
|||||||
<fieldset class="complete well">
|
<form [formGroup]="form">
|
||||||
<h2>{{ 'creation.advanced' | translate }}</h2>
|
<fieldset class="complete well">
|
||||||
<label for="descr">Description (optionnel)</label>
|
<h2>{{ 'creation.advanced' | translate }}</h2>
|
||||||
<textarea
|
<label for="descr">Description (optionnel)</label>
|
||||||
#description
|
<textarea
|
||||||
matInput
|
#description
|
||||||
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>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
<app-copy-text [textToCopy]="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
|
matInput
|
||||||
type="number"
|
id="descr"
|
||||||
placeholder="Nombre de jours avant expiration"
|
placeholder="Description"
|
||||||
formControlName="expiracyNumberOfDays"
|
formControlName="description"
|
||||||
required
|
required
|
||||||
/>
|
></textarea>
|
||||||
<button
|
<button
|
||||||
mat-button
|
mat-button
|
||||||
*ngIf="expiracy.value"
|
*ngIf="description.value"
|
||||||
matSuffix
|
matSuffix
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
aria-label="Clear"
|
aria-label="Clear"
|
||||||
(click)="expiracy.value = ''"
|
(click)="description.value = ''"
|
||||||
>
|
>
|
||||||
<i class="fa fa-close"></i>
|
<i class="fa fa-close"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
|
||||||
<mat-checkbox class="is-not-flex" formControlName="areResultsPublic">
|
<br />
|
||||||
Les participants pourront consulter les résultats
|
|
||||||
</mat-checkbox>
|
<label for="slug"
|
||||||
<mat-checkbox class="is-not-flex" formControlName="isAboutDate">
|
>Url pour les participants
|
||||||
Les choix possibles concerneront des dates
|
|
||||||
</mat-checkbox>
|
<i class="fa fa-close"></i>
|
||||||
<mat-checkbox class="is-not-flex" formControlName="isProtectedByPassword">
|
</label>
|
||||||
Le sondage sera protégé par un mot de passe
|
<br />
|
||||||
</mat-checkbox>
|
<span
|
||||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewVote">
|
>{{ urlPrefix }}
|
||||||
Vous recevrez un mail à chaque nouvelle participation
|
<strong>
|
||||||
</mat-checkbox>
|
{{ form.controls.slug.value }}
|
||||||
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewComment">
|
</strong>
|
||||||
Vous recevrez un mail à chaque nouveau commentaire
|
</span>
|
||||||
</mat-checkbox>
|
<app-copy-text [textToCopy]="form.controls.slug.value"></app-copy-text>
|
||||||
<mat-checkbox class="is-not-flex" formControlName="isMaybeAnswerAvailable">
|
|
||||||
La réponse « peut-être » sera disponible
|
<button
|
||||||
</mat-checkbox>
|
mat-button
|
||||||
</fieldset>
|
*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>
|
||||||
|
<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>
|
||||||
|
</form>
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
import { Poll } from '../../../../core/models/poll.model';
|
||||||
|
import { FormGroup } from '@angular/forms';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-advanced-config',
|
selector: 'app-advanced-config',
|
||||||
@ -7,7 +9,10 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
})
|
})
|
||||||
export class AdvancedConfigComponent implements OnInit {
|
export class AdvancedConfigComponent implements OnInit {
|
||||||
public urlPrefix: string = window.location.origin + '/participation/';
|
public urlPrefix: string = window.location.origin + '/participation/';
|
||||||
|
@Input()
|
||||||
|
public poll?: Poll;
|
||||||
|
@Input()
|
||||||
|
public form: FormGroup;
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
ngOnInit(): void {}
|
ngOnInit(): void {}
|
||||||
|
@ -1,24 +1,41 @@
|
|||||||
<form [formGroup]="form">
|
<form [formGroup]="form">
|
||||||
<div class="columns">
|
<h1>
|
||||||
<span>
|
{{ 'creation.title' | translate }}
|
||||||
{{ 'creation.choose_title' | translate }}
|
</h1>
|
||||||
</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>
|
|
||||||
|
|
||||||
<div>
|
<p class="subtitle">
|
||||||
|
{{ 'creation.want' | translate }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column">
|
||||||
|
<p>
|
||||||
|
{{ 'creation.choose_title' | translate }}
|
||||||
|
</p>
|
||||||
|
<br />
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
<label class="" for="creatorEmail">
|
<label class="" for="creatorEmail">
|
||||||
<span>
|
<span>
|
||||||
{{ 'creation.name' | translate }}
|
{{ 'creation.name' | translate }}
|
||||||
|
@ -16,6 +16,7 @@ import { Poll } from '../../../../core/models/poll.model';
|
|||||||
export class BaseConfigComponent implements OnInit {
|
export class BaseConfigComponent implements OnInit {
|
||||||
@Input()
|
@Input()
|
||||||
public poll?: Poll;
|
public poll?: Poll;
|
||||||
|
@Input()
|
||||||
public form: FormGroup;
|
public form: FormGroup;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -1,31 +1,19 @@
|
|||||||
<div class="admin-form padded">
|
<div class="admin-form padded">
|
||||||
<h1>
|
|
||||||
{{ 'creation.title' | translate }}
|
|
||||||
</h1>
|
|
||||||
<div class="validation">
|
|
||||||
<div class="has-background-danger" *ngIf="!form.valid">
|
|
||||||
le formulaire est invalide
|
|
||||||
<pre>
|
|
||||||
{{ form.errors | json }}
|
|
||||||
</pre
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<app-base-config></app-base-config>
|
|
||||||
<!-- <app-kind-select></app-kind-select>-->
|
|
||||||
|
|
||||||
<!-- choix spécialement pour les dates-->
|
|
||||||
<!-- <app-date-select ng-if="form.kind == 'date'"></app-date-select>-->
|
|
||||||
<!-- <app-text-select ng-if="form.kind == 'classic'"></app-text-select>-->
|
|
||||||
<button class="btn is-info" (click)="advancedDisplayEnabled = !advancedDisplayEnabled">
|
|
||||||
<i class="fa fa-save"></i>
|
|
||||||
{{ 'creation.advanced' | translate }}
|
|
||||||
</button>
|
|
||||||
<!-- <app-advanced-config ng-if="advancedDisplayEnabled"></app-advanced-config>-->
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<form [formGroup]="form">
|
<form [formGroup]="form">
|
||||||
|
<app-base-config [poll]="poll" [form]="form"></app-base-config>
|
||||||
|
<!-- <app-kind-select></app-kind-select>-->
|
||||||
|
|
||||||
|
<!-- choix spécialement pour les dates-->
|
||||||
|
<!-- <app-date-select ng-if="form.kind == 'date'"></app-date-select>-->
|
||||||
|
<!-- <app-text-select ng-if="form.kind == 'classic'"></app-text-select>-->
|
||||||
|
<button class="btn is-info" (click)="advancedDisplayEnabled = !advancedDisplayEnabled">
|
||||||
|
<i class="fa fa-save"></i>
|
||||||
|
{{ 'creation.advanced' | translate }}
|
||||||
|
</button>
|
||||||
|
<app-advanced-config [poll]="poll" [form]="form" *ngIf="advancedDisplayEnabled"></app-advanced-config>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column"></div>
|
<div class="column"></div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
@ -39,5 +27,14 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="validation">
|
||||||
|
<div class="has-background-danger" *ngIf="!form.valid">
|
||||||
|
le formulaire est invalide
|
||||||
|
<pre>
|
||||||
|
{{ form.errors | json }}
|
||||||
|
</pre
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user