From c8e935a1e5bc3228ac1b7684db843484357e6800 Mon Sep 17 00:00:00 2001
From: Robert Goldmann <deadlocker@gmx.de>
Date: Wed, 16 Jan 2019 21:38:11 +0100
Subject: [PATCH] Fixed #390 - improve placeholder text

---
 src/main/resources/languages/_de.properties          |  2 ++
 src/main/resources/languages/_en.properties          |  2 ++
 src/main/resources/static/css/dark/style.css         | 10 ++++++++++
 src/main/resources/static/css/style.css              |  6 ++++++
 .../templates/transactions/transactions.ftl          | 12 ++++++++++--
 5 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/languages/_de.properties b/src/main/resources/languages/_de.properties
index f831bab39..708e0f769 100644
--- a/src/main/resources/languages/_de.properties
+++ b/src/main/resources/languages/_de.properties
@@ -46,6 +46,8 @@ delete=L
 today=Heute
 tagfield.placeholder=Tag hier eingeben
 placeholder=Keine Daten verf�gbar
+placeholder.seems.empty=Ganz sch�n leer hier...
+placeholder.advice=F�ge {0} hinzu
 
 # WEEK DAYS
 monday=Montag
diff --git a/src/main/resources/languages/_en.properties b/src/main/resources/languages/_en.properties
index 45bf57bec..8b6386240 100644
--- a/src/main/resources/languages/_en.properties
+++ b/src/main/resources/languages/_en.properties
@@ -46,6 +46,8 @@ delete=Delete
 today=Today
 tagfield.placeholder=Enter Tag here
 placeholder=No data available
+placeholder.seems.empty=It's pretty empty here...
+placeholder.advice=Get started by adding {0}
 
 # WEEK DAYS
 monday=Monday
diff --git a/src/main/resources/static/css/dark/style.css b/src/main/resources/static/css/dark/style.css
index 40fc46813..e1c699472 100644
--- a/src/main/resources/static/css/dark/style.css
+++ b/src/main/resources/static/css/dark/style.css
@@ -346,6 +346,12 @@ textarea {
     color: #FFFFFF;
 }
 
+.headline-advice {
+    color: #FFFFFF;
+    opacity: 0.7;
+    margin-top: 0.5rem;
+}
+
 .headline-date {
     font-size: 4vmin;
     text-transform: capitalize;
@@ -523,6 +529,10 @@ input[type="radio"]:not(:checked) + span::before, [type="radio"]:not(:checked) +
     border-bottom: 1px solid #FFFFFF;
 }
 
+.placeholder-image {
+    width: 17vmin;
+}
+
 .hidden {
     display: none;
 }
diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css
index b7b255279..3ce81ad1b 100644
--- a/src/main/resources/static/css/style.css
+++ b/src/main/resources/static/css/style.css
@@ -284,6 +284,12 @@ main {
     color: #212121;
 }
 
+.headline-advice {
+    color: #212121;
+    opacity: 0.7;
+    margin-top: 0.5rem;
+}
+
 .headline-date {
     font-size: 4vmin;
     text-transform: capitalize;
diff --git a/src/main/resources/templates/transactions/transactions.ftl b/src/main/resources/templates/transactions/transactions.ftl
index b65e11c88..5a87a362b 100644
--- a/src/main/resources/templates/transactions/transactions.ftl
+++ b/src/main/resources/templates/transactions/transactions.ftl
@@ -77,8 +77,16 @@
                             </tr>
                         </#list>
                     </table>
-                    <#if transactions?size == 0>
-                        <div class="headline center-align">${locale.getString("placeholder")}</div>
+
+                    <#-- show placeholde text if no transactions are present in the current month or REST ist the only transaction -->
+                    <#assign isOnlyRest = transactions?size == 1 && transactions[0].category.type.name() == "REST"/>
+                    <#if isOnlyRest>
+                        <br>
+                    </#if>
+
+                    <#if transactions?size == 0 || isOnlyRest>
+                        <div class="headline center-align">${locale.getString("placeholder.seems.empty")}</div>
+                        <div class="headline-advice center-align">${locale.getString("placeholder.advice", locale.getString("menu.transactions"))}</div>
                     </#if>
                 </div>
             </div>
-- 
GitLab