From 5f2a2b4461f6a4b8a33b6d64af4180f7e1ff85de Mon Sep 17 00:00:00 2001 From: alrom8 Date: Wed, 23 Oct 2019 15:39:16 +0200 Subject: [PATCH] issue 36 : select daltonien --- src/app/config/Routes.ts | 50 +++++++++---------- .../poll-graphic/poll-graphic.component.html | 16 +++++- .../poll-graphic/poll-graphic.component.scss | 4 ++ .../poll-graphic/poll-graphic.component.ts | 10 +++- src/assets/i18n/en.json | 5 ++ src/assets/i18n/fr.json | 5 ++ 6 files changed, 63 insertions(+), 27 deletions(-) diff --git a/src/app/config/Routes.ts b/src/app/config/Routes.ts index 90a969ce..e1cd403b 100644 --- a/src/app/config/Routes.ts +++ b/src/app/config/Routes.ts @@ -1,29 +1,29 @@ -import {KindComponent} from '../pages/kind/kind.component'; -import {DatesComponent} from '../pages/dates/dates.component'; -import {VisibilityComponent} from '../pages/visibility/visibility.component'; -import {ResumeComponent} from '../pages/resume/resume.component'; -import {PicturesComponent} from '../pages/pictures/pictures.component'; -import {EndConfirmationComponent} from '../pages/end-confirmation/end-confirmation.component'; -import {AnswersComponent} from '../pages/answers/answers.component'; -import {CreateOrRetrieveComponent} from '../pages/create-or-retrieve/create-or-retrieve.component'; -import {BaseComponent} from '../pages/base-page/base.component'; -import {HomeComponent} from "../pages/home/home.component"; +import { KindComponent } from "../pages/kind/kind.component"; +import { DatesComponent } from "../pages/dates/dates.component"; +import { VisibilityComponent } from "../pages/visibility/visibility.component"; +import { ResumeComponent } from "../pages/resume/resume.component"; +import { PicturesComponent } from "../pages/pictures/pictures.component"; +import { EndConfirmationComponent } from "../pages/end-confirmation/end-confirmation.component"; +import { AnswersComponent } from "../pages/answers/answers.component"; +import { CreateOrRetrieveComponent } from "../pages/create-or-retrieve/create-or-retrieve.component"; +import { BaseComponent } from "../pages/base-page/base.component"; +import { HomeComponent } from "../pages/home/home.component"; +import { PollGraphicComponent } from '../poll-graphic/poll-graphic.component'; /** * each step in the form is a component */ -export const Routes = - [ - {path: '', component: CreateOrRetrieveComponent}, - {path: 'home', component: HomeComponent}, - {path: 'base', component: BaseComponent}, - {path: 'step/creation', component: CreateOrRetrieveComponent}, - {path: 'step/date', component: DatesComponent}, - {path: 'step/kind', component: KindComponent}, - {path: 'step/answers', component: AnswersComponent}, - {path: 'step/pictures', component: PicturesComponent}, - {path: 'step/visibility', component: VisibilityComponent}, - {path: 'step/resume', component: ResumeComponent}, - {path: 'step/end', component: EndConfirmationComponent}, - ] -; +export const Routes = [ + { path: "", component: CreateOrRetrieveComponent }, + { path: "home", component: HomeComponent }, + { path: "base", component: BaseComponent }, + { path: "step/creation", component: CreateOrRetrieveComponent }, + { path: "step/date", component: DatesComponent }, + { path: "step/kind", component: KindComponent }, + { path: "step/answers", component: AnswersComponent }, + { path: "step/pictures", component: PicturesComponent }, + { path: "step/visibility", component: VisibilityComponent }, + { path: "step/resume", component: ResumeComponent }, + { path: "step/end", component: EndConfirmationComponent }, + { path: "graphic/:poll", component: PollGraphicComponent }, +]; diff --git a/src/app/poll-graphic/poll-graphic.component.html b/src/app/poll-graphic/poll-graphic.component.html index 7e2222cd..9d945408 100644 --- a/src/app/poll-graphic/poll-graphic.component.html +++ b/src/app/poll-graphic/poll-graphic.component.html @@ -1 +1,15 @@ -

poll-graphic works!

+ + {{ "pollGraphic.colorblindText" | translate }} \ No newline at end of file diff --git a/src/app/poll-graphic/poll-graphic.component.scss b/src/app/poll-graphic/poll-graphic.component.scss index e69de29b..5eb2a3bb 100644 --- a/src/app/poll-graphic/poll-graphic.component.scss +++ b/src/app/poll-graphic/poll-graphic.component.scss @@ -0,0 +1,4 @@ +#selectColorblind { + direction: rtl; + padding:0; +} diff --git a/src/app/poll-graphic/poll-graphic.component.ts b/src/app/poll-graphic/poll-graphic.component.ts index 5f2b37d8..d00e5667 100644 --- a/src/app/poll-graphic/poll-graphic.component.ts +++ b/src/app/poll-graphic/poll-graphic.component.ts @@ -7,7 +7,15 @@ import { Component, OnInit } from '@angular/core'; }) export class PollGraphicComponent implements OnInit { - constructor() { } + isColorblind:boolean; + + constructor() { + this.isColorblind = false; + } + + setColorblind(){ + this.isColorblind = !this.isColorblind; + } ngOnInit() { } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 14073764..718787fb 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -60,5 +60,10 @@ "votes": "Votes", "archiving": "Archiving", "access": "Access to the pool" + }, + "pollGraphic":{ + "choiceColorblind":"I am", + "choiceNotColorblind":"I am not", + "colorblindText":"colorblind." } } diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 44ba5fac..5c99fd2f 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -60,5 +60,10 @@ "votes": "Votes", "archiving": "Archivage", "access": "Accès au sondage" + }, + "pollGraphic":{ + "choiceColorblind":"Je suis", + "choiceNotColorblind":"Je ne suis pas", + "colorblindText":"daltonien." } }