= [];
constructor(
private router: Router,
@@ -50,6 +52,7 @@ export class ConsultationComponent implements OnInit, OnDestroy {
if (newpoll) {
this.isArchived = new Date(newpoll.expiracy_date) < new Date();
this.poll.choices_grouped.map((elem) => (elem.subSetToYes = false));
+ this.findFavouriteChoices(newpoll);
}
});
@@ -122,4 +125,15 @@ export class ConsultationComponent implements OnInit, OnDestroy {
this.toastService.display('erreur à l enregistrement');
}
}
+
+ private findFavouriteChoices(newpoll: Poll) {
+ let tempFavChoiceList = [];
+ newpoll.choices.map((choice: Choice) => {
+ console.log('choice.score', choice.score, newpoll.max_score);
+ if (choice.score === newpoll.max_score) {
+ tempFavChoiceList.push(choice);
+ }
+ });
+ this.favChoicesList = tempFavChoiceList;
+ }
}
diff --git a/src/app/features/consultation/poll-results-dinum/poll-results-dinum.component.html b/src/app/features/consultation/poll-results-dinum/poll-results-dinum.component.html
index 1fda1849..109450e3 100644
--- a/src/app/features/consultation/poll-results-dinum/poll-results-dinum.component.html
+++ b/src/app/features/consultation/poll-results-dinum/poll-results-dinum.component.html
@@ -23,6 +23,7 @@
0 && choice.score == poll.max_score">
+ {{ choice.score }}
diff --git a/src/app/features/consultation/poll-results-dinum/poll-results-dinum.component.scss b/src/app/features/consultation/poll-results-dinum/poll-results-dinum.component.scss
index 52ccacb6..3ccd382f 100644
--- a/src/app/features/consultation/poll-results-dinum/poll-results-dinum.component.scss
+++ b/src/app/features/consultation/poll-results-dinum/poll-results-dinum.component.scss
@@ -4,6 +4,15 @@
padding: 0.75rem;
border-radius: 0.5rem;
}
+.favourite {
+ max-width: 20em;
+}
+.poll-anwsers {
+ .rounded-block {
+ max-width: 20em;
+ }
+}
+
.list-of-choices {
.button {
.icon {
@@ -11,19 +20,23 @@
display: inline-block;
}
}
+
.choice-label {
font-size: 1rem;
color: #383838;
}
+
.choice-header {
margin-left: -0.75rem;
margin-right: -0.75rem;
border-bottom: 1px solid #e2e0fa;
}
+
.max_score {
color: #128149;
}
}
+
.date-label {
font-size: 1rem;
color: #383838;
diff --git a/src/app/features/consultation/poll-results-dinum/poll-results-dinum.component.ts b/src/app/features/consultation/poll-results-dinum/poll-results-dinum.component.ts
index 1da8133c..66002627 100644
--- a/src/app/features/consultation/poll-results-dinum/poll-results-dinum.component.ts
+++ b/src/app/features/consultation/poll-results-dinum/poll-results-dinum.component.ts
@@ -25,6 +25,11 @@ export class PollResultsDinumComponent implements OnInit {
return new Date(date_string);
}
+ /**
+ * calculer localement le nombre max de réponses pour un choix parmi ses oui peut-être et non.
+ * c'est différent que de calculer ce maximum par rapport à tous les choix possibles
+ * @param c
+ */
getMax(c: Choice) {
return Math.max(c[Answer.YES].count, c[Answer.MAYBE].count, c[Answer.NO].count);
}
diff --git a/src/styles/partials/_forms.scss b/src/styles/partials/_forms.scss
index 2744e34d..c71d24ba 100644
--- a/src/styles/partials/_forms.scss
+++ b/src/styles/partials/_forms.scss
@@ -12,7 +12,7 @@ input.is-hovered,
select.is-hovered,
.is-hovered.textarea,
.select select.is-hovered {
- border-color: $font-color !important ;
+ border-color: $font-color !important;
}
app-step-one,
@@ -38,12 +38,14 @@ textarea {
margin-bottom: 1em;
}
}
+
button,
.button {
&:focus {
@extend .outlined;
}
}
+
textarea,
input,
.input,
@@ -55,6 +57,7 @@ select,
border: solid 1px $font-color !important;
border-radius: 4px;
@extend .clickable;
+
&:focus {
@extend .outlined;
}
@@ -88,11 +91,13 @@ textarea {
overflow-x: auto;
@extend .clickable;
}
+
.button {
display: inline-block;
padding: 10px 30px;
height: auto;
}
+
.button {
label {
margin-bottom: 0;
@@ -101,6 +106,7 @@ textarea {
text-align: left;
}
}
+
input[type='radio'] {
padding: 1em;
margin-bottom: 0;
@@ -299,11 +305,21 @@ mat-checkbox {
margin-left: 0;
margin-right: 0;
margin-top: 0;
+
.column {
padding-left: 0;
padding-right: 0;
- &.is-narrow {
- padding-right: 1rem;
+ }
+ }
+
+ .choice-bars-display {
+ .columns {
+ .column {
+ &.choice-label {
+ width: 5em;
+ text-align: right;
+ padding-right: 1em;
+ }
}
}
}
@@ -350,19 +366,10 @@ label {
}
}
-.choice-bars-display {
- .is-narrow {
- width: 5em;
- text-align: right;
- padding-right: 1em;
- }
- .bar {
- }
-}
-
.people {
max-width: $main-column-width/2;
}
+
.bar-div {
padding: 0.25rem 0.025rem;
text-align: center;
@@ -377,12 +384,14 @@ div {
color: #128149;
@extend .bar-div;
}
+
&.has-background-maybe {
border: solid 1px #86671b;
background: #fffaec;
color: #86671b;
@extend .bar-div;
}
+
&.has-background-no {
border: solid 1px #d51b38;
background: #ffecee;
+ {{ 'participation.comments' | translate }} +
+