diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cf5f74c0..595db77c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,6 +60,6 @@ build: # artifacts: # paths: # - public -# expire_in: 30 days +# expire_in: 30 dateList # only: # - master diff --git a/mocks/old-stuff/config/PollConfig.ts b/mocks/old-stuff/config/PollConfig.ts index fd45ce06..9f2f6c90 100644 --- a/mocks/old-stuff/config/PollConfig.ts +++ b/mocks/old-stuff/config/PollConfig.ts @@ -63,7 +63,7 @@ export class PollConfig { owner_modifier_token = ''; // key to change a vote stack canModifyAnswers = true; // bool for the frontend selector whoCanChangeAnswers = 'everybody'; // everybody, self, nobody (= just admin) - dateList: any = otherDefaultDates; // sets of days as strings, config to set identical time for days in a special days poll + dateList: any = otherDefaultDates; // sets of dateList as strings, config to set identical time for dateList in a special dateList poll timeList: DateChoice[] = otherDefaultDates; // ranges of time expressed as strings answers: PollAnswer[] = defaultAnswers; diff --git a/mocks/old-stuff/mocks/mock-graph.ts b/mocks/old-stuff/mocks/mock-graph.ts index cb233121..74327ca8 100644 --- a/mocks/old-stuff/mocks/mock-graph.ts +++ b/mocks/old-stuff/mocks/mock-graph.ts @@ -8,7 +8,7 @@ export const mockGraphConfig = { visibility: 'link_only', // date specific poll allowSeveralHours: 'true', - dateLgfgfgfgist: ['jeudi', 'vendredi', 'samedi'], // sets of days as strings + dateLgfgfgfgist: ['jeudi', 'vendredi', 'samedi'], // sets of dateList as strings timeList: ['08:00', '08:30', '09:00'], // ranges of time expressed as strings answers: [ { diff --git a/mocks/old-stuff/pages/dates/dates.component.html b/mocks/old-stuff/pages/dates/dates.component.html index 3b7e5b79..76446371 100644 --- a/mocks/old-stuff/pages/dates/dates.component.html +++ b/mocks/old-stuff/pages/dates/dates.component.html @@ -95,20 +95,7 @@
-
- - - -
+

diff --git a/mocks/old-stuff/pages/dates/dates.component.ts b/mocks/old-stuff/pages/dates/dates.component.ts index ce9d8046..a7d4c226 100644 --- a/mocks/old-stuff/pages/dates/dates.component.ts +++ b/mocks/old-stuff/pages/dates/dates.component.ts @@ -30,7 +30,7 @@ export class DatesComponent extends BaseComponent implements OnInit { } countDays() { - // compute the number of days in the date interval + // compute the number of dateList in the date interval if (this.endDateInterval && this.startDateInterval) { this.intervalDays = this.dateUtilities.dayDiff(this.endDateInterval, this.startDateInterval).toFixed(0); } diff --git a/mocks/old-stuff/services/config.service.ts b/mocks/old-stuff/services/config.service.ts index 9a1268f2..83a59983 100644 --- a/mocks/old-stuff/services/config.service.ts +++ b/mocks/old-stuff/services/config.service.ts @@ -48,7 +48,7 @@ export class ConfigService extends PollConfig { } /** - * add some days to a date, to compute intervals + * add some dateList to a date, to compute intervals * @param days * @param date */ diff --git a/src/app/core/models/poll.model.ts b/src/app/core/models/poll.model.ts index dbd9bbbc..801d1353 100644 --- a/src/app/core/models/poll.model.ts +++ b/src/app/core/models/poll.model.ts @@ -68,7 +68,7 @@ export class Poll { public modification_policy = 'everybody'; public dateChoices: DateChoice[] = []; - // sets of days as strings, config to set identical time for days in a special days poll + // sets of dateList as strings, config to set identical time for dateList in a special dateList poll public timeSlices: TimeSlices[] = []; // ranges of time expressed as strings constructor(public owner: Owner = new Owner(), public title = 'mon titre', public custom_url: string = '') {} diff --git a/src/app/core/services/date.utilities.service.ts b/src/app/core/services/date.utilities.service.ts index e33e01f2..147afec8 100644 --- a/src/app/core/services/date.utilities.service.ts +++ b/src/app/core/services/date.utilities.service.ts @@ -1,11 +1,12 @@ import { Injectable } from '@angular/core'; +import { DateChoice } from '../../../../mocks/old-stuff/config/defaultConfigs'; @Injectable({ providedIn: 'root', }) export class DateUtilitiesService { /** - * add some days to a date, to compute intervals + * add some dateList to a date, to compute intervals * @param days * @param date */ @@ -27,7 +28,7 @@ export class DateUtilitiesService { const dates = []; while (+d1 < +d2) { dates.push({ - literal: this.formateDate(d1), + literal: this.formateDateToInputStringNg(d1), date_object: d1, }); d1.setDate(d1.getDate() + interval); @@ -36,7 +37,7 @@ export class DateUtilitiesService { } /** - * get the number of days between two dates + * get the number of dateList between two dates * @param d1 * @param d2 */ @@ -50,7 +51,7 @@ export class DateUtilitiesService { * YYYY-MM-DD * @param date */ - formateDate(date) { + formateDateToInputStringNg(date: Date): string { return [ date.getFullYear(), this.getDoubleDigits(date.getMonth() + 1), @@ -58,24 +59,69 @@ export class DateUtilitiesService { ].join('-'); } - parseInputDateToDateObject(inputDateString: string) { - const boom = inputDateString.split('-'); + /** + * transform a date object to a short date string + * @param inputDate + */ + parseInputDateToDateObject(inputDate: Date): Date { + const boom = inputDate.toISOString().substring(0, 10).split('-'); const converted = new Date(boom['0'], boom['1'] - 1, boom['2']); console.log('converted', converted); return converted; } + /** + * get double in string + * @param str + */ getDoubleDigits(str) { return ('00' + str).slice(-2); } + /** + * compute the number of dateList in the date interval + * @param startDateInterval + * @param endDateInterval + */ countDays(startDateInterval: Date, endDateInterval: Date): number { - // compute the number of days in the date interval - if (endDateInterval && startDateInterval) { return this.dayDiff(endDateInterval, startDateInterval); } return 0; } + + /** + * fill default dates for today + the next 3 dateList + */ + makeDefaultDateChoices(): DateChoice[] { + const today = new Date(); + const ladate = this.addDaysToDate(1, today); + const ladate2 = this.addDaysToDate(2, today); + const ladate3 = this.addDaysToDate(3, today); + const ladate4 = this.addDaysToDate(4, today); + + return [ + { + literal: this.formateDateToInputStringNg(ladate), + timeList: [], + date_object: ladate, + }, + { + literal: this.formateDateToInputStringNg(ladate2), + timeList: [], + date_object: ladate2, + }, + { + literal: this.formateDateToInputStringNg(ladate3), + timeList: [], + date_object: ladate3, + }, + { + literal: this.formateDateToInputStringNg(ladate4), + timeList: [], + date_object: ladate4, + }, + ]; + } } diff --git a/src/app/core/services/poll.service.ts b/src/app/core/services/poll.service.ts index a3a9b9b5..fe6f159a 100644 --- a/src/app/core/services/poll.service.ts +++ b/src/app/core/services/poll.service.ts @@ -212,6 +212,8 @@ export class PollService implements Resolve { newpoll.password = form.value.password; newpoll.kind = form.value.kind; newpoll.allow_comments = form.value.allowComments; + // merge choices from storage + newpoll.choices = this.storageService.choices; newpoll.dateChoices = this.storageService.dateList; newpoll.timeSlices = this.storageService.timeSlices; diff --git a/src/app/core/services/storage.service.ts b/src/app/core/services/storage.service.ts index 2fae53b3..e78912cb 100644 --- a/src/app/core/services/storage.service.ts +++ b/src/app/core/services/storage.service.ts @@ -16,6 +16,7 @@ import { } from '../../../../mocks/old-stuff/config/defaultConfigs'; import { Poll } from '../models/poll.model'; import { Owner } from '../models/owner.model'; +import { DateUtilitiesService } from './date.utilities.service'; @Injectable({ providedIn: 'root', @@ -31,7 +32,7 @@ export class StorageService { public userPolls: Poll[] = []; @LocalStorage() - public dateList: DateChoice[] = otherDefaultDates; + public dateList: DateChoice[] = []; @LocalStorage() public timeSlices: TimeSlices[]; @@ -39,15 +40,19 @@ export class StorageService { @LocalStorage() public vote_stack: Stack = new Stack(); - constructor() { + @LocalStorage() + public choices: Choice[]; + + constructor(public dateUtilities: DateUtilitiesService) { if (environment.autofill) { this.userPolls.push(new Poll(new Owner(), 'Démo: Anniversaire de tonton Patrick', 'aujourdhui-ou-demain')); this.userPolls.push(new Poll(new Owner(), 'Démo: Atelier cuisine du quartier', 'aujourdhui-ou-demain')); this.userPolls.push( new Poll(new Owner(), 'Démo: Réunion du département des chatons', 'aujourdhui-ou-demain') ); - // this.timeSlices = basicSlicesOfDay; } + + this.dateList = this.dateUtilities.makeDefaultDateChoices(); } setChoicesForVoteStack(choices_list: Choice[]) { diff --git a/src/app/features/administration/administration.module.ts b/src/app/features/administration/administration.module.ts index 307c91ea..91783080 100644 --- a/src/app/features/administration/administration.module.ts +++ b/src/app/features/administration/administration.module.ts @@ -19,6 +19,10 @@ import { AdvancedConfigComponent } from './form/advanced-config/advanced-config. import { CalendarModule } from 'primeng'; import { DragDropModule } from '@angular/cdk/drag-drop'; import { AppModule } from '../../app.module'; +import { IntervalComponent } from './form/date/interval/interval.component'; +import { DayListComponent } from './form/date/list/day/day-list.component'; +import { PickerComponent } from './form/date/picker/picker.component'; +import { TimeListComponent } from './form/date/list/time/time-list.component'; @NgModule({ declarations: [ @@ -32,6 +36,10 @@ import { AppModule } from '../../app.module'; KindSelectComponent, BaseConfigComponent, AdvancedConfigComponent, + IntervalComponent, + DayListComponent, + PickerComponent, + TimeListComponent, ], imports: [ CalendarModule, 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 index 5492843c..c72c772b 100644 --- a/src/app/features/administration/form/date-select/date-select.component.html +++ b/src/app/features/administration/form/date-select/date-select.component.html @@ -6,65 +6,29 @@ {{ 'dates.add' | translate }} - -
-

{{ 'dates.add_interval' | translate }}

-
-
- {{ 'dates.interval_propose' | translate }} -
-
- - -
-
-
-
- {{ 'dates.interval_span' | translate }} -
-
- - -
-
- -
+
- -
- - Chaque jour aura ses plages de temps personnalisées - - - Tous les jours auront les mêmes plages de temps - -
-
+ +
+ +
+ + Chaque jour aura ses plages de temps personnalisées + + + Tous les jours auront les mêmes plages de temps + +
@@ -102,56 +66,29 @@
-
- -
-

- - {{ 'dates.count_time' | translate }} - (identique pour chaque jour) - -

-
- - {{ timeList.length }} - - - -
-
-
-
-
-
- - - -
-
+
+
+

+ + {{ 'dates.count_time' | translate }} + (identique pour chaque jour) + +

+
+ + {{ timeList.length }} + + +
-
+
- +
@@ -172,80 +109,7 @@
-
-
- -

Dates

-
- - - -
- plage horaire distincte -
-
- - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ 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 index f5d64e66..472a56c1 100644 --- a/src/app/features/administration/form/date-select/date-select.component.ts +++ b/src/app/features/administration/form/date-select/date-select.component.ts @@ -24,18 +24,17 @@ import { StorageService } from '../../../../core/services/storage.service'; }) export class DateSelectComponent implements OnInit { @Input() - public form: FormGroup; + form: FormGroup; - public showDateInterval = false; - public allowSeveralHours = false; + displaySeveralHoursChoice = false; + allowSeveralHours = false; today = new Date(); - startDateInterval: string; endDateInterval: string; - intervalDays: any; + intervalDaysDefault = 7; - dateList: DateChoice[]; // sets of days as strings, config to set identical time for days in a special days poll + dateList: DateChoice[]; // sets of dateList as strings, config to set identical time for dateList in a special dateList poll timeList: TimeSlices[]; // ranges of time expressed as strings - dateCalendarEnum: Date[] = [new Date('02/09/2021')]; + selectionKind = 'range'; constructor( @@ -44,7 +43,6 @@ export class DateSelectComponent implements OnInit { private uuidService: UuidService, private toastService: ToastService, private pollService: PollService, - public dateUtilities: DateUtilitiesService, private apiService: ApiService, private storageService: StorageService, private router: Router, @@ -63,72 +61,7 @@ export class DateSelectComponent implements OnInit { return this.form.get('dateChoices') as FormArray; } - ngOnInit(): void { - // this.setDefaultDatesForInterval(); - } - - /** - * 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.dateCalendarEnum = [dateCurrent, this.dateUtilities.addDaysToDate(this.intervalDaysDefault, dateCurrent)]; - 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]), - // url: ['', [Validators.required]], - // }); - // - // this.choices.push(newControlGroup); - // }) - - this.toastService.display(`les dates ont été ajoutées aux réponses possibles.`); - } + ngOnInit(): void {} /** * change time spans @@ -141,49 +74,43 @@ export class DateSelectComponent implements OnInit { removeAllTimes() { this.timeList = []; + this.dateList.map((elem) => (elem.timeList = [])); + this.toastService.display('périodes horaires vidées'); } resetTimes() { this.timeList = defaultTimeOfDay; + this.dateList.map((elem) => (elem.timeList = Object.create(defaultTimeOfDay))); this.toastService.display('périodes horaires réinitialisées'); } - /** - * 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: '', - }); - 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', + if (this.form.value.kind == 'date') { + this.storageService.dateList.push({ + literal: '', + timeList: [], + date_object: new Date(), + }); + } else { + const newControlGroup = this.fb.group({ + label: this.fb.control('', [Validators.required]), + imageUrl: ['', [Validators.required]], }); - } - this.dateChoices.push(newControlGroup); - // this.cd.detectChanges(); - console.log('this.choices.length', this.choices.length); - this.focusOnChoice(this.choices.length - 1); + if (optionalLabel) { + newControlGroup.patchValue({ + label: optionalLabel, + imageUrl: 'mon url', + }); + } + + this.dateChoices.push(newControlGroup); + } + // this.cd.detectChanges(); + console.log('this.choices.length', this.storageService.dateList.length); + + this.focusOnChoice(this.storageService.dateList.length - 1); } focusOnChoice(index): void { @@ -204,82 +131,9 @@ export class DateSelectComponent implements OnInit { 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'); } - - dropTimeItem(event: any): void { - // moveItemInArray(this.timeSlices, event.previousIndex, event.currentIndex); - if (event.previousContainer === event.container) { - moveItemInArray(event.container.data, event.previousIndex, event.currentIndex); - } else { - transferArrayItem( - event.previousContainer.data, - event.container.data, - event.previousIndex, - event.currentIndex - ); - } - } - - dropDayItem(event: any): void { - // moveItemInArray(this.timeSlices, event.previousIndex, event.currentIndex); - if (event.previousContainer === event.container) { - moveItemInArray(event.container.data, event.previousIndex, event.currentIndex); - } else { - transferArrayItem( - event.previousContainer.data, - event.container.data, - event.previousIndex, - event.currentIndex - ); - } - } } diff --git a/src/app/features/administration/form/date/interval/interval.component.html b/src/app/features/administration/form/date/interval/interval.component.html new file mode 100644 index 00000000..53120ce1 --- /dev/null +++ b/src/app/features/administration/form/date/interval/interval.component.html @@ -0,0 +1,43 @@ +
+ +
+
+
+ {{ 'dates.interval_propose' | translate }} +
+
+ + +
+
+
+
+ {{ 'dates.interval_span' | translate }} +
+
+ + +
+ {{ form.value.endDateInterval }} +
+
+
+
soit {{ intervalDays }} jours.
+ +
+
diff --git a/src/app/features/administration/form/date/interval/interval.component.scss b/src/app/features/administration/form/date/interval/interval.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/administration/form/date/interval/interval.component.spec.ts b/src/app/features/administration/form/date/interval/interval.component.spec.ts new file mode 100644 index 00000000..1b57f781 --- /dev/null +++ b/src/app/features/administration/form/date/interval/interval.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { IntervalComponent } from './interval.component'; + +describe('IntervalComponent', () => { + let component: IntervalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [IntervalComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(IntervalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/administration/form/date/interval/interval.component.ts b/src/app/features/administration/form/date/interval/interval.component.ts new file mode 100644 index 00000000..2283fccb --- /dev/null +++ b/src/app/features/administration/form/date/interval/interval.component.ts @@ -0,0 +1,93 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { environment } from '../../../../../../environments/environment'; +import { DateUtilitiesService } from '../../../../../core/services/date.utilities.service'; +import { FormArray, FormGroup } from '@angular/forms'; +import { ToastService } from '../../../../../core/services/toast.service'; +import { DateChoice } from '../../../../../../../mocks/old-stuff/config/defaultConfigs'; + +@Component({ + selector: 'app-date-interval', + templateUrl: './interval.component.html', + styleUrls: ['./interval.component.scss'], +}) +export class IntervalComponent implements OnInit { + @Input() + public form: FormGroup; + showDateInterval = true; + intervalDays: any; + intervalDaysDefault = environment.interval_days_default; + startDateInterval: Date; + startDateIntervalString: string; + endDateInterval: Date; + endDateIntervalString: string; + dateList: DateChoice[]; // sets of dateList as strings, config to set identical time for dateList in a special dateList poll + dateCalendarEnum: Date[] = [new Date('02/09/2021')]; + + constructor(public dateUtilities: DateUtilitiesService, private toastService: ToastService) {} + + ngOnInit(): void { + this.setDefaultDatesForInterval(); + } + + 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.toastService.display(`les dates ont été ajoutées aux réponses possibles.`); + } + + get dateChoices() { + return this.form.get('dateChoices') as FormArray; + } + + /** + * default interval of dates proposed is from today to 7 dateList more + */ + setDefaultDatesForInterval(): void { + if (this.form) { + const dateCurrent = new Date(); + // const dateJson = dateCurrent.toISOString(); + this.startDateInterval = dateCurrent; + this.endDateInterval = this.dateUtilities.addDaysToDate(this.intervalDaysDefault, dateCurrent); + + this.form.patchValue({ + startDateInterval: this.startDateInterval, + endDateInterval: this.endDateInterval, + }); + this.dateCalendarEnum = [ + dateCurrent, + this.dateUtilities.addDaysToDate(this.intervalDaysDefault, dateCurrent), + ]; + this.countDays(); + } + } +} diff --git a/src/app/features/administration/form/date/list/day/day-list.component.html b/src/app/features/administration/form/date/list/day/day-list.component.html new file mode 100644 index 00000000..b887b1b5 --- /dev/null +++ b/src/app/features/administration/form/date/list/day/day-list.component.html @@ -0,0 +1,36 @@ +
+
+ +

Dates

+
+ + + +
+ plage horaire distincte +
+
+ + +
+
+
+
+
diff --git a/src/app/features/administration/form/date/list/day/day-list.component.scss b/src/app/features/administration/form/date/list/day/day-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/administration/form/date/list/day/day-list.component.spec.ts b/src/app/features/administration/form/date/list/day/day-list.component.spec.ts new file mode 100644 index 00000000..c5687129 --- /dev/null +++ b/src/app/features/administration/form/date/list/day/day-list.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DayListComponent } from './day-list.component'; + +describe('ListComponent', () => { + let component: DayListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [DayListComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DayListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/administration/form/date/list/day/day-list.component.ts b/src/app/features/administration/form/date/list/day/day-list.component.ts new file mode 100644 index 00000000..6dbf3ca3 --- /dev/null +++ b/src/app/features/administration/form/date/list/day/day-list.component.ts @@ -0,0 +1,110 @@ +import { Component, Inject, Input, OnInit } from '@angular/core'; +import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop'; +import { DateChoice } from '../../../../../../../../mocks/old-stuff/config/defaultConfigs'; +import { DOCUMENT } from '@angular/common'; + +@Component({ + selector: 'app-day-list', + templateUrl: './day-list.component.html', + styleUrls: ['./day-list.component.scss'], +}) +export class DayListComponent implements OnInit { + @Input() + public dateList: DateChoice[] = []; + @Input() + public hasSeveralHours: boolean; + timeList: any; + + constructor(@Inject(DOCUMENT) private document: any) {} + + ngOnInit(): void {} + + dropTimeItem(event: any): void { + // moveItemInArray(this.timeSlices, event.previousIndex, event.currentIndex); + if (event.previousContainer === event.container) { + moveItemInArray(event.container.data, event.previousIndex, event.currentIndex); + } else { + transferArrayItem( + event.previousContainer.data, + event.container.data, + event.previousIndex, + event.currentIndex + ); + } + } + + dropDayItem(event: any): void { + // moveItemInArray(this.timeSlices, event.previousIndex, event.currentIndex); + if (event.previousContainer === event.container) { + moveItemInArray(event.container.data, event.previousIndex, event.currentIndex); + } else { + transferArrayItem( + event.previousContainer.data, + event.container.data, + event.previousIndex, + event.currentIndex + ); + } + } + /** + * 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: '', + }); + 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(); + } + } + /** + * 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(); + } + } + } +} diff --git a/src/app/features/administration/form/date/list/time/time-list.component.html b/src/app/features/administration/form/date/list/time/time-list.component.html new file mode 100644 index 00000000..63911963 --- /dev/null +++ b/src/app/features/administration/form/date/list/time/time-list.component.html @@ -0,0 +1,10 @@ +

time-list works!

+
+ + + +
diff --git a/src/app/features/administration/form/date/list/time/time-list.component.scss b/src/app/features/administration/form/date/list/time/time-list.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/administration/form/date/list/time/time-list.component.spec.ts b/src/app/features/administration/form/date/list/time/time-list.component.spec.ts new file mode 100644 index 00000000..a408cd08 --- /dev/null +++ b/src/app/features/administration/form/date/list/time/time-list.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TimeListComponent } from './time-list.component'; + +describe('TimeListComponent', () => { + let component: TimeListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [TimeListComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TimeListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/administration/form/date/list/time/time-list.component.ts b/src/app/features/administration/form/date/list/time/time-list.component.ts new file mode 100644 index 00000000..e2b2cd2e --- /dev/null +++ b/src/app/features/administration/form/date/list/time/time-list.component.ts @@ -0,0 +1,16 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { TimeSlices } from '../../../../../../../../mocks/old-stuff/config/defaultConfigs'; + +@Component({ + selector: 'app-time-list', + templateUrl: './time-list.component.html', + styleUrls: ['./time-list.component.scss'], +}) +export class TimeListComponent implements OnInit { + @Input() + public timeSlices: TimeSlices[]; + timeList: any; + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/app/features/administration/form/date/picker/picker.component.html b/src/app/features/administration/form/date/picker/picker.component.html new file mode 100644 index 00000000..22fd7d20 --- /dev/null +++ b/src/app/features/administration/form/date/picker/picker.component.html @@ -0,0 +1,28 @@ + +
+
+ + + + + +
+
+ +
+
+
diff --git a/src/app/features/administration/form/date/picker/picker.component.scss b/src/app/features/administration/form/date/picker/picker.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/features/administration/form/date/picker/picker.component.spec.ts b/src/app/features/administration/form/date/picker/picker.component.spec.ts new file mode 100644 index 00000000..93fa28c9 --- /dev/null +++ b/src/app/features/administration/form/date/picker/picker.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PickerComponent } from './picker.component'; + +describe('PickerComponent', () => { + let component: PickerComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [PickerComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PickerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/administration/form/date/picker/picker.component.ts b/src/app/features/administration/form/date/picker/picker.component.ts new file mode 100644 index 00000000..6ea5b731 --- /dev/null +++ b/src/app/features/administration/form/date/picker/picker.component.ts @@ -0,0 +1,21 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { FormGroup } from '@angular/forms'; + +@Component({ + selector: 'app-picker', + templateUrl: './picker.component.html', + styleUrls: ['./picker.component.scss'], +}) +export class PickerComponent implements OnInit { + @Input() + public form: FormGroup; + selectionKind = 'multiple'; + dateCalendarEnum: any[]; + today: Date = new Date(); + + constructor() {} + + ngOnInit(): void {} + + setDefaultDatesForInterval() {} +} diff --git a/src/app/features/administration/form/form.component.html b/src/app/features/administration/form/form.component.html index df01c80a..e99b848f 100644 --- a/src/app/features/administration/form/form.component.html +++ b/src/app/features/administration/form/form.component.html @@ -1,7 +1,6 @@
-

@@ -40,27 +39,28 @@ *ngIf="advancedDisplayEnabled" > -
-
- - -
-
+ + + + + + + + + + + + + + + + + +

- + +

{{ 'choices.helper' | translate }} @@ -108,6 +108,4 @@

- - diff --git a/src/app/features/administration/form/form.component.ts b/src/app/features/administration/form/form.component.ts index f3ff8b77..7434602f 100644 --- a/src/app/features/administration/form/form.component.ts +++ b/src/app/features/administration/form/form.component.ts @@ -9,7 +9,6 @@ import { Router } from '@angular/router'; import { environment } from '../../../../environments/environment'; import { PollUtilitiesService } from '../../../core/services/poll.utilities.service'; import { StorageService } from '../../../core/services/storage.service'; -import { defaultDates, defaultTimeOfDay } from '../../../../../mocks/old-stuff/config/defaultConfigs'; @Component({ selector: 'app-admin-form', @@ -21,7 +20,8 @@ export class FormComponent implements OnInit { public poll?: Poll; public form: FormGroup; - public advancedDisplayEnabled = true; + public displayDatePicker = false; + public advancedDisplayEnabled = false; public show_debug_data = false; public currentStep = 'base'; public steps = ['base', 'choices', 'advanced']; diff --git a/src/app/shared/components/selectors/language-selector/language-selector.component.ts b/src/app/shared/components/selectors/language-selector/language-selector.component.ts index c6809d9b..fcddb40b 100644 --- a/src/app/shared/components/selectors/language-selector/language-selector.component.ts +++ b/src/app/shared/components/selectors/language-selector/language-selector.component.ts @@ -17,7 +17,6 @@ export class LanguageSelectorComponent implements OnInit { ngOnInit(): void { this.availableLanguages = this.languageService.getAvailableLanguages(); - console.log('this.availableLanguages', this.availableLanguages); this.currentLang = this.languageService.getLangage(); this.nextLang(); @@ -29,10 +28,6 @@ export class LanguageSelectorComponent implements OnInit { nextLang(): void { console.log('this.currentLang ', this.currentLang); - console.log('this.storageService.language ', this.storageService.language); - console.log("this.availableLanguages['FR']", this.availableLanguages['FR']); - - console.log('this.availableLanguages', this.availableLanguages); console.log('TODO'); } } diff --git a/src/assets/i18n/po/br.po b/src/assets/i18n/po/br.po index 17b6d231..f15f44df 100755 --- a/src/assets/i18n/po/br.po +++ b/src/assets/i18n/po/br.po @@ -82,7 +82,7 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days #: +it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" "eo diazezet Framadate. Ur meziant diorroet gant Skol-Veur Straßburg an hini " @@ -916,7 +916,7 @@ msgid "Your name" msgstr "Hoc'h anv" #: .Generic.days -msgid "days" +msgid "dateList" msgstr "a zevezhioù" #: .Generic.for @@ -1632,7 +1632,7 @@ msgid "Remove a time slot" msgstr "Dileml an eur diwezhañ" #: .Step+2+date.Remove+all+days -msgid "Remove all days" +msgid "Remove all dateList" msgstr "Dilemel an holl zevezhioù" #: .Step+2+date.Remove+all+times @@ -1647,13 +1647,13 @@ msgstr "Dilemel an devezh-mañ" #: +two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" "Evit krouiñ ur sontadeg deiziadoù eo ret deoc'h kinnig daou zibab d'an " "nebeutañ (div eur evit an hevelep devezh pe daou zevezh)." #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" msgstr "" "Gallout a rit ouzhpennañ pe dilemel devezhioù hag eurioù ouzhpenn gant an " "afelloù" @@ -1711,7 +1711,7 @@ msgid "Your poll will automatically be archived" msgstr "Diellaouet e vo ho sontadeg ent emgefreek" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." msgstr "Diellaouet e vo ho sontadeg a-benn %d a zevezhioù ent emgefreek." #: .Step+3.after+the+last+date+of+your+poll. diff --git a/src/assets/i18n/po/ca.po b/src/assets/i18n/po/ca.po index bf9318bb..4ce33e77 100644 --- a/src/assets/i18n/po/ca.po +++ b/src/assets/i18n/po/ca.po @@ -84,7 +84,7 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days #: +it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" "programari desenvolupat per la Universitat d'Estrasburg. Actualment " @@ -933,7 +933,7 @@ msgid "Your name" msgstr "El vostre nom" #: .Generic.days -msgid "days" +msgid "dateList" msgstr "dies" #: .Generic.for @@ -1650,7 +1650,7 @@ msgid "Remove a time slot" msgstr "Elimina un espai horari" #: .Step+2+date.Remove+all+days -msgid "Remove all days" +msgid "Remove all dateList" msgstr "Elimina tots els dies" #: .Step+2+date.Remove+all+times @@ -1665,13 +1665,13 @@ msgstr "Elimina aquest dia" #: +two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" "Per a programar un esdeveniment, cal que proporcioneu almenys dues opcions (" "per exemple, dos espais horaris en un o dos dies)." #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" msgstr "Podeu afegir o treure dies i hores addicionals amb els botons" #: .Step+3.Back+to+step+2 @@ -1727,7 +1727,7 @@ msgid "Your poll will automatically be archived" msgstr "L'enquesta s'arxivarà automàticament" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." msgstr "L'enquesta s'arxivarà automàticament d'aquí a %d dies." #: .Step+3.after+the+last+date+of+your+poll. diff --git a/src/assets/i18n/po/de.po b/src/assets/i18n/po/de.po index c58da819..84222bf1 100644 --- a/src/assets/i18n/po/de.po +++ b/src/assets/i18n/po/de.po @@ -85,7 +85,7 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days #: +it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" ", einer von der Universität von Straßburg entwickelten Software. Heute wird " @@ -942,7 +942,7 @@ msgid "Your name" msgstr "Ihr Name" #: .Generic.days -msgid "days" +msgid "dateList" msgstr "Tage" #: .Generic.for @@ -1662,7 +1662,7 @@ msgid "Remove a time slot" msgstr "Eine Uhrzeit entfernen" #: .Step+2+date.Remove+all+days -msgid "Remove all days" +msgid "Remove all dateList" msgstr "Alle Tage entfernen" #: .Step+2+date.Remove+all+times @@ -1677,14 +1677,14 @@ msgstr "Diesen Tag entfernen" #: +two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" "Um eine Terminabsprache zu konfigurieren, müssen Sie mindestens zwei " "alternative Zeitpunkte vorschlagen (zwei Uhrzeiten am gleichen Tag oder " "verschiedene Tage)." #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" msgstr "" "Sie können weitere Tage und Uhrzeiten über die Buttons hinzufügen oder " "entfernen" @@ -1742,7 +1742,7 @@ msgid "Your poll will automatically be archived" msgstr "Ihre Umfrage wird automatisch archiviert" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." msgstr "Ihre Umfrage wird automatisch in %d Tagen archiviert werden." #: .Step+3.after+the+last+date+of+your+poll. diff --git a/src/assets/i18n/po/el.po b/src/assets/i18n/po/el.po index baede0eb..696f3651 100644 --- a/src/assets/i18n/po/el.po +++ b/src/assets/i18n/po/el.po @@ -83,7 +83,7 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days,+it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" "λογισμικό αναπτυγμένο από το Πανεπιστήμιο του Στρασβούργου. Σήμερα, " @@ -926,7 +926,7 @@ msgid "Your name" msgstr "Το όνομά σας" #: .Generic.days -msgid "days" +msgid "dateList" msgstr "ημέρες" #: .Generic.for @@ -1640,7 +1640,7 @@ msgid "Remove a time slot" msgstr "Αφαίρεση ενός πεδίου ώρας" #: .Step+2+date.Remove+all+days -msgid "Remove all days" +msgid "Remove all dateList" msgstr "Αφαίρεση όλων των ημερών" #: .Step+2+date.Remove+all+times @@ -1654,13 +1654,13 @@ msgstr "Αφαίρεση αυτής της ημέρας" #: .Step+2+date.To+schedule+an+event+you+need+to+provide+at+least+two+choices+(e.g.,+two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" "Για τον προγραμματισμό μιας δραστηριότητας πρέπει να παρέχετε τουλάχιστον " "δύο επιλογές (π.χ, δύο πεδία ώρας σε μία ημέρα, ή δύο ημέρες)." #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" msgstr "Μπορείτε να προσθέσετε ή να αφαιρέσετε ημέρες και ώρες με τα κουμπιά" #: .Step+3.Back+to+step+2 @@ -1714,7 +1714,7 @@ msgid "Your poll will automatically be archived" msgstr "Η ψηφοφορία σας θα αρχειοθετηθεί αυτόματα" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." msgstr "Η ψηφοφορία σας θα αρχειοθετηθεί αυτόματα σε %d ημέρες." #: .Step+3.after+the+last+date+of+your+poll. diff --git a/src/assets/i18n/po/en.po b/src/assets/i18n/po/en.po index c4a61dea..e1d45255 100755 --- a/src/assets/i18n/po/en.po +++ b/src/assets/i18n/po/en.po @@ -84,10 +84,10 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days #: +it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." #: .3rd+section.Grow+your+own @@ -931,8 +931,8 @@ msgid "Your name" msgstr "Your name" #: .Generic.days -msgid "days" -msgstr "days" +msgid "dateList" +msgstr "dateList" #: .Generic.for msgid "for" @@ -1635,8 +1635,8 @@ msgid "Remove a time slot" msgstr "Remove a time slot" #: .Step+2+date.Remove+all+days -msgid "Remove all days" -msgstr "Remove all days" +msgid "Remove all dateList" +msgstr "Remove all dateList" #: .Step+2+date.Remove+all+times msgid "Remove all times" @@ -1650,14 +1650,14 @@ msgstr "Remove this day" #: +two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" -msgstr "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" +msgstr "You can add or remove additional dateList and times with the buttons" #: .Step+3.Back+to+step+2 msgid "Back to step 2" @@ -1712,8 +1712,8 @@ msgid "Your poll will automatically be archived" msgstr "Your poll will automatically be archived" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." -msgstr "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." +msgstr "Your poll will be automatically archived in %d dateList." #: .Step+3.after+the+last+date+of+your+poll. msgid "after the last date of your poll." diff --git a/src/assets/i18n/po/es.po b/src/assets/i18n/po/es.po index b4e15118..0660b6b3 100644 --- a/src/assets/i18n/po/es.po +++ b/src/assets/i18n/po/es.po @@ -88,7 +88,7 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days #: +it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" "un software desarrollado por la Universidad de Estrasburgo. Ahora, su " @@ -945,7 +945,7 @@ msgid "Your name" msgstr "Su nombre" #: .Generic.days -msgid "days" +msgid "dateList" msgstr "días" #: .Generic.for @@ -1664,7 +1664,7 @@ msgid "Remove a time slot" msgstr "Eliminar una franja horaria" #: .Step+2+date.Remove+all+days -msgid "Remove all days" +msgid "Remove all dateList" msgstr "Borrar todos los días" #: .Step+2+date.Remove+all+times @@ -1679,13 +1679,13 @@ msgstr "Eliminar este dia" #: +two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" "Para programar un evento, tiene que proponer por lo menos dos opciones (dos " "horarios para un día, o dos días)." #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" msgstr "Puede agregar o borrar días y horarios con los botones" #: .Step+3.Back+to+step+2 @@ -1741,7 +1741,7 @@ msgid "Your poll will automatically be archived" msgstr "Su encuesta estará archivada de manera automática" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." msgstr "Su encuesta estará archivada de manera automática en %d días." #: .Step+3.after+the+last+date+of+your+poll. diff --git a/src/assets/i18n/po/fr.po b/src/assets/i18n/po/fr.po index 1f012675..8978a00c 100644 --- a/src/assets/i18n/po/fr.po +++ b/src/assets/i18n/po/fr.po @@ -87,7 +87,7 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days #: +it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" "un logiciel développé par l'Université de Strasbourg. Aujourd'hui, son " @@ -949,7 +949,7 @@ msgid "Your name" msgstr "Votre nom" #: .Generic.days -msgid "days" +msgid "dateList" msgstr "jours" #: .Generic.for @@ -1675,7 +1675,7 @@ msgid "Remove a time slot" msgstr "Supprimer le dernier horaire" #: .Step+2+date.Remove+all+days -msgid "Remove all days" +msgid "Remove all dateList" msgstr "Effacer tous les jours" #: .Step+2+date.Remove+all+times @@ -1690,13 +1690,13 @@ msgstr "Supprimer ce jour" #: +two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" "Pour créer un sondage spécial dates vous devez proposer au moins deux choix " "(deux horaires pour une même journée ou deux jours)." #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" msgstr "" "Vous pouvez ajouter ou supprimer des jours et horaires supplémentaires avec " "les boutons" @@ -1754,7 +1754,7 @@ msgid "Your poll will automatically be archived" msgstr "Votre sondage sera automatiquement archivé" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." msgstr "Votre sondage sera automatiquement archivé dans %d jours." #: .Step+3.after+the+last+date+of+your+poll. diff --git a/src/assets/i18n/po/framadate.pot b/src/assets/i18n/po/framadate.pot index 681e19e4..99615d6a 100644 --- a/src/assets/i18n/po/framadate.pot +++ b/src/assets/i18n/po/framadate.pot @@ -75,7 +75,7 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days,+it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" @@ -861,7 +861,7 @@ msgid "Your name" msgstr "" #: .Generic.days -msgid "days" +msgid "dateList" msgstr "" #: .Generic.for @@ -1538,7 +1538,7 @@ msgid "Remove a time slot" msgstr "" #: .Step+2+date.Remove+all+days -msgid "Remove all days" +msgid "Remove all dateList" msgstr "" #: .Step+2+date.Remove+all+times @@ -1552,11 +1552,11 @@ msgstr "" #: .Step+2+date.To+schedule+an+event+you+need+to+provide+at+least+two+choices+(e.g.,+two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" msgstr "" #: .Step+3.Back+to+step+2 @@ -1605,7 +1605,7 @@ msgid "Your poll will automatically be archived" msgstr "" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." msgstr "" #: .Step+3.after+the+last+date+of+your+poll. diff --git a/src/assets/i18n/po/gl.po b/src/assets/i18n/po/gl.po index 43623f03..a4d0e240 100644 --- a/src/assets/i18n/po/gl.po +++ b/src/assets/i18n/po/gl.po @@ -81,7 +81,7 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days,+it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" "un software desenvolvido pola Universidade de Estrasburgo. Agora, o seu " @@ -918,7 +918,7 @@ msgid "Your name" msgstr "Seu nome" #: .Generic.days -msgid "days" +msgid "dateList" msgstr "días" #: .Generic.for @@ -1618,7 +1618,7 @@ msgid "Remove a time slot" msgstr "Borrar unha hora" #: .Step+2+date.Remove+all+days -msgid "Remove all days" +msgid "Remove all dateList" msgstr "Borrar todos os días" #: .Step+2+date.Remove+all+times @@ -1632,13 +1632,13 @@ msgstr "Borrar este día" #: .Step+2+date.To+schedule+an+event+you+need+to+provide+at+least+two+choices+(e.g.,+two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" "Para programar unha enquisa, precisa fornecer polo menos dúas opcións (por " "exemplo, dúas horas nun día ou dous días)." #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" msgstr "Cos botóns pode engadir ou borrar días e horas adicionais" #: .Step+3.Back+to+step+2 @@ -1692,7 +1692,7 @@ msgid "Your poll will automatically be archived" msgstr "A súa enquisa será arquivada de xeito automático" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." msgstr "A súa enquisa será arquivada de xeito automático en %d días." #: .Step+3.after+the+last+date+of+your+poll. diff --git a/src/assets/i18n/po/hu.po b/src/assets/i18n/po/hu.po index c1723630..9150178b 100644 --- a/src/assets/i18n/po/hu.po +++ b/src/assets/i18n/po/hu.po @@ -83,7 +83,7 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days #: +it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" "szoftveren alapul, melyet a Strasbourg-i Egyetem fejlesztett. Manapság a " @@ -926,7 +926,7 @@ msgid "Your name" msgstr "Neve" #: .Generic.days -msgid "days" +msgid "dateList" msgstr "nap" #: .Generic.for @@ -1636,7 +1636,7 @@ msgid "Remove a time slot" msgstr "Idősáv eltávolítása" #: .Step+2+date.Remove+all+days -msgid "Remove all days" +msgid "Remove all dateList" msgstr "Összes nap eltávolítása" #: .Step+2+date.Remove+all+times @@ -1651,13 +1651,13 @@ msgstr "Nap eltávolítása" #: +two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" "Egy esemény ütemezéséhez legalább két lehetőséget kell megadni (azaz két " "idősávot egy nap, vagy két napot)." #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" msgstr "A gombokkal további napokat és idősávokat adhat hozzá" #: .Step+3.Back+to+step+2 @@ -1713,7 +1713,7 @@ msgid "Your poll will automatically be archived" msgstr "A szavazása automatikusan archiválva lesz" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." msgstr "A szavazása %d nap után automatikusan archiválva lesz." #: .Step+3.after+the+last+date+of+your+poll. diff --git a/src/assets/i18n/po/it.po b/src/assets/i18n/po/it.po index 79877da9..4e73b1f3 100644 --- a/src/assets/i18n/po/it.po +++ b/src/assets/i18n/po/it.po @@ -87,7 +87,7 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days #: +it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" "un software sviluppato dall'Università di Strasburgo. Oggi il suo sviluppo è " @@ -941,7 +941,7 @@ msgid "Your name" msgstr "Il tuo nome" #: .Generic.days -msgid "days" +msgid "dateList" msgstr "giorni" #: .Generic.for @@ -1653,7 +1653,7 @@ msgid "Remove a time slot" msgstr "Eliminare l'ultimo orario" #: .Step+2+date.Remove+all+days -msgid "Remove all days" +msgid "Remove all dateList" msgstr "Cancellare tutti i giorni" #: .Step+2+date.Remove+all+times @@ -1668,13 +1668,13 @@ msgstr "Eliminare questo giorno" #: +two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" "Per creare un evento, è meglio proporre almeno 2 scelte (2 orari per lo " "stesso giorno o 2 giorni)." #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" msgstr "" "Puoi aggiungere o eliminare dei giorni et orari ulteriori con i pulsanti" @@ -1731,7 +1731,7 @@ msgid "Your poll will automatically be archived" msgstr "Il tuo sondaggio sarà archiviato automaticamente" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." msgstr "Il tuo sondaggio verrà archiviata automaticamente in %d giorni." #: .Step+3.after+the+last+date+of+your+poll. diff --git a/src/assets/i18n/po/nl.po b/src/assets/i18n/po/nl.po index c2864d78..60ff4814 100755 --- a/src/assets/i18n/po/nl.po +++ b/src/assets/i18n/po/nl.po @@ -82,7 +82,7 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days #: +it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" "software ontwikkeld door de Universiteit van Straatsburg. Het wordt " @@ -922,7 +922,7 @@ msgid "Your name" msgstr "Je naam" #: .Generic.days -msgid "days" +msgid "dateList" msgstr "dagen" #: .Generic.for @@ -1628,7 +1628,7 @@ msgid "Remove a time slot" msgstr "Verwijder een tijd" #: .Step+2+date.Remove+all+days -msgid "Remove all days" +msgid "Remove all dateList" msgstr "Verwijder alle dagen" #: .Step+2+date.Remove+all+times @@ -1643,13 +1643,13 @@ msgstr "Verwijder deze dag" #: +two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" "Om een datum te prikken, moet je tenminste twee keuzes geven. (Bijvoorbeeld " "twee tijden op één dag of twee verschillende dagen)." #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" msgstr "Je kan extra dagen of tijden toevoegen en verwijderen met deze knoppen" #: .Step+3.Back+to+step+2 @@ -1704,7 +1704,7 @@ msgid "Your poll will automatically be archived" msgstr "Je poll wordt automatisch gearchiveerd" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." msgstr "Je poll wordt over %d dagen automatisch gearchiveerd." #: .Step+3.after+the+last+date+of+your+poll. diff --git a/src/assets/i18n/po/oc.po b/src/assets/i18n/po/oc.po index 44c4c94b..76843d60 100644 --- a/src/assets/i18n/po/oc.po +++ b/src/assets/i18n/po/oc.po @@ -87,7 +87,7 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days #: +it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" "un logicial desvolopat per l’Universitat d’Estrasborg. Uèi son desvolopament " @@ -942,7 +942,7 @@ msgid "Your name" msgstr "Vòstre nom" #: .Generic.days -msgid "days" +msgid "dateList" msgstr "jorns" #: .Generic.for @@ -1660,7 +1660,7 @@ msgid "Remove a time slot" msgstr "Suprimir lo darrièr orari" #: .Step+2+date.Remove+all+days -msgid "Remove all days" +msgid "Remove all dateList" msgstr "Suprimir totes los jorns" #: .Step+2+date.Remove+all+times @@ -1675,13 +1675,13 @@ msgstr "Suprimir aqueste jorn" #: +two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" "Per crear un sondatge especial datas vos cal prepausar almens doas causidas " "(dos oraris per la meteissa jornada o dos jorns)." #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" msgstr "" "Podètz apondre o suprimir de jorns e oraris suplementaris amb los botons" @@ -1738,7 +1738,7 @@ msgid "Your poll will automatically be archived" msgstr "Vòstre sondatge serà archivat automaticament" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." msgstr "Vòstre sondatge serà archivat automaticament dins %d jorns." #: .Step+3.after+the+last+date+of+your+poll. diff --git a/src/assets/i18n/po/sv.po b/src/assets/i18n/po/sv.po index 2430434e..0b2d9c90 100644 --- a/src/assets/i18n/po/sv.po +++ b/src/assets/i18n/po/sv.po @@ -81,7 +81,7 @@ msgstr "" #: .2nd+section.software+developed+by+the+University+of+Strasbourg.+These+days,+it+is+developed+by+the+Framasoft+association. msgid "" -"software developed by the University of Strasbourg. These days, it is " +"software developed by the University of Strasbourg. These dateList, it is " "developed by the Framasoft association." msgstr "" "mjukvara utvecklad av Strasbourgs universitet. Idag utvecklas den av " @@ -917,7 +917,7 @@ msgid "Your name" msgstr "Ditt namn" #: .Generic.days -msgid "days" +msgid "dateList" msgstr "dagar" #: .Generic.for @@ -1607,7 +1607,7 @@ msgid "Remove a time slot" msgstr "Ta bort en tid" #: .Step+2+date.Remove+all+days -msgid "Remove all days" +msgid "Remove all dateList" msgstr "Ta bort alla dagar" #: .Step+2+date.Remove+all+times @@ -1621,13 +1621,13 @@ msgstr "Ta bort den här dagen" #: .Step+2+date.To+schedule+an+event+you+need+to+provide+at+least+two+choices+(e.g.,+two+time+slots+on+one+day+or+two+days). msgid "" "To schedule an event you need to provide at least two choices (e.g., two " -"time slots on one day or two days)." +"time slots on one day or two dateList)." msgstr "" "För att schemalägga ett evenemang måste du ange minst två val (alltså minst " "två tider samma dag eller två dagar)." #: .Step+2+date.You+can+add+or+remove+additional+days+and+times+with+the+buttons -msgid "You can add or remove additional days and times with the buttons" +msgid "You can add or remove additional dateList and times with the buttons" msgstr "Du kan lägga till och ta bort dagar och tider med knapparna" #: .Step+3.Back+to+step+2 @@ -1680,7 +1680,7 @@ msgid "Your poll will automatically be archived" msgstr "Din undersökning kommer arkiveras automatiskt" #: .Step+3.Your+poll+will+be+automatically+archived+in+%25d+days. -msgid "Your poll will be automatically archived in %d days." +msgid "Your poll will be automatically archived in %d dateList." msgstr "Din undersökning kommer arkiveras automatiskt om %d dagar." #: .Step+3.after+the+last+date+of+your+poll. diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index c6cb3ba5..8de6f602 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -17,6 +17,7 @@ export const environment = { showDemoWarning: true, autofill: false, autoSendNewPoll: false, + interval_days_default: 7, appTitle: 'FramaDate Funky', appVersion: '2.1.0', appLogo: 'assets/img/logo.png', diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 943dd3c4..0e893209 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -24,6 +24,7 @@ export const environment = { autofill: true, showDemoWarning: false, autoSendNewPoll: false, + interval_days_default: 7, appTitle: 'FramaDate Funky', appVersion: '2.1.0', appLogo: 'assets/img/logo.png',