diff --git a/src/main/resources/languages/_de.properties b/src/main/resources/languages/_de.properties index 6e011620e21401b71fbafabe60787360f0adb2b7..7c0ae71a907520d8012068078565665569919954 100644 --- a/src/main/resources/languages/_de.properties +++ b/src/main/resources/languages/_de.properties @@ -66,6 +66,7 @@ placeholder=Keine Daten verfügbar placeholder.seems.empty=Ganz schön leer hier... placeholder.advice=Füge {0} hinzu save.as.template=Vorlage erzeugen +save.as.template.errorsInForm=Vorlage konnte nicht erstellt werden, da Fehler im Formular existieren! # WEEK DAYS monday=Montag diff --git a/src/main/resources/languages/_en.properties b/src/main/resources/languages/_en.properties index 8c37f0d70a285e83504d9086fa28d80c4d747e3f..bfc2fa389ae2a8a214a0414358c242e162a10444 100644 --- a/src/main/resources/languages/_en.properties +++ b/src/main/resources/languages/_en.properties @@ -66,6 +66,7 @@ placeholder=No data available placeholder.seems.empty=It''s pretty empty here... placeholder.advice=Get started by adding {0} save.as.template=Create template +save.as.template.errorsInForm=Template could not be created because errors exist in the form! # WEEK DAYS monday=Monday diff --git a/src/main/resources/static/js/templates.js b/src/main/resources/static/js/templates.js index 577d71b247d64b5eb1f486cfe3eefc83d4bf418c..a8e102d875120ada8a4688f671a1e1654c0dd338 100644 --- a/src/main/resources/static/js/templates.js +++ b/src/main/resources/static/js/templates.js @@ -13,7 +13,7 @@ $(document).ready(function() if(!isValidForm) { $('#modalCreateFromTransaction').modal('close'); - // TODO: toast + M.toast({html: createTemplateWithErrorInForm}); return; } diff --git a/src/main/resources/templates/transactions/newTransactionNormal.ftl b/src/main/resources/templates/transactions/newTransactionNormal.ftl index a3b3e1143cf1d64c5846c9d37cb39580144ae65d..c1e0d8da54388cc9b2c48c4a8a876b77cc5383b9 100644 --- a/src/main/resources/templates/transactions/newTransactionNormal.ftl +++ b/src/main/resources/templates/transactions/newTransactionNormal.ftl @@ -70,6 +70,10 @@ <#import "../helpers/globalDatePicker.ftl" as datePicker> <@datePicker.datePickerLocalization/> + <script> + createTemplateWithErrorInForm = '${locale.getString("save.as.template.errorsInForm")}'; + </script> + <!-- Scripts--> <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> diff --git a/src/main/resources/templates/transactions/newTransactionTransfer.ftl b/src/main/resources/templates/transactions/newTransactionTransfer.ftl index 2bf38f536434db1c223ae4e24cb5411fbc67fd02..0181e8fca107dfc6355de071a518d250d4a3e166 100644 --- a/src/main/resources/templates/transactions/newTransactionTransfer.ftl +++ b/src/main/resources/templates/transactions/newTransactionTransfer.ftl @@ -75,6 +75,10 @@ <#import "../helpers/globalDatePicker.ftl" as datePicker> <@datePicker.datePickerLocalization/> + <script> + createTemplateWithErrorInForm = '${locale.getString("save.as.template.errorsInForm")}'; + </script> + <!-- Scripts--> <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/>