From 03f7c49c519e2db062de3d64a1cfdd8c1f109e05 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Wed, 16 Dec 2020 17:21:01 +0100 Subject: [PATCH 001/573] create success page and route --- .../administration/administration.module.ts | 3 ++- .../administration/form/form.component.ts | 10 +++++++- .../success/success.component.html | 16 +++++++++++++ .../success/success.component.scss | 0 .../success/success.component.spec.ts | 24 +++++++++++++++++++ .../success/success.component.ts | 12 ++++++++++ src/app/routes-framadate.ts | 5 ++++ src/proxy.conf.json | 2 +- src/styles/themes/_base.scss | 1 + src/styles/themes/_light.scss | 4 +++- 10 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 src/app/features/administration/success/success.component.html create mode 100644 src/app/features/administration/success/success.component.scss create mode 100644 src/app/features/administration/success/success.component.spec.ts create mode 100644 src/app/features/administration/success/success.component.ts diff --git a/src/app/features/administration/administration.module.ts b/src/app/features/administration/administration.module.ts index 051ead96..20ca163f 100644 --- a/src/app/features/administration/administration.module.ts +++ b/src/app/features/administration/administration.module.ts @@ -10,9 +10,10 @@ 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 { SuccessComponent } from './success/success.component'; @NgModule({ - declarations: [AdministrationComponent, StepperComponent, NamingComponent, FormComponent], + declarations: [AdministrationComponent, StepperComponent, NamingComponent, FormComponent, SuccessComponent], imports: [ AdministrationRoutingModule, CommonModule, diff --git a/src/app/features/administration/form/form.component.ts b/src/app/features/administration/form/form.component.ts index 308d390c..5d1c976b 100644 --- a/src/app/features/administration/form/form.component.ts +++ b/src/app/features/administration/form/form.component.ts @@ -9,6 +9,7 @@ import { DateUtilities } from '../../old-stuff/config/DateUtilities'; import { DOCUMENT } from '@angular/common'; import { DateChoice, otherDefaultDates } from '../../old-stuff/config/defaultConfigs'; import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; +import { Router } from '@angular/router'; @Component({ selector: 'app-admin-form', @@ -39,6 +40,7 @@ export class FormComponent implements OnInit { private pollService: PollService, public dateUtilities: DateUtilities, private apiService: ApiService, + private router: Router, @Inject(DOCUMENT) private document: any ) {} drop(event: CdkDragDrop) { @@ -60,7 +62,13 @@ export class FormComponent implements OnInit { console.log('this.form', this.form); const newpoll = this.pollService.newPollFromForm(this.form); console.log('newpoll', newpoll); - this.apiService.createPoll(newpoll); + let self = this; + + this.apiService.createPoll(newpoll).then((resp) => { + console.log('resp', resp); + self.router.navigate(['success']); + }); + // this.router // if (this.form.valid) { // console.log('Le sondage est correctement rempli, prêt à enregistrer.'); // const newpoll = this.pollService.newPollFromForm(this.form); diff --git a/src/app/features/administration/success/success.component.html b/src/app/features/administration/success/success.component.html new file mode 100644 index 00000000..cb3015cf --- /dev/null +++ b/src/app/features/administration/success/success.component.html @@ -0,0 +1,16 @@ +
+
+
+

+ Création de sondage réussie +

+

+ Bravo! partagez le lien de votre sondage. Un récapitulatif a été envoyé à votre adresse email. +

+
+
+
+
+
+ image succès +
diff --git a/src/app/features/administration/success/success.component.scss b/src/app/features/administration/success/success.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/administration/success/success.component.spec.ts b/src/app/features/administration/success/success.component.spec.ts new file mode 100644 index 00000000..1e4f6a41 --- /dev/null +++ b/src/app/features/administration/success/success.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SuccessComponent } from './success.component'; + +describe('SuccessComponent', () => { + let component: SuccessComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [SuccessComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SuccessComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/administration/success/success.component.ts b/src/app/features/administration/success/success.component.ts new file mode 100644 index 00000000..13e175db --- /dev/null +++ b/src/app/features/administration/success/success.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-success', + templateUrl: './success.component.html', + styleUrls: ['./success.component.scss'], +}) +export class SuccessComponent implements OnInit { + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/app/routes-framadate.ts b/src/app/routes-framadate.ts index 671b46c1..0129c932 100644 --- a/src/app/routes-framadate.ts +++ b/src/app/routes-framadate.ts @@ -2,6 +2,7 @@ import { Routes } from '@angular/router'; import { HomeComponent } from './core/components/home/home.component'; import { PollService } from './core/services/poll.service'; import { PageNotFoundComponent } from './shared/components/page-not-found/page-not-found.component'; +import { SuccessComponent } from './features/administration/success/success.component'; export const routes: Routes = [ { path: '', component: HomeComponent }, @@ -35,6 +36,10 @@ export const routes: Routes = [ path: 'oldstuff', loadChildren: () => import('./features/old-stuff/old-stuff.module').then((m) => m.OldStuffModule), }, + { + path: 'success', + component: SuccessComponent, + }, { path: 'page-not-found', component: PageNotFoundComponent }, { path: '**', redirectTo: 'page-not-found', pathMatch: 'full' }, ]; diff --git a/src/proxy.conf.json b/src/proxy.conf.json index 709cdb6c..5b9f3ff5 100644 --- a/src/proxy.conf.json +++ b/src/proxy.conf.json @@ -1,6 +1,6 @@ { "/api/*": { - "target": "http://localhost:8000", + "target": "http://localhost:3001", "secure": false, "logLevel": "debug" } diff --git a/src/styles/themes/_base.scss b/src/styles/themes/_base.scss index 4d7250bc..5e2a778e 100644 --- a/src/styles/themes/_base.scss +++ b/src/styles/themes/_base.scss @@ -2,6 +2,7 @@ background: $primary; main { + padding: 0; margin-bottom: 2em; padding-bottom: 5em; padding-top: 1em; diff --git a/src/styles/themes/_light.scss b/src/styles/themes/_light.scss index eab5078e..7b12ab78 100644 --- a/src/styles/themes/_light.scss +++ b/src/styles/themes/_light.scss @@ -11,7 +11,9 @@ } main { - .container { + padding-top: 0; + + > .container { background: #fff; padding-bottom: 10em; } From d4e5c614a9397fdd7feaa0dc6da1d1160ccd4c52 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Thu, 4 Feb 2021 09:23:15 +0100 Subject: [PATCH 002/573] spacing buttons --- .../administration/form/form.component.html | 40 +++++++++++-------- .../administration/form/form.component.scss | 3 ++ src/styles/dev-utilities/_helpers.scss | 4 ++ 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/app/features/administration/form/form.component.html b/src/app/features/administration/form/form.component.html index 922e9258..1754e4d5 100644 --- a/src/app/features/administration/form/form.component.html +++ b/src/app/features/administration/form/form.component.html @@ -1,24 +1,32 @@ -
+

{{ 'creation.title' | translate }}

- image WIP - - - +
+
+ image WIP +
+
+ +
+ +
+ -
- {{ poll.slug }} +
+ {{ poll.slug }} +
+
le formulaire est invalide diff --git a/src/app/features/administration/form/form.component.scss b/src/app/features/administration/form/form.component.scss index d5ce7a9c..3814f6aa 100644 --- a/src/app/features/administration/form/form.component.scss +++ b/src/app/features/administration/form/form.component.scss @@ -83,4 +83,7 @@ border-left: $success 3px solid; padding-left: 1em; } + .btn { + margin: 0.5em; + } } diff --git a/src/styles/dev-utilities/_helpers.scss b/src/styles/dev-utilities/_helpers.scss index 9d5784b0..754805da 100644 --- a/src/styles/dev-utilities/_helpers.scss +++ b/src/styles/dev-utilities/_helpers.scss @@ -22,3 +22,7 @@ .hidden { display: none; } + +.padded { + padding: 1em; +} From 84b69a1366dacb521d4295c99eb630f636429ac4 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Thu, 4 Feb 2021 16:14:07 +0100 Subject: [PATCH 003/573] split of creation components --- src/app/core/services/api.service.ts | 2 +- .../administration/administration.module.ts | 18 +- .../advanced-config.component.html | 89 ++++ .../advanced-config.component.scss | 0 .../advanced-config.component.spec.ts | 24 + .../advanced-config.component.ts | 14 + .../base-config/base-config.component.html | 89 ++++ .../base-config/base-config.component.scss | 0 .../base-config/base-config.component.spec.ts | 24 + .../form/base-config/base-config.component.ts | 96 ++++ .../date-select/date-select.component.html | 139 ++++++ .../date-select/date-select.component.scss | 0 .../date-select/date-select.component.spec.ts | 24 + .../form/date-select/date-select.component.ts | 241 ++++++++++ .../administration/form/form.component.html | 432 +----------------- .../administration/form/form.component.ts | 245 +--------- .../kind-select/kind-select.component.html | 27 ++ .../kind-select/kind-select.component.scss | 0 .../kind-select/kind-select.component.spec.ts | 24 + .../form/kind-select/kind-select.component.ts | 19 + .../text-select/text-select.component.html | 55 +++ .../text-select/text-select.component.scss | 0 .../text-select/text-select.component.spec.ts | 24 + .../form/text-select/text-select.component.ts | 12 + 24 files changed, 945 insertions(+), 653 deletions(-) create mode 100644 src/app/features/administration/form/advanced-config/advanced-config.component.html create mode 100644 src/app/features/administration/form/advanced-config/advanced-config.component.scss create mode 100644 src/app/features/administration/form/advanced-config/advanced-config.component.spec.ts create mode 100644 src/app/features/administration/form/advanced-config/advanced-config.component.ts create mode 100644 src/app/features/administration/form/base-config/base-config.component.html create mode 100644 src/app/features/administration/form/base-config/base-config.component.scss create mode 100644 src/app/features/administration/form/base-config/base-config.component.spec.ts create mode 100644 src/app/features/administration/form/base-config/base-config.component.ts create mode 100644 src/app/features/administration/form/date-select/date-select.component.html create mode 100644 src/app/features/administration/form/date-select/date-select.component.scss create mode 100644 src/app/features/administration/form/date-select/date-select.component.spec.ts create mode 100644 src/app/features/administration/form/date-select/date-select.component.ts create mode 100644 src/app/features/administration/form/kind-select/kind-select.component.html create mode 100644 src/app/features/administration/form/kind-select/kind-select.component.scss create mode 100644 src/app/features/administration/form/kind-select/kind-select.component.spec.ts create mode 100644 src/app/features/administration/form/kind-select/kind-select.component.ts create mode 100644 src/app/features/administration/form/text-select/text-select.component.html create mode 100644 src/app/features/administration/form/text-select/text-select.component.scss create mode 100644 src/app/features/administration/form/text-select/text-select.component.spec.ts create mode 100644 src/app/features/administration/form/text-select/text-select.component.ts diff --git a/src/app/core/services/api.service.ts b/src/app/core/services/api.service.ts index 12b14318..3bf4faeb 100644 --- a/src/app/core/services/api.service.ts +++ b/src/app/core/services/api.service.ts @@ -49,7 +49,7 @@ export class ApiService { public async createPoll(poll: Poll): Promise { // this.loader.setStatus(true); - console.log('config', poll); + console.log('createPoll config', poll); // const baseHref = this.useDevLocalServer ? 'http://localhost:8000' : apiBaseHref; // return this.http // .post(`${baseHref}${currentApiRoutes['api_new_poll']}`, poll, ApiService.makeHeaders()) diff --git a/src/app/features/administration/administration.module.ts b/src/app/features/administration/administration.module.ts index 20ca163f..bdd7c09c 100644 --- a/src/app/features/administration/administration.module.ts +++ b/src/app/features/administration/administration.module.ts @@ -11,9 +11,25 @@ import { NamingComponent } from './naming/naming.component'; import { FormComponent } from './form/form.component'; import { DateValueAccessorModule } from 'angular-date-value-accessor'; import { SuccessComponent } from './success/success.component'; +import { DateSelectComponent } from './form/date-select/date-select.component'; +import { TextSelectComponent } from './form/text-select/text-select.component'; +import { KindSelectComponent } from './form/kind-select/kind-select.component'; +import { BaseConfigComponent } from './form/base-config/base-config.component'; +import { AdvancedConfigComponent } from './form/advanced-config/advanced-config.component'; @NgModule({ - declarations: [AdministrationComponent, StepperComponent, NamingComponent, FormComponent, SuccessComponent], + declarations: [ + AdministrationComponent, + StepperComponent, + NamingComponent, + FormComponent, + SuccessComponent, + DateSelectComponent, + TextSelectComponent, + KindSelectComponent, + BaseConfigComponent, + AdvancedConfigComponent, + ], imports: [ AdministrationRoutingModule, CommonModule, diff --git a/src/app/features/administration/form/advanced-config/advanced-config.component.html b/src/app/features/administration/form/advanced-config/advanced-config.component.html new file mode 100644 index 00000000..a9ff8af1 --- /dev/null +++ b/src/app/features/administration/form/advanced-config/advanced-config.component.html @@ -0,0 +1,89 @@ +
+

{{ 'creation.advanced' | translate }}

+ + + + +
+ + +
+ {{ urlPrefix }} + + {{ form.controls.slug.value }} + + + + + + +
+
+ Nombre de jours avant expiration + + +
+ + Les participants pourront consulter les résultats + + + Les choix possibles concerneront des dates + + + Le sondage sera protégé par un mot de passe + + + Vous recevrez un mail à chaque nouvelle participation + + + Vous recevrez un mail à chaque nouveau commentaire + + + La réponse « peut-être » sera disponible + +
diff --git a/src/app/features/administration/form/advanced-config/advanced-config.component.scss b/src/app/features/administration/form/advanced-config/advanced-config.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/administration/form/advanced-config/advanced-config.component.spec.ts b/src/app/features/administration/form/advanced-config/advanced-config.component.spec.ts new file mode 100644 index 00000000..5407c267 --- /dev/null +++ b/src/app/features/administration/form/advanced-config/advanced-config.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AdvancedConfigComponent } from './advanced-config.component'; + +describe('AdvancedConfigComponent', () => { + let component: AdvancedConfigComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [AdvancedConfigComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AdvancedConfigComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/administration/form/advanced-config/advanced-config.component.ts b/src/app/features/administration/form/advanced-config/advanced-config.component.ts new file mode 100644 index 00000000..dcef8c78 --- /dev/null +++ b/src/app/features/administration/form/advanced-config/advanced-config.component.ts @@ -0,0 +1,14 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-advanced-config', + templateUrl: './advanced-config.component.html', + styleUrls: ['./advanced-config.component.scss'], +}) +export class AdvancedConfigComponent implements OnInit { + public urlPrefix: string = window.location.origin + '/participation/'; + + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/app/features/administration/form/base-config/base-config.component.html b/src/app/features/administration/form/base-config/base-config.component.html new file mode 100644 index 00000000..e815bc46 --- /dev/null +++ b/src/app/features/administration/form/base-config/base-config.component.html @@ -0,0 +1,89 @@ +
+
+ + {{ 'creation.choose_title' | translate }} + + + + + +
+ + + + +
+ +
+
+

+ {{ 'choices.title' | translate }} +

+ {{ 'dates.add' | translate }} +

+ + {{ 'choices.helper' | translate }} + +

+ {{ 'choices.answer_preset_1' | translate }} + {{ 'choices.add' | translate }} + {{ 'choices.continue' | translate }} +
+
+ image WIP +
+
+ +
+ +
+ + +
+
+ Slug: +
+
+
+ {{ poll.slug }} +
+
+
+
+
+
diff --git a/src/app/features/administration/form/base-config/base-config.component.scss b/src/app/features/administration/form/base-config/base-config.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/administration/form/base-config/base-config.component.spec.ts b/src/app/features/administration/form/base-config/base-config.component.spec.ts new file mode 100644 index 00000000..4acc1c58 --- /dev/null +++ b/src/app/features/administration/form/base-config/base-config.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BaseConfigComponent } from './base-config.component'; + +describe('BaseConfigComponent', () => { + let component: BaseConfigComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [BaseConfigComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BaseConfigComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/administration/form/base-config/base-config.component.ts b/src/app/features/administration/form/base-config/base-config.component.ts new file mode 100644 index 00000000..20ab5e05 --- /dev/null +++ b/src/app/features/administration/form/base-config/base-config.component.ts @@ -0,0 +1,96 @@ +import { ChangeDetectorRef, Component, Inject, Input, OnInit } from '@angular/core'; +import { ToastService } from '../../../../core/services/toast.service'; +import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { UuidService } from '../../../../core/services/uuid.service'; +import { PollService } from '../../../../core/services/poll.service'; +import { ApiService } from '../../../../core/services/api.service'; +import { Router } from '@angular/router'; +import { DOCUMENT } from '@angular/common'; +import { Poll } from '../../../../core/models/poll.model'; + +@Component({ + selector: 'app-base-config', + templateUrl: './base-config.component.html', + styleUrls: ['./base-config.component.scss'], +}) +export class BaseConfigComponent implements OnInit { + @Input() + public poll?: Poll; + public form: FormGroup; + + constructor( + private fb: FormBuilder, + private cd: ChangeDetectorRef, + private uuidService: UuidService, + private toastService: ToastService, + private pollService: PollService, + private apiService: ApiService, + private router: Router, + @Inject(DOCUMENT) private document: Document + ) {} + + ngOnInit(): void { + this.initFormDefault(false); + } + + askInitFormDefault(): void { + this.initFormDefault(false); + this.toastService.display('formulaire réinitialisé'); + } + + public createPoll(): void { + console.log('this.form', this.form); + const newpoll = this.pollService.newPollFromForm(this.form); + console.log('newpoll', newpoll); + const router = this.router; + + this.apiService.createPoll(newpoll).then((resp) => { + console.log('resp', resp); + router.navigate(['success']); + }); + // this.router + // 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'); + // } + } + + initFormDefault(showDemoValues = true): void { + this.form = this.fb.group({ + title: ['', [Validators.required, Validators.minLength(12)]], + creatorPseudo: ['', [Validators.required]], + creatorEmail: ['', [Validators.required]], + slug: [this.uuidService.getUUID(), [Validators.required]], + description: ['', [Validators.required]], + choices: new FormArray([]), + whoModifiesAnswers: ['', [Validators.required]], + whoCanChangeAnswers: ['', [Validators.required]], + isAboutDate: [true, [Validators.required]], + startDateInterval: ['', [Validators.required]], + endDateInterval: ['', [Validators.required]], + isProtectedByPassword: [false, [Validators.required]], + isOwnerNotifiedByEmailOnNewVote: [false, [Validators.required]], + isOwnerNotifiedByEmailOnNewComment: [false, [Validators.required]], + isMaybeAnswerAvailable: [false, [Validators.required]], + areResultsPublic: [true, [Validators.required]], + expiracyNumberOfDays: [60, [Validators.required, Validators.min(0)]], + }); + console.log('this.form ', this.form); + } + + public updateSlug(): void { + const newValueFormatted = 'TODO'; + this.form.patchValue({ slug: newValueFormatted }); + } + + /** + * set the poll slug from other data of the poll + */ + automaticSlug() { + this.form.patchValue({ slug: this.pollService.makeSlug(this.poll) }); + } +} diff --git a/src/app/features/administration/form/date-select/date-select.component.html b/src/app/features/administration/form/date-select/date-select.component.html new file mode 100644 index 00000000..a0d76865 --- /dev/null +++ b/src/app/features/administration/form/date-select/date-select.component.html @@ -0,0 +1,139 @@ +
+ + +
+ +

{{ 'dates.add_interval' | translate }}

+
+
+ {{ 'dates.interval_propose' | translate }} +
+
+ + +
+
+
+
+ {{ 'dates.interval_span' | translate }} +
+
+ + +
+
+ +
+ +
+
+ + {{ timeList.length }} + + + {{ 'dates.count_time' | translate }} + (pour chaque jour) + +
+
+ + + +
+ +
+
+
+ + + +
+
+
+
+ + {{ dateList.length }} + + + {{ 'dates.count_dates' | translate }} + + +
+ {{ id }}) + + + +
+
+ + +
+
+
+
+
diff --git a/src/app/features/administration/form/date-select/date-select.component.scss b/src/app/features/administration/form/date-select/date-select.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/administration/form/date-select/date-select.component.spec.ts b/src/app/features/administration/form/date-select/date-select.component.spec.ts new file mode 100644 index 00000000..d5f4b90f --- /dev/null +++ b/src/app/features/administration/form/date-select/date-select.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DateSelectComponent } from './date-select.component'; + +describe('DateSelectComponent', () => { + let component: DateSelectComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [DateSelectComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DateSelectComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/administration/form/date-select/date-select.component.ts b/src/app/features/administration/form/date-select/date-select.component.ts new file mode 100644 index 00000000..23efd1aa --- /dev/null +++ b/src/app/features/administration/form/date-select/date-select.component.ts @@ -0,0 +1,241 @@ +import { ChangeDetectorRef, Component, Inject, Input, OnInit } from '@angular/core'; +import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { UuidService } from '../../../../core/services/uuid.service'; +import { ToastService } from '../../../../core/services/toast.service'; +import { PollService } from '../../../../core/services/poll.service'; +import { DateUtilities } from '../../../old-stuff/config/DateUtilities'; +import { ApiService } from '../../../../core/services/api.service'; +import { Router } from '@angular/router'; +import { DOCUMENT } from '@angular/common'; +import { DateChoice, otherDefaultDates } from '../../../old-stuff/config/defaultConfigs'; +import { Poll } from '../../../../core/models/poll.model'; + +@Component({ + selector: 'app-date-select', + templateUrl: './date-select.component.html', + styleUrls: ['./date-select.component.scss'], +}) +export class DateSelectComponent implements OnInit { + @Input() + public poll?: Poll; + @Input() + public form: FormGroup; + + public showDateInterval = true; + public allowSeveralHours = true; + 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 + + constructor( + private fb: FormBuilder, + private cd: ChangeDetectorRef, + private uuidService: UuidService, + private toastService: ToastService, + private pollService: PollService, + public dateUtilities: DateUtilities, + private apiService: ApiService, + private router: Router, + @Inject(DOCUMENT) private document: any + ) {} + + ngOnInit(): void { + this.setDefaultDatesForInterval(); + } + + get choices(): FormArray { + return this.form.get('choices') as FormArray; + } + + /** + * default interval of dates proposed is from today to 7 days more + */ + setDefaultDatesForInterval(): void { + const dateCurrent = new Date(); + const dateJson = dateCurrent.toISOString(); + this.startDateInterval = dateJson.substring(0, 10); + this.endDateInterval = this.dateUtilities + .addDaysToDate(this.intervalDaysDefault, dateCurrent) + .toISOString() + .substring(0, 10); + this.form.patchValue({ + startDateInterval: this.startDateInterval, + endDateInterval: this.endDateInterval, + }); + this.countDays(); + } + + countDays(): void { + this.intervalDays = this.dateUtilities.countDays( + this.dateUtilities.parseInputDateToDateObject(this.startDateInterval), + this.dateUtilities.parseInputDateToDateObject(this.endDateInterval) + ); + this.cd.detectChanges(); + } + + /** + * add all the dates between the start and end dates in the interval section + */ + addIntervalOfDates(): void { + const newIntervalArray = this.dateUtilities.getDatesInRange( + this.dateUtilities.parseInputDateToDateObject(this.startDateInterval), + this.dateUtilities.parseInputDateToDateObject(this.endDateInterval), + 1 + ); + + const converted = []; + newIntervalArray.forEach((element) => { + converted.push({ + literal: element.literal, + date_object: element.date_object, + timeList: [], + }); + }); + this.dateList = [...new Set(converted)]; + // add only dates that are not already present with a Set of unique items + console.log('this.dateList', this.dateList); + 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.`); + } + + /** + * change time spans + */ + addTime() { + this.timeList.push({ + literal: '', + timeList: [], + date_object: new Date(), + }); + } + + removeAllTimes() { + this.timeList = []; + } + + resetTimes() { + this.timeList = otherDefaultDates; + } + + /** + * add a time period to a specific date choice, + * focus on the new input + * @param config + * @param id + */ + addTimeToDate(config: any, id: number) { + this.timeList.push({ + literal: '', + timeList: [], + date_object: new Date(), + }); + const selector = '[ng-reflect-choice_label="dateTime_' + id + '_Choices_' + (this.timeList.length - 1) + '"]'; + this.cd.detectChanges(); + const elem = this.document.querySelector(selector); + if (elem) { + elem.focus(); + } + } + + addChoice(optionalLabel = ''): void { + const newControlGroup = this.fb.group({ + label: this.fb.control('', [Validators.required]), + imageUrl: ['', [Validators.required]], + }); + + if (optionalLabel) { + newControlGroup.patchValue({ + label: optionalLabel, + imageUrl: 'mon url', + }); + } + this.choices.push(newControlGroup); + this.cd.detectChanges(); + console.log('this.choices.length', this.choices.length); + + this.focusOnChoice(this.choices.length - 1); + } + + focusOnChoice(index): void { + const selector = '#choice_label_' + index; + const elem = this.document.querySelector(selector); + if (elem) { + elem.focus(); + } + } + + deleteChoiceField(index: number): void { + if (this.choices.length !== 1) { + this.choices.removeAt(index); + } + } + + reinitChoices(): void { + this.choices.setValue([]); + } + + /** + * handle keyboard shortcuts + * @param $event + * @param choice_number + */ + keyOnChoice($event: KeyboardEvent, choice_number: number): void { + $event.preventDefault(); + + console.log('this.choices.length', this.choices.length); + console.log('choice_number', choice_number); + const lastChoice = this.choices.length - 1 === choice_number; + // TODO handle shortcuts + // reset field with Ctrl + D + // add a field with Ctrl + N + // go to previous choice with arrow up + // go to next choice with arrow down + console.log('$event', $event); + + if ($event.key == 'ArrowUp' && choice_number > 0) { + this.focusOnChoice(choice_number - 1); + } + if ($event.key == 'ArrowDown') { + // add a field if we are on the last choice + if (lastChoice) { + this.addChoice(); + this.toastService.display('choix ajouté par raccourci "flèche bas"'); + } else { + this.focusOnChoice(choice_number + 1); + } + } + if ($event.ctrlKey && $event.key == 'Backspace') { + this.deleteChoiceField(choice_number); + this.toastService.display('choix supprimé par raccourci "Ctrl + retour"'); + this.cd.detectChanges(); + this.focusOnChoice(Math.min(choice_number - 1, 0)); + } + if ($event.ctrlKey && $event.key == 'Enter') { + // go to other fields + const elem = this.document.querySelector('#creatorEmail'); + if (elem) { + elem.focus(); + } + } + } + + setDemoValues(): void { + this.addChoice('orange'); + this.addChoice('raisin'); + this.addChoice('abricot'); + } +} diff --git a/src/app/features/administration/form/form.component.html b/src/app/features/administration/form/form.component.html index 1754e4d5..63131d2c 100644 --- a/src/app/features/administration/form/form.component.html +++ b/src/app/features/administration/form/form.component.html @@ -2,424 +2,38 @@

{{ 'creation.title' | translate }}

- -
-
- image WIP -
-
- -
- -
- - -
- {{ poll.slug }} -
-
-
-
- le formulaire est invalide -
-
- {{ form.errors | json }}
+	
+
+ le formulaire est invalide +
+		 {{ form.errors | json }}
 		
+ > +
-
-
- - {{ timeList.length }} - - - {{ 'dates.count_time' | translate }} - (pour chaque jour) - -
-
- - - -
+ + + + + + + + -
-
-
- - - -
-
-
-
- - {{ dateList.length }} - - - {{ 'dates.count_dates' | translate }} - - -
- {{ id }}) - - - -
-
- - -
-
-
-

-
- - {{ 'creation.want' | translate }} - -
-
- -
-
- -
-
- - - {{ 'creation.choose_title' | translate }} - - - - -
- -
- -
- - -
-

{{ 'dates.add_interval' | translate }}

-
-
- {{ 'dates.interval_propose' | translate }} -
-
- - -
-
-
-
- {{ 'dates.interval_span' | translate }} -
-
- - -
-
- -
-
- -
-

- {{ 'choices.title' | translate }} -

- {{ 'dates.add' | translate }} -

- - {{ 'choices.helper' | translate }} - -

- {{ 'choices.answer_preset_1' | translate }} - {{ 'choices.add' | translate }} - {{ 'choices.continue' | translate }} - - - - - - - - - - -

- {{ 'creation.choices_hint' | translate }} -

- -
-
-
- - {{ i * 1 + 1 }}) -
-
- - -
- - -
-
-
-
-
-
- -
- - - - -
- -
- -
- -
-

{{ 'creation.advanced' | translate }}

- - - - -
- - -
- {{ urlPrefix }} - - {{ form.controls.slug.value }} - - - - - - -
-
- Nombre de jours avant expiration - - -
- - Les participants pourront consulter les résultats - - - Les choix possibles concerneront des dates - - - Le sondage sera protégé par un mot de passe - - - Vous recevrez un mail à chaque nouvelle participation - - - Vous recevrez un mail à chaque nouveau commentaire - - - La réponse « peut-être » sera disponible - -
- diff --git a/src/app/features/administration/form/form.component.ts b/src/app/features/administration/form/form.component.ts index 5d1c976b..eb5b3939 100644 --- a/src/app/features/administration/form/form.component.ts +++ b/src/app/features/administration/form/form.component.ts @@ -7,8 +7,7 @@ import { ToastService } from '../../../core/services/toast.service'; import { PollService } from '../../../core/services/poll.service'; import { DateUtilities } from '../../old-stuff/config/DateUtilities'; import { DOCUMENT } from '@angular/common'; -import { DateChoice, otherDefaultDates } from '../../old-stuff/config/defaultConfigs'; -import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; +import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { Router } from '@angular/router'; @Component({ @@ -21,16 +20,7 @@ export class FormComponent implements OnInit { public poll?: Poll; public form: FormGroup; - public urlPrefix: string = window.location.origin + '/participation/'; public advancedDisplayEnabled = false; - public showDateInterval = true; - public allowSeveralHours = true; - 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 constructor( private fb: FormBuilder, @@ -43,84 +33,18 @@ export class FormComponent implements OnInit { private router: Router, @Inject(DOCUMENT) private document: any ) {} + drop(event: CdkDragDrop) { // moveItemInArray(this.choices, event.previousIndex, event.currentIndex); } - get choices(): FormArray { - return this.form.get('choices') as FormArray; - } ngOnInit(): void { this.initFormDefault(); - // TO remove after - // this.createPoll(); + const pollsAvailable = this.pollService.getAllAvailablePolls(); console.log('pollsAvailable', pollsAvailable); } - public createPoll(): void { - console.log('this.form', this.form); - const newpoll = this.pollService.newPollFromForm(this.form); - console.log('newpoll', newpoll); - let self = this; - - this.apiService.createPoll(newpoll).then((resp) => { - console.log('resp', resp); - self.router.navigate(['success']); - }); - // this.router - // 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 { - const newValueFormatted = 'TODO'; - this.form.patchValue({ slug: newValueFormatted }); - } - - addChoice(optionalLabel = ''): void { - const newControlGroup = this.fb.group({ - label: this.fb.control('', [Validators.required]), - imageUrl: ['', [Validators.required]], - }); - - if (optionalLabel) { - newControlGroup.patchValue({ - label: optionalLabel, - imageUrl: 'mon url', - }); - } - this.choices.push(newControlGroup); - this.cd.detectChanges(); - console.log('this.choices.length', this.choices.length); - - this.focusOnChoice(this.choices.length - 1); - } - - focusOnChoice(index): void { - const selector = '#choice_label_' + index; - const elem = this.document.querySelector(selector); - if (elem) { - elem.focus(); - } - } - - deleteChoiceField(index: number): void { - if (this.choices.length !== 1) { - this.choices.removeAt(index); - } - } - - reinitChoices(): void { - this.choices.setValue([]); - } - initFormDefault(showDemoValues = true): void { this.form = this.fb.group({ title: ['', [Validators.required, Validators.minLength(12)]], @@ -142,39 +66,16 @@ export class FormComponent implements OnInit { expiracyNumberOfDays: [60, [Validators.required, Validators.min(0)]], }); console.log('this.form ', this.form); - this.setDefaultDatesForInterval(); if (showDemoValues) { this.setDemoValues(); } } - /** - * default interval of dates proposed is from today to 7 days more - */ - setDefaultDatesForInterval(): void { - const dateCurrent = new Date(); - const dateJson = dateCurrent.toISOString(); - this.startDateInterval = dateJson.substring(0, 10); - this.endDateInterval = this.dateUtilities - .addDaysToDate(this.intervalDaysDefault, dateCurrent) - .toISOString() - .substring(0, 10); - this.form.patchValue({ - startDateInterval: this.startDateInterval, - endDateInterval: this.endDateInterval, - }); - this.countDays(); - } - /** * add example values to the form */ setDemoValues(): void { - this.addChoice('orange'); - this.addChoice('raisin'); - this.addChoice('abricot'); - this.form.patchValue({ title: 'mon titre', description: 'répondez SVP <3 ! *-* ', @@ -191,145 +92,5 @@ export class FormComponent implements OnInit { areResultsPublic: true, expiracyNumberOfDays: 60, }); - this.automaticSlug(); - } - - askInitFormDefault(): void { - this.initFormDefault(false); - this.toastService.display('formulaire réinitialisé'); - } - - countDays(): void { - this.intervalDays = this.dateUtilities.countDays( - this.dateUtilities.parseInputDateToDateObject(this.startDateInterval), - this.dateUtilities.parseInputDateToDateObject(this.endDateInterval) - ); - this.cd.detectChanges(); - } - - /** - * add all the dates between the start and end dates in the interval section - */ - addIntervalOfDates(): void { - const newIntervalArray = this.dateUtilities.getDatesInRange( - this.dateUtilities.parseInputDateToDateObject(this.startDateInterval), - this.dateUtilities.parseInputDateToDateObject(this.endDateInterval), - 1 - ); - - const converted = []; - newIntervalArray.forEach((element) => { - converted.push({ - literal: element.literal, - date_object: element.date_object, - timeList: [], - }); - }); - this.dateList = [...new Set(converted)]; - // add only dates that are not already present with a Set of unique items - console.log('this.dateList', this.dateList); - 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.`); - } - - /** - * handle keyboard shortcuts - * @param $event - * @param choice_number - */ - keyOnChoice($event: KeyboardEvent, choice_number: number): void { - $event.preventDefault(); - - console.log('this.choices.length', this.choices.length); - console.log('choice_number', choice_number); - const lastChoice = this.choices.length - 1 === choice_number; - // reset field with Ctrl + D - // add a field with Ctrl + N - // go to previous choice with arrow up - // go to next choice with arrow down - console.log('$event', $event); - - if ($event.key == 'ArrowUp' && choice_number > 0) { - this.focusOnChoice(choice_number - 1); - } - if ($event.key == 'ArrowDown') { - // add a field if we are on the last choice - if (lastChoice) { - this.addChoice(); - this.toastService.display('choix ajouté par raccourci "flèche bas"'); - } else { - this.focusOnChoice(choice_number + 1); - } - } - if ($event.ctrlKey && $event.key == 'Backspace') { - this.deleteChoiceField(choice_number); - this.toastService.display('choix supprimé par raccourci "Ctrl + retour"'); - this.cd.detectChanges(); - this.focusOnChoice(Math.min(choice_number - 1, 0)); - } - if ($event.ctrlKey && $event.key == 'Enter') { - // go to other fields - const elem = this.document.querySelector('#creatorEmail'); - if (elem) { - elem.focus(); - } - } - } - - /** - * change time spans - */ - addTime() { - this.timeList.push({ - literal: '', - timeList: [], - date_object: new Date(), - }); - } - - removeAllTimes() { - this.timeList = []; - } - - resetTimes() { - this.timeList = otherDefaultDates; - } - - /** - * add a time period to a specific date choice, - * focus on the new input - * @param config - * @param id - */ - addTimeToDate(config: any, id: number) { - this.timeList.push({ - literal: '', - timeList: [], - date_object: new Date(), - }); - const selector = '[ng-reflect-choice_label="dateTime_' + id + '_Choices_' + (this.timeList.length - 1) + '"]'; - this.cd.detectChanges(); - const elem = this.document.querySelector(selector); - if (elem) { - elem.focus(); - } - } - - /** - * set the poll slug from other data of the poll - */ - automaticSlug() { - this.poll.slug = this.pollService.makeSlug(this.poll); } } diff --git a/src/app/features/administration/form/kind-select/kind-select.component.html b/src/app/features/administration/form/kind-select/kind-select.component.html new file mode 100644 index 00000000..df196976 --- /dev/null +++ b/src/app/features/administration/form/kind-select/kind-select.component.html @@ -0,0 +1,27 @@ +
+ + {{ 'creation.want' | translate }} + +
+
+ +
+
+ +
+
+
diff --git a/src/app/features/administration/form/kind-select/kind-select.component.scss b/src/app/features/administration/form/kind-select/kind-select.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/administration/form/kind-select/kind-select.component.spec.ts b/src/app/features/administration/form/kind-select/kind-select.component.spec.ts new file mode 100644 index 00000000..a1ad23c5 --- /dev/null +++ b/src/app/features/administration/form/kind-select/kind-select.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { KindSelectComponent } from './kind-select.component'; + +describe('KindSelectComponent', () => { + let component: KindSelectComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [KindSelectComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(KindSelectComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/administration/form/kind-select/kind-select.component.ts b/src/app/features/administration/form/kind-select/kind-select.component.ts new file mode 100644 index 00000000..c5de0c74 --- /dev/null +++ b/src/app/features/administration/form/kind-select/kind-select.component.ts @@ -0,0 +1,19 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { Poll } from '../../../../core/models/poll.model'; +import { FormGroup } from '@angular/forms'; + +@Component({ + selector: 'app-kind-select', + templateUrl: './kind-select.component.html', + styleUrls: ['./kind-select.component.scss'], +}) +export class KindSelectComponent implements OnInit { + @Input() + public poll?: Poll; + @Input() + public form: FormGroup; + + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/app/features/administration/form/text-select/text-select.component.html b/src/app/features/administration/form/text-select/text-select.component.html new file mode 100644 index 00000000..6b57d555 --- /dev/null +++ b/src/app/features/administration/form/text-select/text-select.component.html @@ -0,0 +1,55 @@ +
+ + + + + + + + + + + +

+ {{ 'creation.choices_hint' | translate }} +

+ +
+
+
+ + {{ i * 1 + 1 }}) +
+
+ + +
+ + +
+
+
+
+
+ +
diff --git a/src/app/features/administration/form/text-select/text-select.component.scss b/src/app/features/administration/form/text-select/text-select.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/administration/form/text-select/text-select.component.spec.ts b/src/app/features/administration/form/text-select/text-select.component.spec.ts new file mode 100644 index 00000000..5eb68bf3 --- /dev/null +++ b/src/app/features/administration/form/text-select/text-select.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TextSelectComponent } from './text-select.component'; + +describe('TextSelectComponent', () => { + let component: TextSelectComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [TextSelectComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TextSelectComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/administration/form/text-select/text-select.component.ts b/src/app/features/administration/form/text-select/text-select.component.ts new file mode 100644 index 00000000..76bb46cb --- /dev/null +++ b/src/app/features/administration/form/text-select/text-select.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-text-select', + templateUrl: './text-select.component.html', + styleUrls: ['./text-select.component.scss'], +}) +export class TextSelectComponent implements OnInit { + constructor() {} + + ngOnInit(): void {} +} From 2d9f1f7d40468d0b2ba3634e7cdd6cbf3f1a8118 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Thu, 4 Feb 2021 17:56:46 +0100 Subject: [PATCH 004/573] homepage texts --- .../core/components/home/home.component.html | 89 +++++++++++++------ src/assets/i18n/FR.json | 3 +- 2 files changed, 66 insertions(+), 26 deletions(-) diff --git a/src/app/core/components/home/home.component.html b/src/app/core/components/home/home.component.html index 20641ab1..cb87a8f9 100644 --- a/src/app/core/components/home/home.component.html +++ b/src/app/core/components/home/home.component.html @@ -34,35 +34,74 @@
- image WIP -

+

+

+ {{ 'SENTENCES.what-is-framadate' | translate }} +

+ {{ 'SENTENCES.framadate-is-an-online-service-for-planning-an-appointment-or-making-a-decision-quickly-and-easily' | translate }} - {{ 'SENTENCES.here-is-how-it-works' | translate }} - {{ 'SENTENCES.send-the-poll-link-to-your-friends-or-colleagues' | translate }} -

-

- {{ 'SENTENCES.what-is-framadate' | translate }} - {{ 'SENTENCES.view-an-example' | translate }} - {{ 'SENTENCES.framadate-is-licensed-under-the' | translate }} - - GNU Affero v3 Licence - -

-

- {{ 'SENTENCES.grow-your-own' | translate }} - {{ - 'SENTENCES.if-you-want-to-install-the-software-for-your-own-use-and-thus-increase-your-independence-we-can-help' - | translate - }} - {{ - 'SENTENCES.to-participate-in-the-software-development-suggest-improvements-or-simply-download-it-please-visit' - | translate - }} - {{ 'SENTENCES.the-development-site' | translate }} -

+
+
+
+ image WIP +
+
+

+ + {{ 'SENTENCES.here-is-how-it-works' | translate }} +

+

+ {{ 'SENTENCES.send-the-poll-link-to-your-friends-or-colleagues' | translate }} + + {{ 'SENTENCES.what-you-can-do' | translate }} +

+

+ + {{ 'SENTENCES.view-an-example' | translate }} +

+

+ + Orange ou citron? + +

+

+ + + {{ 'SENTENCES.framadate-is-licensed-under-the' | translate }} + + GNU Affero v3 Licence + + + + Sources + +

+
+ +
+

+ + {{ 'SENTENCES.grow-your-own' | translate }} +

+

+ {{ + 'SENTENCES.if-you-want-to-install-the-software-for-your-own-use-and-thus-increase-your-independence-we-can-help' + | translate + }} + {{ + 'SENTENCES.to-participate-in-the-software-development-suggest-improvements-or-simply-download-it-please-visit' + | translate + }} + {{ 'SENTENCES.the-development-site' | translate }} +

+
+
diff --git a/src/assets/i18n/FR.json b/src/assets/i18n/FR.json index df1c8d17..a2c693b7 100644 --- a/src/assets/i18n/FR.json +++ b/src/assets/i18n/FR.json @@ -149,7 +149,8 @@ "do-you-want-to": "Voulez-vous", "framadate-is-an-online-service-for-planning-an-appointment-or-making-a-decision-quickly-and-easily-n": "Framadate est un service en ligne permettant de planifier un rendez-vous ou prendre des décisions rapidement et simplement. Aucune inscription préalable n’est nécessaire.", "here-is-how-it-works": "Voici comment ça fonctionne :", - "send-the-poll-link-to-your-friends-or-colleagues": "Envoyez le lien du sondage à vos ami·e·s ou collègues", + "send-the-poll-link-to-your-friends-or-colleagues": "Créez un sondage en choisissant les réponses possibles, et vous recevez un lien par email. Envoyez le lien du sondage à vos ami·e·s ou collègues.", + "what-you-can-do": "Vous pouvez faire des propositions de dates et horaires de rendez-vous, limiter le nombre de participants, poser des questions de toutes sortes, permettre de la finesse dans les réponses, exporter les données... tout reste sous votre contrôle et vos libertés seront toujours respectées, car c'est un logiciel libre.", "what-is-framadate": "Prise en main", "view-an-example": "voir un exemple ?", "cecill-b-license": "licence CeCILL-B", From 5bac37a7905ba1ccd16bab3568a366bf8b9d9090 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Thu, 4 Feb 2021 18:34:06 +0100 Subject: [PATCH 005/573] home page reorder and statistics, todo component --- src/app/app-routing.module.ts | 13 +-- src/app/app.component.ts | 1 - src/app/app.module.ts | 1 - .../core/components/home/home.component.html | 93 +++++++++++++------ .../user-polls/user-polls.component.html | 26 +++--- .../user-profile/user-profile.module.ts | 9 +- src/app/routes-framadate.ts | 5 + .../ui/wip-todo/wip-todo.component.html | 11 +++ .../ui/wip-todo/wip-todo.component.scss | 0 .../ui/wip-todo/wip-todo.component.spec.ts | 24 +++++ .../ui/wip-todo/wip-todo.component.ts | 12 +++ src/app/shared/shared.module.ts | 2 + src/environments/environment.ts | 4 +- 13 files changed, 148 insertions(+), 53 deletions(-) create mode 100644 src/app/shared/components/ui/wip-todo/wip-todo.component.html create mode 100644 src/app/shared/components/ui/wip-todo/wip-todo.component.scss create mode 100644 src/app/shared/components/ui/wip-todo/wip-todo.component.spec.ts create mode 100644 src/app/shared/components/ui/wip-todo/wip-todo.component.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 5e91c5eb..f347c701 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,14 +1,9 @@ -import {NgModule} from '@angular/core'; -import {RouterModule} from '@angular/router'; -import {routes} from "./routes-framadate"; - +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { routes } from './routes-framadate'; @NgModule({ - imports: [ - RouterModule.forRoot(routes, { - // enableTracing: true, // <-- debugging purposes only - }), - ], + imports: [RouterModule.forRoot(routes)], exports: [RouterModule], }) export class AppRoutingModule {} diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c4e0eb3d..f071ed2e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -6,7 +6,6 @@ import { environment } from '../environments/environment'; import { Theme } from './core/enums/theme.enum'; import { LanguageService } from './core/services/language.service'; import { ThemeService } from './core/services/theme.service'; -import { MockingService } from './core/services/mocking.service'; @Component({ selector: 'app-root', diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 7db18013..db24b22b 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -23,7 +23,6 @@ import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { CoreModule } from './core/core.module'; import { SharedModule } from './shared/shared.module'; - registerLocaleData(localeEn, 'en-EN'); registerLocaleData(localeFr, 'fr-FR'); diff --git a/src/app/core/components/home/home.component.html b/src/app/core/components/home/home.component.html index cb87a8f9..bc0a3116 100644 --- a/src/app/core/components/home/home.component.html +++ b/src/app/core/components/home/home.component.html @@ -1,10 +1,20 @@
-

- {{ 'home.title' | translate }} - {{ env.appTitle }} -

+
+
+

+ {{ 'home.title' | translate }} + {{ env.appTitle }} +

+ + {{ + 'SENTENCES.framadate-is-an-online-service-for-planning-an-appointment-or-making-a-decision-quickly-and-easily' + | translate + }} +
+ image WIP +

@@ -19,34 +29,22 @@

+
-
-

- {{ 'SENTENCES.what-is-framadate' | translate }} -

- - {{ - 'SENTENCES.framadate-is-an-online-service-for-planning-an-appointment-or-making-a-decision-quickly-and-easily' - | translate - }} -
-
-
- image WIP

@@ -72,15 +70,9 @@ {{ 'SENTENCES.framadate-is-licensed-under-the' | translate }} + GNU Affero v3 Licence - - - Sources -

@@ -103,6 +95,55 @@
+ +

Statistiques

+ +
+
+
+
+ 62 346 +
+

sondages

+
+
+
+ 223 124 +
+

votes

+
+
+
+ 123 +
+

consensus parfaits

+
+
+
+ 41 875 +
+

commentaires

+
+
+
+
+
+ 44 985 +
+

sondages de type date

+
+
+
+ 22 985 +
+

sondages de type classique

+
+
+

Mentions légales

+

Voir ici le détail des mentions légales, CGU, CPU, politique de confidentialité.

+
+
+
diff --git a/src/app/features/user-profile/user-polls/user-polls.component.html b/src/app/features/user-profile/user-polls/user-polls.component.html index eca9d4f9..1b24d918 100644 --- a/src/app/features/user-profile/user-polls/user-polls.component.html +++ b/src/app/features/user-profile/user-polls/user-polls.component.html @@ -4,6 +4,19 @@

Mes sondages

+
+
+
+ + + +
+
+
@@ -23,17 +36,4 @@
-
-
-
- - -
-
-
diff --git a/src/app/features/user-profile/user-profile.module.ts b/src/app/features/user-profile/user-profile.module.ts index 0dc60659..ad45254b 100644 --- a/src/app/features/user-profile/user-profile.module.ts +++ b/src/app/features/user-profile/user-profile.module.ts @@ -5,9 +5,16 @@ import { TranslateModule } from '@ngx-translate/core'; import { SharedModule } from '../../shared/shared.module'; import { UserPollsComponent } from './user-polls/user-polls.component'; import { UserProfileRoutingModule } from './user-profile-routing.module'; +import { AppModule } from '../../app.module'; @NgModule({ declarations: [UserPollsComponent], - imports: [CommonModule, UserProfileRoutingModule, SharedModule, TranslateModule.forChild({ extend: true })], + imports: [ + CommonModule, + UserProfileRoutingModule, + SharedModule, + TranslateModule.forChild({ extend: true }), + AppModule, + ], }) export class UserProfileModule {} diff --git a/src/app/routes-framadate.ts b/src/app/routes-framadate.ts index 0129c932..1e6b2c0e 100644 --- a/src/app/routes-framadate.ts +++ b/src/app/routes-framadate.ts @@ -3,6 +3,7 @@ import { HomeComponent } from './core/components/home/home.component'; import { PollService } from './core/services/poll.service'; import { PageNotFoundComponent } from './shared/components/page-not-found/page-not-found.component'; import { SuccessComponent } from './features/administration/success/success.component'; +import { WipTodoComponent } from './shared/components/ui/wip-todo/wip-todo.component'; export const routes: Routes = [ { path: '', component: HomeComponent }, @@ -40,6 +41,10 @@ export const routes: Routes = [ path: 'success', component: SuccessComponent, }, + { + path: 'todo', + component: WipTodoComponent, + }, { path: 'page-not-found', component: PageNotFoundComponent }, { path: '**', redirectTo: 'page-not-found', pathMatch: 'full' }, ]; diff --git a/src/app/shared/components/ui/wip-todo/wip-todo.component.html b/src/app/shared/components/ui/wip-todo/wip-todo.component.html new file mode 100644 index 00000000..4e86e638 --- /dev/null +++ b/src/app/shared/components/ui/wip-todo/wip-todo.component.html @@ -0,0 +1,11 @@ +
+
+
+ +
+
+ Cette fonctionnalité est en cours de développement, vous pouvez contribuer à son + amélioration avec le bouton de feedback. +
+
+
diff --git a/src/app/shared/components/ui/wip-todo/wip-todo.component.scss b/src/app/shared/components/ui/wip-todo/wip-todo.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/shared/components/ui/wip-todo/wip-todo.component.spec.ts b/src/app/shared/components/ui/wip-todo/wip-todo.component.spec.ts new file mode 100644 index 00000000..ee227b25 --- /dev/null +++ b/src/app/shared/components/ui/wip-todo/wip-todo.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WipTodoComponent } from './wip-todo.component'; + +describe('WipTodoComponent', () => { + let component: WipTodoComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [WipTodoComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WipTodoComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/components/ui/wip-todo/wip-todo.component.ts b/src/app/shared/components/ui/wip-todo/wip-todo.component.ts new file mode 100644 index 00000000..9e861c15 --- /dev/null +++ b/src/app/shared/components/ui/wip-todo/wip-todo.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-wip-todo', + templateUrl: './wip-todo.component.html', + styleUrls: ['./wip-todo.component.scss'], +}) +export class WipTodoComponent implements OnInit { + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index d75e7988..1ecfed1c 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -25,6 +25,7 @@ import { SettingsComponent } from './components/settings/settings.component'; import { SpinnerComponent } from './components/spinner/spinner.component'; import { CopyTextComponent } from './components/ui/copy-text/copy-text.component'; import { ErasableInputComponent } from './components/ui/erasable-input/erasable-input.component'; +import { WipTodoComponent } from './components/ui/wip-todo/wip-todo.component'; const COMPONENTS = [ ChoiceDetailsComponent, @@ -37,6 +38,7 @@ const COMPONENTS = [ ThemeSelectorComponent, CopyTextComponent, ErasableInputComponent, + WipTodoComponent, ]; const ANGULAR_MODULES = [CommonModule, ChartsModule, FormsModule, TranslateModule]; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index d4c9aff8..86d5495a 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,10 +4,10 @@ const backendApiUrlsInDev = { local: '/api/v1', - remote: 'https://framadate-api.cipherbliss.com/api/v1', + remote: 'http://localhost:8000/api/v1', }; const apiV1 = { - baseHref: 'https://framadate-api.cipherbliss.com/api/v1', + baseHref: 'http://localhost:8000/api/v1', api_new_poll: '/poll/', api_get_poll: '/poll/{id}', 'api_test-mail-poll': '/api/v1/poll/mail/test-mail-poll/{emailChoice}', From 1717f738d19e65c22d91b1f429cde654fb677ad0 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Thu, 4 Feb 2021 18:54:30 +0100 Subject: [PATCH 006/573] link to static pages --- src/app/app.module.ts | 5 ++- .../core/components/home/home.component.html | 40 +++++++++++++++---- .../ui/static-pages/cgu/cgu.component.html | 26 ++++++++++++ .../ui/static-pages/cgu/cgu.component.scss | 0 .../ui/static-pages/cgu/cgu.component.spec.ts | 24 +++++++++++ .../ui/static-pages/cgu/cgu.component.ts | 12 ++++++ .../static-pages/legal/legal.component.html | 14 +++++++ .../static-pages/legal/legal.component.scss | 0 .../legal/legal.component.spec.ts | 24 +++++++++++ .../ui/static-pages/legal/legal.component.ts | 12 ++++++ .../privacy/privacy.component.html | 10 +++++ .../privacy/privacy.component.scss | 0 .../privacy/privacy.component.spec.ts | 24 +++++++++++ .../static-pages/privacy/privacy.component.ts | 12 ++++++ src/app/routes-framadate.ts | 15 +++++++ 15 files changed, 209 insertions(+), 9 deletions(-) create mode 100644 src/app/features/shared/components/ui/static-pages/cgu/cgu.component.html create mode 100644 src/app/features/shared/components/ui/static-pages/cgu/cgu.component.scss create mode 100644 src/app/features/shared/components/ui/static-pages/cgu/cgu.component.spec.ts create mode 100644 src/app/features/shared/components/ui/static-pages/cgu/cgu.component.ts create mode 100644 src/app/features/shared/components/ui/static-pages/legal/legal.component.html create mode 100644 src/app/features/shared/components/ui/static-pages/legal/legal.component.scss create mode 100644 src/app/features/shared/components/ui/static-pages/legal/legal.component.spec.ts create mode 100644 src/app/features/shared/components/ui/static-pages/legal/legal.component.ts create mode 100644 src/app/features/shared/components/ui/static-pages/privacy/privacy.component.html create mode 100644 src/app/features/shared/components/ui/static-pages/privacy/privacy.component.scss create mode 100644 src/app/features/shared/components/ui/static-pages/privacy/privacy.component.spec.ts create mode 100644 src/app/features/shared/components/ui/static-pages/privacy/privacy.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index db24b22b..8a8301b6 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -23,6 +23,9 @@ import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { CoreModule } from './core/core.module'; import { SharedModule } from './shared/shared.module'; +import { CguComponent } from './features/shared/components/ui/static-pages/cgu/cgu.component'; +import { LegalComponent } from './features/shared/components/ui/static-pages/legal/legal.component'; +import { PrivacyComponent } from './features/shared/components/ui/static-pages/privacy/privacy.component'; registerLocaleData(localeEn, 'en-EN'); registerLocaleData(localeFr, 'fr-FR'); @@ -37,7 +40,7 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader { } @NgModule({ - declarations: [AppComponent], + declarations: [AppComponent, CguComponent, LegalComponent, PrivacyComponent], imports: [ AppRoutingModule, BrowserAnimationsModule, diff --git a/src/app/core/components/home/home.component.html b/src/app/core/components/home/home.component.html index bc0a3116..7e973eba 100644 --- a/src/app/core/components/home/home.component.html +++ b/src/app/core/components/home/home.component.html @@ -102,24 +102,22 @@
+ 62 346

sondages

+ 223 124

votes

+
- 123 -
-

consensus parfaits

-
-
-
+ 41 875

commentaires

@@ -128,22 +126,48 @@
+ 44 985

sondages de type date

+
+ 22 985

sondages de type classique

-

Mentions légales

-

Voir ici le détail des mentions légales, CGU, CPU, politique de confidentialité.

+
+ + 123 +
+

consensus parfaits

+
diff --git a/src/app/features/shared/components/ui/static-pages/cgu/cgu.component.html b/src/app/features/shared/components/ui/static-pages/cgu/cgu.component.html new file mode 100644 index 00000000..0ece82f4 --- /dev/null +++ b/src/app/features/shared/components/ui/static-pages/cgu/cgu.component.html @@ -0,0 +1,26 @@ +
+
+
+
+

+ Conditions Générales d'utilisation +

+

+ Détail des CGU. +
+ Ne nous prenez pas pour des chatons. +

+
+
+
+
+

+ Conditions Particulières d'utilisation +

+

+ Détail des CPU +

+
+
+
+
diff --git a/src/app/features/shared/components/ui/static-pages/cgu/cgu.component.scss b/src/app/features/shared/components/ui/static-pages/cgu/cgu.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/shared/components/ui/static-pages/cgu/cgu.component.spec.ts b/src/app/features/shared/components/ui/static-pages/cgu/cgu.component.spec.ts new file mode 100644 index 00000000..4af41638 --- /dev/null +++ b/src/app/features/shared/components/ui/static-pages/cgu/cgu.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CguComponent } from './cgu.component'; + +describe('CguComponent', () => { + let component: CguComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [CguComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CguComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/shared/components/ui/static-pages/cgu/cgu.component.ts b/src/app/features/shared/components/ui/static-pages/cgu/cgu.component.ts new file mode 100644 index 00000000..138c3b3d --- /dev/null +++ b/src/app/features/shared/components/ui/static-pages/cgu/cgu.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-cgu', + templateUrl: './cgu.component.html', + styleUrls: ['./cgu.component.scss'], +}) +export class CguComponent implements OnInit { + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/app/features/shared/components/ui/static-pages/legal/legal.component.html b/src/app/features/shared/components/ui/static-pages/legal/legal.component.html new file mode 100644 index 00000000..f476e4b4 --- /dev/null +++ b/src/app/features/shared/components/ui/static-pages/legal/legal.component.html @@ -0,0 +1,14 @@ +
+
+
+
+

+ Mentions légales +

+

+ détail des mentions légales +

+
+
+
+
diff --git a/src/app/features/shared/components/ui/static-pages/legal/legal.component.scss b/src/app/features/shared/components/ui/static-pages/legal/legal.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/shared/components/ui/static-pages/legal/legal.component.spec.ts b/src/app/features/shared/components/ui/static-pages/legal/legal.component.spec.ts new file mode 100644 index 00000000..c2b1a5d8 --- /dev/null +++ b/src/app/features/shared/components/ui/static-pages/legal/legal.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LegalComponent } from './legal.component'; + +describe('LegalComponent', () => { + let component: LegalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [LegalComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LegalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/shared/components/ui/static-pages/legal/legal.component.ts b/src/app/features/shared/components/ui/static-pages/legal/legal.component.ts new file mode 100644 index 00000000..a363b6bd --- /dev/null +++ b/src/app/features/shared/components/ui/static-pages/legal/legal.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-legal', + templateUrl: './legal.component.html', + styleUrls: ['./legal.component.scss'], +}) +export class LegalComponent implements OnInit { + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/app/features/shared/components/ui/static-pages/privacy/privacy.component.html b/src/app/features/shared/components/ui/static-pages/privacy/privacy.component.html new file mode 100644 index 00000000..78a7d8b6 --- /dev/null +++ b/src/app/features/shared/components/ui/static-pages/privacy/privacy.component.html @@ -0,0 +1,10 @@ +
+
+

+ Politique de confidentialité +

+

+ Privacy policy +

+
+
diff --git a/src/app/features/shared/components/ui/static-pages/privacy/privacy.component.scss b/src/app/features/shared/components/ui/static-pages/privacy/privacy.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/shared/components/ui/static-pages/privacy/privacy.component.spec.ts b/src/app/features/shared/components/ui/static-pages/privacy/privacy.component.spec.ts new file mode 100644 index 00000000..f78d83eb --- /dev/null +++ b/src/app/features/shared/components/ui/static-pages/privacy/privacy.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PrivacyComponent } from './privacy.component'; + +describe('PrivacyComponent', () => { + let component: PrivacyComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [PrivacyComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PrivacyComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/shared/components/ui/static-pages/privacy/privacy.component.ts b/src/app/features/shared/components/ui/static-pages/privacy/privacy.component.ts new file mode 100644 index 00000000..57c6a06d --- /dev/null +++ b/src/app/features/shared/components/ui/static-pages/privacy/privacy.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-privacy', + templateUrl: './privacy.component.html', + styleUrls: ['./privacy.component.scss'], +}) +export class PrivacyComponent implements OnInit { + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/app/routes-framadate.ts b/src/app/routes-framadate.ts index 1e6b2c0e..98b65720 100644 --- a/src/app/routes-framadate.ts +++ b/src/app/routes-framadate.ts @@ -4,6 +4,9 @@ import { PollService } from './core/services/poll.service'; import { PageNotFoundComponent } from './shared/components/page-not-found/page-not-found.component'; import { SuccessComponent } from './features/administration/success/success.component'; import { WipTodoComponent } from './shared/components/ui/wip-todo/wip-todo.component'; +import { CguComponent } from './features/shared/components/ui/static-pages/cgu/cgu.component'; +import { LegalComponent } from './features/shared/components/ui/static-pages/legal/legal.component'; +import { PrivacyComponent } from './features/shared/components/ui/static-pages/privacy/privacy.component'; export const routes: Routes = [ { path: '', component: HomeComponent }, @@ -45,6 +48,18 @@ export const routes: Routes = [ path: 'todo', component: WipTodoComponent, }, + { + path: 'cgu', + component: CguComponent, + }, + { + path: 'legal', + component: LegalComponent, + }, + { + path: 'privacy', + component: PrivacyComponent, + }, { path: 'page-not-found', component: PageNotFoundComponent }, { path: '**', redirectTo: 'page-not-found', pathMatch: 'full' }, ]; From feb0de8270204c31cbb92f6a6420644cc1a99e9e Mon Sep 17 00:00:00 2001 From: Tykayn Date: Thu, 4 Feb 2021 19:04:20 +0100 Subject: [PATCH 007/573] include advanced choices and toggle visibility of sub component --- .../advanced-config.component.html | 160 +++++++++--------- .../advanced-config.component.ts | 9 +- .../base-config/base-config.component.html | 55 +++--- .../form/base-config/base-config.component.ts | 1 + .../administration/form/form.component.html | 49 +++--- 5 files changed, 148 insertions(+), 126 deletions(-) diff --git a/src/app/features/administration/form/advanced-config/advanced-config.component.html b/src/app/features/administration/form/advanced-config/advanced-config.component.html index a9ff8af1..0862e8c7 100644 --- a/src/app/features/administration/form/advanced-config/advanced-config.component.html +++ b/src/app/features/administration/form/advanced-config/advanced-config.component.html @@ -1,89 +1,91 @@ -
-

{{ 'creation.advanced' | translate }}

- - - - -
- - -
- {{ urlPrefix }} - - {{ form.controls.slug.value }} - - - - - - -
-
- Nombre de jours avant expiration - +
+

{{ 'creation.advanced' | translate }}

+ + -
- - Les participants pourront consulter les résultats - - - Les choix possibles concerneront des dates - - - Le sondage sera protégé par un mot de passe - - - Vous recevrez un mail à chaque nouvelle participation - - - Vous recevrez un mail à chaque nouveau commentaire - - - La réponse « peut-être » sera disponible - -
+ +
+ + +
+ {{ urlPrefix }} + + {{ form.controls.slug.value }} + + + + + + +
+
+ Nombre de jours avant expiration + + +
+ + Les participants pourront consulter les résultats + + + Les choix possibles concerneront des dates + + + Le sondage sera protégé par un mot de passe + + + Vous recevrez un mail à chaque nouvelle participation + + + Vous recevrez un mail à chaque nouveau commentaire + + + La réponse « peut-être » sera disponible + + + diff --git a/src/app/features/administration/form/advanced-config/advanced-config.component.ts b/src/app/features/administration/form/advanced-config/advanced-config.component.ts index dcef8c78..cfc1b286 100644 --- a/src/app/features/administration/form/advanced-config/advanced-config.component.ts +++ b/src/app/features/administration/form/advanced-config/advanced-config.component.ts @@ -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({ selector: 'app-advanced-config', @@ -7,7 +9,10 @@ import { Component, OnInit } from '@angular/core'; }) export class AdvancedConfigComponent implements OnInit { public urlPrefix: string = window.location.origin + '/participation/'; - + @Input() + public poll?: Poll; + @Input() + public form: FormGroup; constructor() {} ngOnInit(): void {} diff --git a/src/app/features/administration/form/base-config/base-config.component.html b/src/app/features/administration/form/base-config/base-config.component.html index e815bc46..32b888c0 100644 --- a/src/app/features/administration/form/base-config/base-config.component.html +++ b/src/app/features/administration/form/base-config/base-config.component.html @@ -1,24 +1,41 @@
-
- - {{ 'creation.choose_title' | translate }} - - - - +

+ {{ 'creation.title' | translate }} +

-
+

+ {{ 'creation.want' | translate }} +

+ +
+
+

+ {{ 'creation.choose_title' | translate }} +

+
+ + + +
+