From c914b3a4d44dc30a4c7df0d2e29829debd88ad4b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20G=C3=A4rtner?= <andreas.gaertner@hotmail.com>
Date: Sun, 25 Oct 2015 03:01:52 +0100
Subject: [PATCH] Add splashscreen configuration options to
 ConfigurationController

---
 .../controller/ConfigurationController.java   | 28 +++++++++++++++++++
 src/main/resources/arsnova.properties.example |  7 +++++
 src/test/resources/arsnova.properties.example |  7 +++++
 3 files changed, 42 insertions(+)

diff --git a/src/main/java/de/thm/arsnova/controller/ConfigurationController.java b/src/main/java/de/thm/arsnova/controller/ConfigurationController.java
index 99b5d3cbd..837a000b2 100644
--- a/src/main/java/de/thm/arsnova/controller/ConfigurationController.java
+++ b/src/main/java/de/thm/arsnova/controller/ConfigurationController.java
@@ -139,6 +139,18 @@ public class ConfigurationController extends AbstractController {
 	@Value("${ui.slogan:}")
 	private String arsnovaSlogan;
 
+	@Value("${splashscreen.logo-path:}")
+	private String splashscreenLogo;
+
+	@Value("${splashscreen.slogan:}")
+	private String splashscreenSlogan;
+
+	@Value("${splashscreen.background-color:}")
+	private String splashscreenBgColor;
+
+	@Value("${splashscreen.loading-ind-color:}")
+	private String splashscreenLoadingIndColor;
+
 	@Value("${pp.session-levels.de}")
 	private String ppLevelsDe;
 
@@ -151,6 +163,7 @@ public class ConfigurationController extends AbstractController {
 		HashMap<String, Object> config = new HashMap<String, Object>();
 		HashMap<String, Boolean> features = new HashMap<String, Boolean>();
 		HashMap<String, String> publicPool = new HashMap<String, String>();
+		HashMap<String, String> splashscreen = new HashMap<String, String>();
 
 		/* The API path could be unknown to the client in case the request was forwarded */
 		if ("".equals(apiPath)) {
@@ -226,6 +239,21 @@ public class ConfigurationController extends AbstractController {
 			publicPool.put("levelsEn", ppLevelsEn);
 		}
 
+		config.put("splashscreen", splashscreen);
+
+		if (!"".equals(splashscreenLogo)) {
+			splashscreen.put("logo", splashscreenLogo);
+		}
+		if (!"".equals(splashscreenSlogan)) {
+			splashscreen.put("slogan", splashscreenSlogan);
+		}
+		if (!"".equals(splashscreenBgColor)) {
+			splashscreen.put("bgcolor", splashscreenBgColor);
+		}
+		if (!"".equals(splashscreenLoadingIndColor)) {
+			splashscreen.put("loadIndColor", splashscreenLoadingIndColor);
+		}
+
 		if (!"".equals(trackingTrackerUrl)) {
 			HashMap<String, String> tracking = new HashMap<String, String>();
 			config.put("tracking", tracking);
diff --git a/src/main/resources/arsnova.properties.example b/src/main/resources/arsnova.properties.example
index 4ac9e3034..ca66ba4f3 100644
--- a/src/main/resources/arsnova.properties.example
+++ b/src/main/resources/arsnova.properties.example
@@ -213,6 +213,13 @@ session.demo-id=
 # Label underneath ARSnova logo
 ui.slogan=Audience Response System
 
+# Splashscreen configuration
+#
+splashscreen.logo-path=resources/images/arsnova.png
+splashscreen.slogan=Audience Response System
+splashscreen.background-color=#E0E0E0
+splashscreen.loading-ind-color=#4A5C66
+
 # Links which are displayed in the frontend applications
 #
 links.blog.url=https://arsnova.eu/blog/
diff --git a/src/test/resources/arsnova.properties.example b/src/test/resources/arsnova.properties.example
index 2829c2d77..f9768d1f0 100644
--- a/src/test/resources/arsnova.properties.example
+++ b/src/test/resources/arsnova.properties.example
@@ -213,6 +213,13 @@ session.demo-id=
 # Label underneath ARSnova logo
 ui.slogan=Audience Response System
 
+# Splashscreen configuration
+#
+splashscreen.logo-path=resources/images/arsnova.png
+splashscreen.slogan=Audience Response System
+splashscreen.background-color=#E0E0E0
+splashscreen.loading-ind-color=#4A5C66
+
 # Links which are displayed in the frontend applications
 #
 links.blog.url=https://arsnova.eu/blog/
-- 
GitLab