diff --git a/src/app/config/mocks/mockmypolls.ts b/src/app/config/mocks/mockmypolls.ts index 2fb32db2..4bf1f435 100644 --- a/src/app/config/mocks/mockmypolls.ts +++ b/src/app/config/mocks/mockmypolls.ts @@ -1,7 +1,7 @@ export const mockMyPolls = [{ - "id": 1, - "title": "blehehehe heh hehhe e", + "id": 1000001, + "title": "blehehehe heh hehhe e test1", "customUrl": null, "description": "maaaaaaaaaaah", "creationDate": {"date": "2020-01-20 14:21:16.270157", "timezone_type": 3, "timezone": "Europe/Paris"}, @@ -19,5 +19,25 @@ export const mockMyPolls = "choices": {}, "comments": {}, "defaultExpiracyDaysFromNow": 60 + }, { + "id": 1000002, + "title": "bleh z zr erth tuyjikioy yylil test2", + "customUrl": null, + "description": "maaaaaaaaaaah 2", + "creationDate": {"date": "2020-01-20 14:21:16.270157", "timezone_type": 3, "timezone": "Europe/Paris"}, + "expiracyDate": {"date": "2020-01-20 14:21:16.270178", "timezone_type": 3, "timezone": "Europe/Paris"}, + "owner": null, + "kind": "text", + "allowedAnswers": ["yes"], + "modificationPolicy": "nobody", + "mailOnComment": null, + "mailOnVote": null, + "hideResults": null, + "showResultEvenIfPasswords": null, + "votes": {}, + "stacksOfVotes": {}, + "choices": {}, + "comments": {}, + "defaultExpiracyDaysFromNow": 60 }] ; diff --git a/src/app/pages/answers/answers.component.html b/src/app/pages/answers/answers.component.html index fb8ddce4..78896640 100644 --- a/src/app/pages/answers/answers.component.html +++ b/src/app/pages/answers/answers.component.html @@ -63,6 +63,7 @@ [(ngModel)]="answer.text" (keyup.enter)="addAnswer()" (keyup)="navigateOrDelete($event,i)" + required='required' placeholder="réponse" >
diff --git a/src/app/pages/answers/answers.component.scss b/src/app/pages/answers/answers.component.scss index 66f174a6..e69de29b 100644 --- a/src/app/pages/answers/answers.component.scss +++ b/src/app/pages/answers/answers.component.scss @@ -1,8 +0,0 @@ -:host { - .img-thumbnail { - width: 5em; - height: 5em; - margin: 1ch 0; - display: inline-block; - } -} diff --git a/src/app/pages/answers/answers.component.ts b/src/app/pages/answers/answers.component.ts index ed4a4b62..ab769f02 100644 --- a/src/app/pages/answers/answers.component.ts +++ b/src/app/pages/answers/answers.component.ts @@ -1,4 +1,4 @@ -import {AfterViewInit, ChangeDetectorRef, Component, Inject, OnInit} from '@angular/core'; +import {AfterViewInit, ChangeDetectorRef, Component, Inject, OnChanges, OnInit} from '@angular/core'; import {BaseComponent} from '../base-page/base.component'; import {ConfigService} from '../../services/config.service'; @@ -9,7 +9,9 @@ import {DOCUMENT} from '@angular/common'; templateUrl: './answers.component.html', styleUrls: ['./answers.component.scss'] }) -export class AnswersComponent extends BaseComponent implements OnInit, AfterViewInit { +export class AnswersComponent extends BaseComponent implements OnInit, AfterViewInit, OnChanges { + + private allAnswersAreValid = false; private answerList = []; private currentHeader: any = ""; @@ -26,8 +28,24 @@ export class AnswersComponent extends BaseComponent implements OnInit, AfterView ngOnInit() { } + ngOnChanges() { + + this.checkValidAnswers(); + } + + checkValidAnswers() { + this.allAnswersAreValid = true; + this.config.answers.forEach(answer => { + if (!answer.text.length) { + this.allAnswersAreValid = false; + return; + } + }); + } + ngAfterViewInit() { - this.focusOnAnswer(0) + this.focusOnAnswer(0); + this.checkValidAnswers(); } trackFunction(index: number, item: any): number { diff --git a/src/app/pages/home/home.component.html b/src/app/pages/home/home.component.html index 9a0de354..3a9d7523 100644 --- a/src/app/pages/home/home.component.html +++ b/src/app/pages/home/home.component.html @@ -1,32 +1,32 @@ -
- -

+
+ +

{{"creation.title"|translate}} -

+

{{"creation.want"|translate}} - + + + - - + + -
+
+ -
+
-
-
-
+
+ {{"creation.description"|translate}}: + +
-
-
-
+
+ + - -
+ +
+ -
-
+ +
+ diff --git a/src/app/pages/resume/resume.component.html b/src/app/pages/resume/resume.component.html index 9a812cf3..1d8b9acf 100644 --- a/src/app/pages/resume/resume.component.html +++ b/src/app/pages/resume/resume.component.html @@ -1,31 +1,45 @@ -

+

Récapitulatif -

-

- {{config.title}} -

-
- créé par - {{config.myName}} -
-
-

- {{config.description}} -

-
-
- - -
- + +
-
- +

+ {{config.title}} +

+
+ créé par + {{config.myName}} +
+
+

+ {{config.description}} +

+
+
+
    +
  • + image {{questions.url}} + {{questions.id + 1}}. {{questions.text}} +
  • +
+
+ +
+ + +
+ -
+ +
diff --git a/src/app/pages/resume/resume.component.scss b/src/app/pages/resume/resume.component.scss index e69de29b..003a05e6 100644 --- a/src/app/pages/resume/resume.component.scss +++ b/src/app/pages/resume/resume.component.scss @@ -0,0 +1,5 @@ +.card { + box-shadow: 0px 0px 0.5em #ccc; + padding: 2em; + margin: 1em 0; +} diff --git a/src/app/pages/visibility/visibility.component.html b/src/app/pages/visibility/visibility.component.html index 1c70bbad..3a47ec40 100644 --- a/src/app/pages/visibility/visibility.component.html +++ b/src/app/pages/visibility/visibility.component.html @@ -1,162 +1,174 @@ -

+

{{"visibility.top_txt"|translate}} -

-
-

+

+
+

{{"visibility.title"|translate}} -

- + + {{"visibility.visibility_want"|translate}} - + - + + + {{"visibility.visibility_see"|translate}} - + -
+
-
-

+
+

{{"visibility.votes"|translate}} -

-

+ + -
-
-
+
+ + - -
-
- -
-
-

+

+
+

{{"visibility.access"|translate}} -

- +
+ - + {{"visibility.access_instructions"|translate}} - -
+ +
{{baseUrl + '/' + config.customUrl}} -
-
-
+
+ - + + - -
- - - -
-
+ + + - + {{"visibility.validate_btn"|translate}} - -
+ +
- + -
+ +
diff --git a/src/assets/scss/atoms/_forms.scss b/src/assets/scss/atoms/_forms.scss index b0edc951..ad9328f0 100644 --- a/src/assets/scss/atoms/_forms.scss +++ b/src/assets/scss/atoms/_forms.scss @@ -46,7 +46,6 @@ option { -webkit-appearance: none; -moz-appearance: none; - background: none; border-radius: 0; background-color: transparent; @@ -164,3 +163,7 @@ select, input, textarea { display: block; width: 100%; } + +.btn, a { + cursor: pointer; +} diff --git a/src/assets/scss/atoms/_images.scss b/src/assets/scss/atoms/_images.scss index 03bb3631..74a5b8fd 100644 --- a/src/assets/scss/atoms/_images.scss +++ b/src/assets/scss/atoms/_images.scss @@ -1 +1,7 @@ -@charset "UTF-8"; \ No newline at end of file +@charset "UTF-8"; +.img-thumbnail { + width: 5em; + height: 5em; + margin: 1ch 0; + display: inline-block; +}