From 8745e37be89a579db49611f00d9a62de0dfa5b42 Mon Sep 17 00:00:00 2001
From: Robert Goldmann <deadlocker@gmx.de>
Date: Sat, 23 Jul 2022 18:28:56 +0200
Subject: [PATCH] #677 - cleanup

---
 .../src/main/resources/templates/helpers/header.ftl      | 4 ++--
 .../src/main/resources/templates/settings/settings.ftl   | 9 ---------
 .../templates/transactions/newTransactionTransfer.ftl    | 2 +-
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/BudgetMasterServer/src/main/resources/templates/helpers/header.ftl b/BudgetMasterServer/src/main/resources/templates/helpers/header.ftl
index 3b1c9a7be..966f4bdd7 100644
--- a/BudgetMasterServer/src/main/resources/templates/helpers/header.ftl
+++ b/BudgetMasterServer/src/main/resources/templates/helpers/header.ftl
@@ -121,7 +121,7 @@
 </#macro>
 
 <#macro buttonLink url icon localizationKey id="" color="background-blue" classes="" isDataUrl=false noUrl=false disabled=false target="">
-    <a <#if target??>target="${target}"</#if> <#if !isDataUrl && !noUrl>href="<@s.url url/>"</#if>
+    <a <#if target?has_content>target="${target}"</#if> <#if !isDataUrl && !noUrl>href="<@s.url url/>"</#if>
        id="${id}"
        class="waves-effect waves-light btn ${color} ${classes}"
         <#if isDataUrl>data-url="${url}"</#if>
@@ -131,7 +131,7 @@
 </#macro>
 
 <#macro buttonSubmit name icon localizationKey id="" color="background-blue" classes="" disabled=false formaction="" value="" onclick="">
-    <button id="${id}" class="btn waves-effect waves-light ${color} ${classes}" type="submit" name="${name}" <#if disabled>disabled</#if> <#if formaction?has_content>formaction="<@s.url formaction/>"</#if> <#if value?has_content>value="${value}"</#if> <#if onclick??>onclick="${onclick}"</#if>>
+    <button id="${id}" class="btn waves-effect waves-light ${color} ${classes}" type="submit" name="${name}" <#if disabled>disabled</#if> <#if formaction?has_content>formaction="<@s.url formaction/>"</#if> <#if value?has_content>value="${value}"</#if> <#if onclick?has_content>onclick="${onclick}"</#if>>
         <i class="material-icons left <#if !localizationKey?has_content>no-margin</#if>">${icon}</i><#if localizationKey?has_content>${locale.getString(localizationKey)}</#if>
     </button>
 </#macro>
diff --git a/BudgetMasterServer/src/main/resources/templates/settings/settings.ftl b/BudgetMasterServer/src/main/resources/templates/settings/settings.ftl
index 31a949d98..0d0edbe20 100644
--- a/BudgetMasterServer/src/main/resources/templates/settings/settings.ftl
+++ b/BudgetMasterServer/src/main/resources/templates/settings/settings.ftl
@@ -70,15 +70,6 @@
                                 </ul>
                             </div>
                         </div>
-
-                        <form name="Settings" action="<@s.url '/settings/save'/>" method="post">
-                            <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" id="token"/>
-                            <input type="hidden" name="ID" value="${settings.getID()?c}">
-                            <input type="hidden" name="lastBackupReminderDate" value="${dateService.getLongDateString(settings.getLastBackupReminderDate())}">
-                            <input type="hidden" name="installedVersionCode" value="${settings.getInstalledVersionCode()}">
-                            <input type="hidden" name="whatsNewShownForCurrentVersion" value="${settings.getWhatsNewShownForCurrentVersion()?c}">
-                            <input type="hidden" name="migrationDeclined" value="${settings.getMigrationDeclined()?c}">
-                        </form>
                     </div>
                 </@header.content>
             </div>
diff --git a/BudgetMasterServer/src/main/resources/templates/transactions/newTransactionTransfer.ftl b/BudgetMasterServer/src/main/resources/templates/transactions/newTransactionTransfer.ftl
index 6c9560c74..3ef2b5821 100644
--- a/BudgetMasterServer/src/main/resources/templates/transactions/newTransactionTransfer.ftl
+++ b/BudgetMasterServer/src/main/resources/templates/transactions/newTransactionTransfer.ftl
@@ -33,7 +33,7 @@
                 <@header.content>
                     <div class="container">
                         <#import "../helpers/validation.ftl" as validation>
-                        <form id="mainForm" name="NewTransaction" action="<@s.url '/transactions/newTransaction'/>" method="post" onsubmit="return validateForm()">
+                        <form id="mainForm" name="NewTransaction" action="<@s.url '/transactions/newTransaction'/>" method="post">
                             <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
                             <!-- only set ID for transactions not templates, otherwise the input is filled with the template ID and saving the transaction
                             may then override an existing transactions if the ID is also already used in transactions table -->
-- 
GitLab