forked from tykayn/funky-framadate-front
reordering creation form
This commit is contained in:
parent
386bbf742a
commit
6c30872c0e
26078
package-lock.json
generated
26078
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,7 @@ import { environment } from '../../../../environments/environment';
|
||||
export class HeaderComponent implements OnInit {
|
||||
public _user: Observable<User> = this.userService.user;
|
||||
public env = environment;
|
||||
@Input() public appTitle: string = 'FramaDate Funky';
|
||||
@Input() public appTitle: string = environment.appTitle ? environment.appTitle : 'FramaDate';
|
||||
@Input() public appLogo: string;
|
||||
mobileMenuVisible = false;
|
||||
|
||||
|
@ -10,9 +10,20 @@ import { StepperComponent } from './stepper/stepper.component';
|
||||
import { NamingComponent } from './naming/naming.component';
|
||||
import { FormComponent } from './form/form.component';
|
||||
import { DateValueAccessorModule } from 'angular-date-value-accessor';
|
||||
import { ClassicChoicesComponent } from './form/classic-choices/classic-choices.component';
|
||||
import { StepOneComponent } from './form/step-one/step-one.component';
|
||||
import { StepTwoComponent } from './form/step-two/step-two.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [AdministrationComponent, StepperComponent, NamingComponent, FormComponent],
|
||||
declarations: [
|
||||
AdministrationComponent,
|
||||
StepperComponent,
|
||||
NamingComponent,
|
||||
FormComponent,
|
||||
ClassicChoicesComponent,
|
||||
StepOneComponent,
|
||||
StepTwoComponent,
|
||||
],
|
||||
imports: [
|
||||
AdministrationRoutingModule,
|
||||
CommonModule,
|
||||
|
@ -0,0 +1,67 @@
|
||||
<div class="form-field">
|
||||
<!-- Choisir les propositions -->
|
||||
<!-- sondage classique texte -->
|
||||
<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">
|
||||
<button class="btn is-primary" (click)="addChoice()">
|
||||
<i class="fa fa-plus"></i>
|
||||
Ajouter un choix
|
||||
</button>
|
||||
</span>
|
||||
<span class="column pull-right">
|
||||
<button class="btn is-warning" (click)="reinitChoices()">
|
||||
<i class="fa fa-recycle"></i>
|
||||
Réinitialiser
|
||||
</button>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<p class="hint">
|
||||
{{ 'creation.choices_hint' | translate }}
|
||||
</p>
|
||||
<span *ngFor="let choice of choices.controls; let i = index">
|
||||
<div class="form-row" [formGroup]="choice">
|
||||
<div class="columns">
|
||||
<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]="'choice_label_' + i" class="hidden">label</label>
|
||||
<input
|
||||
formControlName="label"
|
||||
[id]="'choice_label_' + i"
|
||||
placeholder="Enter a choice description"
|
||||
(keyup)="keyOnChoice($event, i)"
|
||||
(keyup.backspace)="deleteChoiceField(i)"
|
||||
/>
|
||||
<br />
|
||||
<label [for]="'image_url_' + i" class="hidden">image Url</label>
|
||||
<input
|
||||
formControlName="imageUrl"
|
||||
[id]="'image_url_' + i"
|
||||
placeholder="URL de l' image"
|
||||
(keyup)="keyOnChoice($event, i)"
|
||||
(keyup.backspace)="deleteChoiceField(i)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ClassicChoicesComponent } from './classic-choices.component';
|
||||
|
||||
describe('ClassicChoicesComponent', () => {
|
||||
let component: ClassicChoicesComponent;
|
||||
let fixture: ComponentFixture<ClassicChoicesComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ClassicChoicesComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ClassicChoicesComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,12 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-classic-choices',
|
||||
templateUrl: './classic-choices.component.html',
|
||||
styleUrls: ['./classic-choices.component.scss'],
|
||||
})
|
||||
export class ClassicChoicesComponent implements OnInit {
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
}
|
@ -3,159 +3,20 @@
|
||||
{{ 'creation.title' | translate }}
|
||||
</h1>
|
||||
|
||||
<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>
|
||||
<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">
|
||||
{{ id }})
|
||||
<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>
|
||||
<hr />
|
||||
|
||||
<form [formGroup]="form">
|
||||
<div class="form-field">
|
||||
<span class="pre-selector">
|
||||
{{ 'creation.want' | translate }}
|
||||
</span>
|
||||
<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>
|
||||
<section class="creation-stepper">
|
||||
<div class="step-info">
|
||||
<h2 class="title is-2">
|
||||
Étape {{ step_current }} /
|
||||
{{ step_max }}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="step-bar-container" style="width: 100%;">
|
||||
<div class="step-bar-progress" [ngStyle]="{ width: (step_current / step_max) * 100 + '%' }"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="poll-title">
|
||||
<span>
|
||||
{{ 'creation.choose_title' | translate }}
|
||||
</span>
|
||||
@ -180,11 +41,173 @@
|
||||
>
|
||||
<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
|
||||
<button [(ngModel)]="richTextMode">
|
||||
<i class="fa fa-text"></i>
|
||||
</button>
|
||||
</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>
|
||||
|
||||
<fieldset class="date-kind">
|
||||
<!-- choix spécialement pour les dates-->
|
||||
</fieldset>
|
||||
<hr />
|
||||
|
||||
<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>
|
||||
|
||||
<hr />
|
||||
|
||||
<!-- 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">
|
||||
{{ id }})
|
||||
<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"
|
||||
@ -224,72 +247,6 @@
|
||||
<hr />
|
||||
</section>
|
||||
|
||||
<div class="form-field">
|
||||
<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">
|
||||
<button class="btn is-primary" (click)="addChoice()">
|
||||
<i class="fa fa-plus"></i>
|
||||
Ajouter un choix
|
||||
</button>
|
||||
</span>
|
||||
<span class="column pull-right">
|
||||
<button class="btn is-warning" (click)="reinitChoices()">
|
||||
<i class="fa fa-recycle"></i>
|
||||
Réinitialiser
|
||||
</button>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<p class="hint">
|
||||
{{ 'creation.choices_hint' | translate }}
|
||||
</p>
|
||||
<span *ngFor="let choice of choices.controls; let i = index">
|
||||
<div class="form-row" [formGroup]="choice">
|
||||
<div class="columns">
|
||||
<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]="'choice_label_' + i" class="hidden">label</label>
|
||||
<input
|
||||
formControlName="label"
|
||||
[id]="'choice_label_' + i"
|
||||
placeholder="Enter a choice description"
|
||||
(keyup)="keyOnChoice($event, i)"
|
||||
(keyup.backspace)="deleteChoiceField(i)"
|
||||
/>
|
||||
<br />
|
||||
<label [for]="'image_url_' + i" class="hidden">image Url</label>
|
||||
<input
|
||||
formControlName="imageUrl"
|
||||
[id]="'image_url_' + i"
|
||||
placeholder="URL de l' image"
|
||||
(keyup)="keyOnChoice($event, i)"
|
||||
(keyup.backspace)="deleteChoiceField(i)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="" for="creatorEmail">
|
||||
<span>
|
||||
@ -313,109 +270,122 @@
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<button class="btn is-info" (click)="advancedDisplayEnabled = !advancedDisplayEnabled">
|
||||
<i class="fa fa-save"></i>
|
||||
{{ 'creation.advanced' | translate }}
|
||||
</button>
|
||||
<hr />
|
||||
|
||||
<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="description.value"
|
||||
matSuffix
|
||||
mat-icon-button
|
||||
aria-label="Clear"
|
||||
(click)="description.value = ''"
|
||||
>
|
||||
<i class="fa fa-close"></i>
|
||||
<section class="advanced-config">
|
||||
<button class="btn is-info" (click)="advancedDisplayEnabled = !advancedDisplayEnabled">
|
||||
<i class="fa fa-save"></i>
|
||||
{{ 'creation.advanced' | translate }}
|
||||
</button>
|
||||
<hr />
|
||||
<fieldset class="complete well" *ngIf="advancedDisplayEnabled">
|
||||
<h2>{{ 'creation.advanced' | translate }}</h2>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<label for="slug"
|
||||
>Url pour les participants
|
||||
<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>
|
||||
<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
|
||||
type="number"
|
||||
placeholder="Nombre de jours avant expiration"
|
||||
formControlName="expiracyNumberOfDays"
|
||||
required
|
||||
/>
|
||||
<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-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>
|
||||
(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>
|
||||
</section>
|
||||
<div class="columns">
|
||||
<div class="column"></div>
|
||||
<div class="column">
|
||||
<button class="btn is-success" (click)="createPoll()" [disabled]="!form.valid || !form.valid">
|
||||
<button class="btn is-primary" (click)="createPoll()" [disabled]="!form.valid || !form.valid">
|
||||
<i class="fa fa-save"></i>
|
||||
Enregistrer le sondage
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
<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>
|
||||
|
@ -83,4 +83,21 @@
|
||||
border-left: $success 3px solid;
|
||||
padding-left: 1em;
|
||||
}
|
||||
.step-bar-container {
|
||||
margin: 1em 0;
|
||||
height: 0.5em;
|
||||
display: inline-block;
|
||||
min-width: 1px;
|
||||
background: $grey-light;
|
||||
width: 100%;
|
||||
}
|
||||
.step-bar-progress {
|
||||
position: relative;
|
||||
top: -0.6em;
|
||||
left: 0;
|
||||
height: 0.5em;
|
||||
display: inline-block;
|
||||
min-width: 1px;
|
||||
background: $primary;
|
||||
}
|
||||
}
|
||||
|
@ -22,14 +22,18 @@ export class FormComponent implements OnInit {
|
||||
|
||||
public urlPrefix: string = window.location.origin + '/participation/';
|
||||
public advancedDisplayEnabled = false;
|
||||
public showDateInterval = true;
|
||||
public allowSeveralHours = true;
|
||||
public showDateInterval = false;
|
||||
public allowSeveralHours = false;
|
||||
public richTextMode = false;
|
||||
startDateInterval: string;
|
||||
endDateInterval: string;
|
||||
intervalDays: any;
|
||||
intervalDaysDefault = 7;
|
||||
dateList: any = otherDefaultDates; // sets of days as strings, config to set identical time for days in a special days poll
|
||||
timeList: DateChoice[] = otherDefaultDates; // ranges of time expressed as strings
|
||||
step_current: number = 1;
|
||||
step_max: number = 5;
|
||||
public round: Function;
|
||||
|
||||
constructor(
|
||||
private fb: FormBuilder,
|
||||
@ -50,8 +54,6 @@ export class FormComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initFormDefault();
|
||||
// TO remove after
|
||||
// this.createPoll();
|
||||
const pollsAvailable = this.pollService.getAllAvailablePolls();
|
||||
console.log('pollsAvailable', pollsAvailable);
|
||||
}
|
||||
@ -61,14 +63,6 @@ export class FormComponent implements OnInit {
|
||||
const newpoll = this.pollService.newPollFromForm(this.form);
|
||||
console.log('newpoll', newpoll);
|
||||
this.apiService.createPoll(newpoll);
|
||||
// if (this.form.valid) {
|
||||
// console.log('Le sondage est correctement rempli, prêt à enregistrer.');
|
||||
// const newpoll = this.pollService.newPollFromForm(this.form);
|
||||
// // TODO : save the poll
|
||||
// this.apiService.createPoll(newpoll);
|
||||
// } else {
|
||||
// this.toastService.display('invalid form');
|
||||
// }
|
||||
}
|
||||
|
||||
public updateSlug(): void {
|
||||
@ -223,14 +217,6 @@ export class FormComponent implements OnInit {
|
||||
this.showDateInterval = false;
|
||||
|
||||
this.form.patchValue({ choices: this.dateList });
|
||||
// this.dateList.forEach(elem=>{
|
||||
// const newControlGroup = this.fb.group({
|
||||
// label: this.fb.control('', [Validators.required]),
|
||||
// imageUrl: ['', [Validators.required]],
|
||||
// });
|
||||
//
|
||||
// this.choices.push(newControlGroup);
|
||||
// })
|
||||
|
||||
this.toastService.display(`les dates ont été ajoutées aux réponses possibles.`);
|
||||
}
|
||||
|
@ -0,0 +1,3 @@
|
||||
<div class="step">
|
||||
Nom de sondage
|
||||
</div>
|
@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { StepOneComponent } from './step-one.component';
|
||||
|
||||
describe('StepOneComponent', () => {
|
||||
let component: StepOneComponent;
|
||||
let fixture: ComponentFixture<StepOneComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [StepOneComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(StepOneComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,12 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-step-one',
|
||||
templateUrl: './step-one.component.html',
|
||||
styleUrls: ['./step-one.component.scss'],
|
||||
})
|
||||
export class StepOneComponent implements OnInit {
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
}
|
@ -0,0 +1 @@
|
||||
<p>step-two works!</p>
|
@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { StepTwoComponent } from './step-two.component';
|
||||
|
||||
describe('StepTwoComponent', () => {
|
||||
let component: StepTwoComponent;
|
||||
let fixture: ComponentFixture<StepTwoComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [StepTwoComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(StepTwoComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,12 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-step-two',
|
||||
templateUrl: './step-two.component.html',
|
||||
styleUrls: ['./step-two.component.scss'],
|
||||
})
|
||||
export class StepTwoComponent implements OnInit {
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
}
|
@ -16,7 +16,7 @@ const apiV1 = {
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
appTitle: 'FramaDate Funky',
|
||||
appTitle: 'FramaDate',
|
||||
appVersion: '2.0.0',
|
||||
appLogo: 'assets/img/logo.png',
|
||||
api: {
|
||||
|
@ -11,3 +11,62 @@ $body-background-color: $black;
|
||||
$control-border-width: 2px;
|
||||
$input-border-color: transparent;
|
||||
$input-shadow: none;
|
||||
|
||||
// bulma css override
|
||||
$colors: mergeColorMaps(
|
||||
(
|
||||
'white': (
|
||||
$white,
|
||||
$black,
|
||||
),
|
||||
'black': (
|
||||
$black,
|
||||
$white,
|
||||
),
|
||||
'light': (
|
||||
$light,
|
||||
$light-invert,
|
||||
),
|
||||
'dark': (
|
||||
$dark,
|
||||
$dark-invert,
|
||||
),
|
||||
'primary': (
|
||||
$primary,
|
||||
$primary-invert,
|
||||
$primary-light,
|
||||
$primary-dark,
|
||||
),
|
||||
'link': (
|
||||
$link,
|
||||
$link-invert,
|
||||
$link-light,
|
||||
$link-dark,
|
||||
),
|
||||
'info': (
|
||||
$info,
|
||||
$info-invert,
|
||||
$info-light,
|
||||
$info-dark,
|
||||
),
|
||||
'success': (
|
||||
$success,
|
||||
$success-invert,
|
||||
$success-light,
|
||||
$success-dark,
|
||||
),
|
||||
'warning': (
|
||||
$warning,
|
||||
$warning-invert,
|
||||
$warning-light,
|
||||
$warning-dark,
|
||||
),
|
||||
'danger': (
|
||||
$danger,
|
||||
$danger-invert,
|
||||
$danger-light,
|
||||
$danger-dark,
|
||||
),
|
||||
),
|
||||
$custom-colors
|
||||
);
|
||||
|
@ -57,6 +57,5 @@ $warning: $d-warning;
|
||||
$danger: $d-error;
|
||||
$success: $d-success;
|
||||
|
||||
// FONT
|
||||
$default_font: 'pt_sans';
|
||||
$title_font: 'proza_libre', 'Brie Light', 'Arial', 'DejaVu Sans Mono';
|
||||
|
Loading…
x
Reference in New Issue
Block a user