diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 1fe5ba65..6b18aa06 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -21,6 +21,7 @@ export class AppComponent { @Inject(DOCUMENT) private document, private route: Router) { this.detectCurrentTabOnRouteChange(); + this.findLocalStoragePreferences(); this.isDevelopmentEnv = !environment.production } @@ -54,4 +55,14 @@ export class AppComponent { } } } + + public findLocalStoragePreferences() { + const storage = window.localStorage; + + if ( storage ){ + const preferences = storage.getItem('FramadateConfig'); + + } + } + } diff --git a/src/app/config/PollConfig.ts b/src/app/config/PollConfig.ts index 2474383d..c8c79ce8 100644 --- a/src/app/config/PollConfig.ts +++ b/src/app/config/PollConfig.ts @@ -1,8 +1,8 @@ /** * une option de date dans les sondages spéciaux */ -import {environment} from "../../environments/environment"; -import {DateChoice, defaultAnswers, otherDefaultDates, PollAnswer} from "./defaultConfigs"; +import {environment} from '../../environments/environment'; +import {DateChoice, defaultAnswers, otherDefaultDates, PollAnswer} from './defaultConfigs'; export interface DateOption { timeList: any; @@ -11,11 +11,11 @@ export interface DateOption { } const baseConfigValues = { - pollType: "classic", - title: "", - description: "", - myName: "", - myEmail: "", + pollType: 'dates', + title: '', + description: '', + myName: '', + myEmail: '', }; @@ -28,20 +28,22 @@ export class PollConfig { expiracyDateDefaultInDays = 60; deletionDateAfterLastModification = 180; - step: number = 0; // step in the progress of creating a poll - stepMax: number = 3; // step max in the progress of creating a poll - pollType: string = 'dates';// classic or dates + step = 0; // step in the progress of creating a poll + stepMax = 3; // step max in the progress of creating a poll + pollType = 'dates';// classic or dates - title: string = 'titre'; - description: string = 'ma description'; - myName: string = 'mon pseudo'; - myComment: string = 'wouah trop bien framadate!'; - isAdmin: boolean = true; + title: string = environment.production ? '' : 'titre'; + description: string = environment.production ? '' : 'ma description'; + myName: string = environment.production ? '' : 'mon pseudo'; + myComment: string = environment.production ? '' : 'wouah trop bien framadate!'; + isAdmin: boolean = !environment.production; myVoteStack: any; myTempVoteStack = 0; - myEmail: string = "tktest@tktest.com"; + myEmail: string = environment.production ? '' : 'tktest@tktest.com'; myPolls: any = [];// list of retrieved polls from the backend api - // date specific poll, we have the choice to setup different hours (timeList) for all possible dates (dateList), or use the same hours for all dates + /* + date specific poll, we have the choice to setup different hours (timeList) for all possible dates (dateList), or use the same hours for all dates + */ allowSeveralHours = 'true'; // access visibility = 'link_only'; // visible to anyone with the link: @@ -57,12 +59,12 @@ export class PollConfig { customUrl = ''; // custom slug in the url, must be unique customUrlIsUnique = null; // given by the backend urlSlugPublic = null; - urlPublic = environment.baseHref + '/#/poll/id/4'; + urlPublic = environment.production ? '' : environment.baseHref + '/#/poll/id/4'; urlAdmin = environment.baseHref + '/#/admin/d65es45fd45sdf45sd345f312sdf31sgfd345'; adminKey = ''; // key to change config of the poll owner_modifier_token = ''; // key to change a vote stack - canModifyAnswers: boolean = true;// bool for the frontend selector - whoModifiesAnswers = "everybody";// everybody, self, nobody (= just admin) + canModifyAnswers = true;// bool for the frontend selector + whoModifiesAnswers = 'everybody';// everybody, self, nobody (= just admin) 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 timeList: DateChoice[] = otherDefaultDates; // ranges of time expressed as strings @@ -70,15 +72,15 @@ export class PollConfig { answers: PollAnswer[] = defaultAnswers; // front end choices themeChoices: string[] = ['light-watermelon', 'dark-crystal', 'hot-covid']; - themeSelected: number = 0; - themeClass: string = 'theme-light-watermelon'; + themeSelected = 0; + themeClass = 'theme-light-watermelon'; // modals - displayConfirmVoteModalAdmin: boolean = false; + displayConfirmVoteModalAdmin = false; resetConfig() { const self = this; Object.keys(baseConfigValues).forEach((key) => { self[key] = baseConfigValues[key]; - }) + }); } } diff --git a/src/app/pages/voting/voting-choice/voting-choice.component.scss b/src/app/pages/voting/voting-choice/voting-choice.component.scss index 4d79b14c..6bbc4504 100644 --- a/src/app/pages/voting/voting-choice/voting-choice.component.scss +++ b/src/app/pages/voting/voting-choice/voting-choice.component.scss @@ -133,9 +133,14 @@ $breakpoint-responsive: 640px; // à définir left: auto; } } - + &:focus, &:active { + border-color: #bf83c2; + color: #bf83c2; + background: #000; + } &--active { border-color: #bf83c2; + } @media (min-width: $breakpoint-responsive) {