From 12e58382f4d33c1847d4935ae2c75a51ff867aac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de>
Date: Tue, 28 May 2019 12:03:49 +0200
Subject: [PATCH] Enable statistics for yes/no-contents + improvements

---
 .../shared/list-statistic/list-statistic.component.html     | 2 +-
 .../shared/list-statistic/list-statistic.component.scss     | 6 +++++-
 .../shared/list-statistic/list-statistic.component.ts       | 2 +-
 src/theme/blue-theme/blueTheme.const.ts                     | 2 +-
 src/theme/dark-theme/darkTheme.const.ts                     | 2 +-
 src/theme/default-theme/_variables.scss                     | 2 +-
 src/theme/default-theme/defaultTheme.const.ts               | 2 +-
 src/theme/purple-theme/purpleTheme.const.ts                 | 2 +-
 8 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/app/components/shared/list-statistic/list-statistic.component.html b/src/app/components/shared/list-statistic/list-statistic.component.html
index 7819f3608..f15b78a3b 100644
--- a/src/app/components/shared/list-statistic/list-statistic.component.html
+++ b/src/app/components/shared/list-statistic/list-statistic.component.html
@@ -1,6 +1,6 @@
 <mat-toolbar></mat-toolbar>
 <mat-progress-bar class="progress-theme" mode="determinate" value="{{total}}"
-                  *ngIf="total > status.good" color="primary"></mat-progress-bar>
+                  *ngIf="total >= status.good" color="primary"></mat-progress-bar>
 <mat-progress-bar class="progress-theme" mode="determinate" value="{{total}}"
                   *ngIf="total < status.good && total >= status.okay" color="accent"></mat-progress-bar>
 <mat-progress-bar class="progress-theme" mode="determinate" value="{{total}}"
diff --git a/src/app/components/shared/list-statistic/list-statistic.component.scss b/src/app/components/shared/list-statistic/list-statistic.component.scss
index 4a6726750..00adbe55f 100644
--- a/src/app/components/shared/list-statistic/list-statistic.component.scss
+++ b/src/app/components/shared/list-statistic/list-statistic.component.scss
@@ -30,7 +30,7 @@ mat-header-cell {
 
 mat-cell {
   color: black!important;
-  background-color: var(--grey-light);
+  background-color: var(--grey);
 }
 
 mat-toolbar {
@@ -58,3 +58,7 @@ mat-toolbar {
 .invisible {
   color: var(--grey)!important;
 }
+
+#okayP {
+  color: var(--yellow);
+}
diff --git a/src/app/components/shared/list-statistic/list-statistic.component.ts b/src/app/components/shared/list-statistic/list-statistic.component.ts
index c1223d79b..3480e3ece 100644
--- a/src/app/components/shared/list-statistic/list-statistic.component.ts
+++ b/src/app/components/shared/list-statistic/list-statistic.component.ts
@@ -97,7 +97,7 @@ export class ListStatisticComponent implements OnInit {
     for (let i = 0; i < length; i++) {
       this.dataSource[i] = new ContentStatistic(null, null, 0, 0, 0 );
       this.dataSource[i].content = this.contents[i];
-      if (contents[i].format === ContentType.CHOICE) {
+      if (contents[i].format === ContentType.CHOICE || contents[i].format === ContentType.BINARY) {
         this.contentService.getAnswer(contents[i].id).subscribe(answer => {
           if (contents[i].multiple) {
             percent = this.evaluateMultiple(contents[i].options, answer.roundStatistics[0].combinatedCounts);
diff --git a/src/theme/blue-theme/blueTheme.const.ts b/src/theme/blue-theme/blueTheme.const.ts
index 36e771589..38b278131 100644
--- a/src/theme/blue-theme/blueTheme.const.ts
+++ b/src/theme/blue-theme/blueTheme.const.ts
@@ -15,7 +15,7 @@ export const blue = {
   '--on-background': '#000000',
   '--on-surface': '#000000',
 
-  '--green': '#AED581',
+  '--green': '#81c784',
   '--red': '#FF8A80',
   '--yellow': '#FFD54F',
   '--blue': '#3f51b5',
diff --git a/src/theme/dark-theme/darkTheme.const.ts b/src/theme/dark-theme/darkTheme.const.ts
index b25e5738b..192c87683 100644
--- a/src/theme/dark-theme/darkTheme.const.ts
+++ b/src/theme/dark-theme/darkTheme.const.ts
@@ -15,7 +15,7 @@ export const dark = {
   '--on-background': '#FFFFFF',
   '--on-surface': '#FFFFFF',
 
-  '--green': '#AED581',
+  '--green': '#81c784',
   '--red': '#FF8A80',
   '--yellow': '#FFD54F',
   '--blue': '#3f51b5',
diff --git a/src/theme/default-theme/_variables.scss b/src/theme/default-theme/_variables.scss
index 81c04ab7c..b12daaf80 100644
--- a/src/theme/default-theme/_variables.scss
+++ b/src/theme/default-theme/_variables.scss
@@ -2,7 +2,7 @@
 // Define the palettes for your theme using the Material Design palettes available in palette.scss
 // (imported above). For each palette, you can optionally specify a default, lighter, and darker
 // hue. Available color palettes: https://www.google.com/design/spec/style/color.html
-$arsnova-primary: mat-palette($mat-teal,300);
+$arsnova-primary: mat-palette($mat-green,300);
 $arsnova-accent: mat-palette($mat-orange, 200); //$mat-blue-gray, A200, A100, A400);
 
 // The warn palette is optional (defaults to red).
diff --git a/src/theme/default-theme/defaultTheme.const.ts b/src/theme/default-theme/defaultTheme.const.ts
index 365c782c2..143687c13 100644
--- a/src/theme/default-theme/defaultTheme.const.ts
+++ b/src/theme/default-theme/defaultTheme.const.ts
@@ -15,7 +15,7 @@ export const arsnova = {
   '--on-background': '#000000',
   '--on-surface': '#000000',
 
-  '--green': '#AED581',
+  '--green': '#81c784',
   '--red': '#FF8A80',
   '--yellow': '#FFD54F',
   '--blue': '#3f51b5',
diff --git a/src/theme/purple-theme/purpleTheme.const.ts b/src/theme/purple-theme/purpleTheme.const.ts
index 3d892b1cd..3eaa032ea 100644
--- a/src/theme/purple-theme/purpleTheme.const.ts
+++ b/src/theme/purple-theme/purpleTheme.const.ts
@@ -15,7 +15,7 @@ export const purple = {
   '--on-background': '#000000',
   '--on-surface': '#000000',
 
-  '--green': '#AED581',
+  '--green': '#81c784',
   '--red': '#FF8A80',
   '--yellow': '#FFD54F',
   '--blue': '#3f51b5',
-- 
GitLab