From aa6ffd3234e34ad673e62602bf089c45674352d4 Mon Sep 17 00:00:00 2001
From: Robert Goldmann <deadlocker@gmx.de>
Date: Sat, 2 Oct 2021 16:34:13 +0200
Subject: [PATCH] #596 - automatically show repeating options if a repeating
 transactions is edited

---
 .../templates/transactions/newTransactionMacros.ftl       | 8 +++++++-
 .../templates/transactions/newTransactionNormal.ftl       | 6 ------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/main/resources/templates/transactions/newTransactionMacros.ftl b/src/main/resources/templates/transactions/newTransactionMacros.ftl
index 75579718e..75d726084 100644
--- a/src/main/resources/templates/transactions/newTransactionMacros.ftl
+++ b/src/main/resources/templates/transactions/newTransactionMacros.ftl
@@ -154,7 +154,13 @@
 </#macro>
 
 <#macro transactionRepeating transaction currentDate>
-    <div class="hidden" id="transaction-repeating-option">
+    <div class="row <#if transaction.isRepeating()>hidden</#if>">
+        <div class="col s12 center-align">
+            <@header.buttonLink url='' icon='repeat' localizationKey='repeating.button' id='button-transaction-add-repeating-option' color='background-blue-baby' noUrl=true classes="text-black"/>
+        </div>
+    </div>
+
+    <div class="<#if !transaction.isRepeating()>hidden</#if>" id="transaction-repeating-option">
         <input type="hidden" name="isRepeating" value="<#if transaction.getRepeatingOption()??>1}</#if>">
 
         <div class="row">
diff --git a/src/main/resources/templates/transactions/newTransactionNormal.ftl b/src/main/resources/templates/transactions/newTransactionNormal.ftl
index 154f59ae4..4dfcf5698 100644
--- a/src/main/resources/templates/transactions/newTransactionNormal.ftl
+++ b/src/main/resources/templates/transactions/newTransactionNormal.ftl
@@ -72,12 +72,6 @@
                             </#if>
                             <@customSelectMacros.customAccountSelect "account-select-wrapper" "account" accounts selectedAccount "col s12 m12 l8 offset-l2" locale.getString("transaction.new.label.account") "transaction-account"/>
 
-                            <div class="row">
-                                <div class="col s12 center-align">
-                                    <@header.buttonLink url='' icon='repeat' localizationKey='repeating.button' id='button-transaction-add-repeating-option' color='background-blue-baby' noUrl=true classes="text-black"/>
-                                </div>
-                            </div>
-
                             <#-- repeating options -->
                             <@newTransactionMacros.transactionRepeating transaction currentDate/>
 
-- 
GitLab