Skip to content
Snippets Groups Projects
Commit cb0ac2ac authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#596 - new normal transaction page: addes button to add repeating options

parent 0b2c5c2a
Branches
Tags
No related merge requests found
...@@ -305,6 +305,8 @@ transaction.new.label.transfer.account=Zielkonto ...@@ -305,6 +305,8 @@ transaction.new.label.transfer.account=Zielkonto
transaction.new.label.repeating=Wiederholung transaction.new.label.repeating=Wiederholung
transaction.new.label.repeating.all=Alle transaction.new.label.repeating.all=Alle
repeating.button=Wiederholung hinzufügen
repeating.modifier.days=Tage repeating.modifier.days=Tage
repeating.modifier.months=Monate repeating.modifier.months=Monate
repeating.modifier.years=Jahre repeating.modifier.years=Jahre
......
...@@ -306,6 +306,8 @@ transaction.new.label.transfer.account=Destination Account ...@@ -306,6 +306,8 @@ transaction.new.label.transfer.account=Destination Account
transaction.new.label.repeating=Repeating transaction.new.label.repeating=Repeating
transaction.new.label.repeating.all=Every transaction.new.label.repeating.all=Every
repeating.button=Add repetition
repeating.modifier.days=Days repeating.modifier.days=Days
repeating.modifier.months=Months repeating.modifier.months=Months
repeating.modifier.years=Years repeating.modifier.years=Years
......
...@@ -263,6 +263,13 @@ $(document).ready(function() ...@@ -263,6 +263,13 @@ $(document).ready(function()
{ {
fetchAndShowModalContent(this.dataset.url, '#deleteModalContainerOnDemand', '#modalConfirmDelete', function(){}); fetchAndShowModalContent(this.dataset.url, '#deleteModalContainerOnDemand', '#modalConfirmDelete', function(){});
}); });
$('#button-transaction-add-repeating-option').click(function()
{
document.getElementById('button-transaction-add-repeating-option').classList.toggle('hidden', true);
document.getElementsByName('isRepeating')[0].value = 1;
document.getElementById('transaction-repeating-option').classList.toggle('hidden', false);
});
}); });
function isHidden(el) function isHidden(el)
...@@ -403,7 +410,7 @@ function validateForm(allowEmptyAmount = false) ...@@ -403,7 +410,7 @@ function validateForm(allowEmptyAmount = false)
} }
} }
if($(transactionRepeatingModifierID).length) if(document.getElementsByName('isRepeating')[0].value === '1')
{ {
if(!validateNumber($(transactionRepeatingModifierID).val(), transactionRepeatingModifierID.substr(1), "hidden-" + transactionRepeatingModifierID.substr(1), numberValidationMessage, REGEX_NUMBER)) if(!validateNumber($(transactionRepeatingModifierID).val(), transactionRepeatingModifierID.substr(1), "hidden-" + transactionRepeatingModifierID.substr(1), numberValidationMessage, REGEX_NUMBER))
{ {
......
...@@ -154,6 +154,9 @@ ...@@ -154,6 +154,9 @@
</#macro> </#macro>
<#macro transactionRepeating transaction currentDate> <#macro transactionRepeating transaction currentDate>
<div class="hidden" id="transaction-repeating-option">
<input type="hidden" name="isRepeating" value="<#if transaction.getRepeatingOption()??>1}</#if>">
<div class="row"> <div class="row">
<div class="col s12 m12 l8 offset-l2"> <div class="col s12 m12 l8 offset-l2">
<i class="material-icons icon-repeating">repeat</i> <i class="material-icons icon-repeating">repeat</i>
...@@ -161,9 +164,10 @@ ...@@ -161,9 +164,10 @@
</div> </div>
</div> </div>
<@newTransactionMacros.repeatingModifier transaction/> <@repeatingModifier transaction/>
<@newTransactionMacros.repeatingEndOption transaction currentDate/> <@repeatingEndOption transaction currentDate/>
</div>
</#macro> </#macro>
<#macro repeatingModifier transaction> <#macro repeatingModifier transaction>
......
...@@ -72,6 +72,15 @@ ...@@ -72,6 +72,15 @@
</#if> </#if>
<@customSelectMacros.customAccountSelect "account-select-wrapper" "account" accounts selectedAccount "col s12 m12 l8 offset-l2" locale.getString("transaction.new.label.account") "transaction-account"/> <@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/>
<#-- buttons --> <#-- buttons -->
<@newTransactionMacros.buttons "/transactions"/> <@newTransactionMacros.buttons "/transactions"/>
<@newTransactionMacros.buttonTransactionActions isEdit true previousType??/> <@newTransactionMacros.buttonTransactionActions isEdit true previousType??/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment