From 70b6004eb2c861aaaaaafb3b8851441a8020e0eb Mon Sep 17 00:00:00 2001
From: Robert Goldmann <deadlocker@gmx.de>
Date: Sun, 11 Jul 2021 15:25:25 +0200
Subject: [PATCH] #626 - added new hint for template overview keyboard controls

---
 .../java/de/deadlocker8/budgetmaster/hints/HintService.java   | 2 +-
 src/main/resources/languages/hints_de.properties              | 3 ++-
 src/main/resources/languages/hints_en.properties              | 3 ++-
 src/main/resources/static/css/style.css                       | 4 ++++
 src/main/resources/templates/helpers/header.ftl               | 2 +-
 src/main/resources/templates/templates/templates.ftl          | 3 +++
 6 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/main/java/de/deadlocker8/budgetmaster/hints/HintService.java b/src/main/java/de/deadlocker8/budgetmaster/hints/HintService.java
index f5d868137..4fbb05541 100644
--- a/src/main/java/de/deadlocker8/budgetmaster/hints/HintService.java
+++ b/src/main/java/de/deadlocker8/budgetmaster/hints/HintService.java
@@ -54,7 +54,7 @@ public class HintService implements Resettable
 	@Override
 	public void createDefaults()
 	{
-		final List<String> hintKeys = List.of("hint.first.use.teaser", "hint.report.columns");
+		final List<String> hintKeys = List.of("hint.first.use.teaser", "hint.report.columns", "hint.template.arrow.keys");
 
 		for(String localizationKey : hintKeys)
 		{
diff --git a/src/main/resources/languages/hints_de.properties b/src/main/resources/languages/hints_de.properties
index 5f3419b97..c9c7e1ca0 100644
--- a/src/main/resources/languages/hints_de.properties
+++ b/src/main/resources/languages/hints_de.properties
@@ -3,4 +3,5 @@ button.hints.reset=Alle Tipps zurücksetzen
 notification.hints.reset=Alle Tipps zurückgesetzt
 
 hint.first.use.teaser=Neu im BudgetMaster? Sieh dir die Einführung an!
-hint.report.columns=Hinweis: Du kannst die Reihenfolge der Spalten per Drag&Drop anpassen.
+hint.report.columns=Hinweis: Du kannst die Reihenfolge der Spalten per Drag&Drop anpassen
+hint.template.arrow.keys=Du kannst eine Vorlage mit den Pfeiltasten auswählen und mit Enter bestätigen
diff --git a/src/main/resources/languages/hints_en.properties b/src/main/resources/languages/hints_en.properties
index 94ad28725..31a3384fc 100644
--- a/src/main/resources/languages/hints_en.properties
+++ b/src/main/resources/languages/hints_en.properties
@@ -3,4 +3,5 @@ button.hints.reset=Reset all hints
 notification.hints.reset=All hints reset
 
 hint.first.use.teaser=New to BudgetMaster? Check out the first use guide!
-hint.report.columns=Note: You can change the order of the columns by drag&drop.
\ No newline at end of file
+hint.report.columns=Note: You can change the order of the columns by drag&drop
+hint.template.arrow.keys=You can select a template by using the arrow keys and confirm with enter
\ No newline at end of file
diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css
index d46aaf55d..81281ff03 100644
--- a/src/main/resources/static/css/style.css
+++ b/src/main/resources/static/css/style.css
@@ -563,6 +563,10 @@ input[type="radio"]:checked + span::after, [type="radio"].with-gap:checked + spa
     .template-header-name {
         max-width: 40% !important;
     }
+
+    .notification {
+        font-size: 2.5vmin;
+    }
 }
 
 /* dark theme */
diff --git a/src/main/resources/templates/helpers/header.ftl b/src/main/resources/templates/helpers/header.ftl
index cffb66df3..485ab5ffb 100644
--- a/src/main/resources/templates/helpers/header.ftl
+++ b/src/main/resources/templates/helpers/header.ftl
@@ -109,7 +109,7 @@
                             <a href="<@s.url actionUrl/>" class="text-default">
                         </#if>
                             <i class="${icon} notification-item"></i>
-                            <span class="notification-item">${locale.getString(hint.getLocalizationKey())}</span>
+                            <span class="notification-item left-align">${locale.getString(hint.getLocalizationKey())}</span>
                         <#if actionUrl?has_content>
                             </a>
                         </#if>
diff --git a/src/main/resources/templates/templates/templates.ftl b/src/main/resources/templates/templates/templates.ftl
index 1325cfae2..65ae7deff 100644
--- a/src/main/resources/templates/templates/templates.ftl
+++ b/src/main/resources/templates/templates/templates.ftl
@@ -33,6 +33,9 @@
                     <br>
                     <@templateFunctions.buttons/>
                     <br>
+                    <#assign hint=helpers.getHintByLocalizationKey("hint.template.arrow.keys")/>
+                    <@header.hint hint=hint/>
+                    <br>
                     <#if templates?size == 0>
                         <div class="container">
                             <div class="headline center-align">${locale.getString("placeholder")}</div>
-- 
GitLab