From 265c9e1e5a7cda6908aa395dfd3cfa55e04ef4e0 Mon Sep 17 00:00:00 2001 From: Robert Goldmann <deadlocker@gmx.de> Date: Sat, 19 Jan 2019 15:44:30 +0100 Subject: [PATCH] refactoring --- src/main/resources/templates/about.ftl | 6 +++--- src/main/resources/templates/accounts/accounts.ftl | 6 +++--- src/main/resources/templates/accounts/newAccount.ftl | 8 ++++---- src/main/resources/templates/categories/categories.ftl | 6 +++--- .../resources/templates/categories/newCategory.ftl | 8 ++++---- src/main/resources/templates/error/403.ftl | 2 +- src/main/resources/templates/error/404.ftl | 2 +- src/main/resources/templates/error/418.ftl | 4 ++-- src/main/resources/templates/error/500.ftl | 4 ++-- .../resources/templates/{ => helpers}/datePicker.ftl | 0 src/main/resources/templates/{ => helpers}/header.ftl | 0 src/main/resources/templates/{ => helpers}/navbar.ftl | 0 .../resources/templates/{ => helpers}/notification.ftl | 0 src/main/resources/templates/{ => helpers}/scripts.ftl | 0 .../resources/templates/{ => helpers}/validation.ftl | 0 src/main/resources/templates/index.ftl | 6 +++--- src/main/resources/templates/login.ftl | 4 ++-- .../templates/{ => placeholder}/comingSoon.ftl | 6 +++--- .../templates/{ => placeholder}/emptyPage.ftl | 6 +++--- src/main/resources/templates/reports/reports.ftl | 8 ++++---- src/main/resources/templates/{ => settings}/import.ftl | 8 ++++---- .../resources/templates/{ => settings}/settings.ftl | 8 ++++---- .../templates/transactions/newTransaction.ftl | 10 +++++----- .../resources/templates/transactions/transactions.ftl | 8 ++++---- 24 files changed, 55 insertions(+), 55 deletions(-) rename src/main/resources/templates/{ => helpers}/datePicker.ftl (100%) rename src/main/resources/templates/{ => helpers}/header.ftl (100%) rename src/main/resources/templates/{ => helpers}/navbar.ftl (100%) rename src/main/resources/templates/{ => helpers}/notification.ftl (100%) rename src/main/resources/templates/{ => helpers}/scripts.ftl (100%) rename src/main/resources/templates/{ => helpers}/validation.ftl (100%) rename src/main/resources/templates/{ => placeholder}/comingSoon.ftl (78%) rename src/main/resources/templates/{ => placeholder}/emptyPage.ftl (58%) rename src/main/resources/templates/{ => settings}/import.ftl (94%) rename src/main/resources/templates/{ => settings}/settings.ftl (98%) diff --git a/src/main/resources/templates/about.ftl b/src/main/resources/templates/about.ftl index c7f07f0e5..30ba72327 100644 --- a/src/main/resources/templates/about.ftl +++ b/src/main/resources/templates/about.ftl @@ -1,10 +1,10 @@ <html> <head> - <#import "header.ftl" as header> + <#import "helpers/header.ftl" as header> <@header.header "BudgetMaster"/> </head> <body class="budgetmaster-blue-light"> - <#import "navbar.ftl" as navbar> + <#import "helpers/navbar.ftl" as navbar> <@navbar.navbar "about"/> <main> @@ -45,7 +45,7 @@ </main> <!-- Scripts--> - <#import "scripts.ftl" as scripts> + <#import "helpers/scripts.ftl" as scripts> <@scripts.scripts/> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/accounts/accounts.ftl b/src/main/resources/templates/accounts/accounts.ftl index b310765f4..c9fa22cad 100644 --- a/src/main/resources/templates/accounts/accounts.ftl +++ b/src/main/resources/templates/accounts/accounts.ftl @@ -1,11 +1,11 @@ <html> <head> - <#import "../header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster"/> <#import "/spring.ftl" as s> </head> <body class="budgetmaster-blue-light"> - <#import "../navbar.ftl" as navbar> + <#import "../helpers/navbar.ftl" as navbar> <@navbar.navbar "accounts"/> <main> @@ -67,7 +67,7 @@ </#if> <!-- Scripts--> - <#import "../scripts.ftl" as scripts> + <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> <script src="<@s.url '/js/accounts.js'/>"></script> </body> diff --git a/src/main/resources/templates/accounts/newAccount.ftl b/src/main/resources/templates/accounts/newAccount.ftl index 6243389dd..7b030943b 100644 --- a/src/main/resources/templates/accounts/newAccount.ftl +++ b/src/main/resources/templates/accounts/newAccount.ftl @@ -1,11 +1,11 @@ <html> <head> - <#import "../header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster"/> <#import "/spring.ftl" as s> </head> <body class="budgetmaster-blue-light"> - <#import "../navbar.ftl" as navbar> + <#import "../helpers/navbar.ftl" as navbar> <@navbar.navbar "accounts"/> <main> @@ -16,7 +16,7 @@ </div> </div> <div class="container"> - <#import "../validation.ftl" as validation> + <#import "../helpers/validation.ftl" as validation> <form name="NewAccount" action="<@s.url '/accounts/newAccount'/>" method="post"> <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> <input type="hidden" name="ID" value="<#if account.getID()??>${account.getID()?c}</#if>"> @@ -63,7 +63,7 @@ </main> <!-- Scripts--> - <#import "../scripts.ftl" as scripts> + <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/categories/categories.ftl b/src/main/resources/templates/categories/categories.ftl index 51100be23..70076c785 100644 --- a/src/main/resources/templates/categories/categories.ftl +++ b/src/main/resources/templates/categories/categories.ftl @@ -1,12 +1,12 @@ <html> <head> - <#import "../header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster"/> <@header.style "categories"/> <#import "/spring.ftl" as s> </head> <body class="budgetmaster-blue-light"> - <#import "../navbar.ftl" as navbar> + <#import "../helpers/navbar.ftl" as navbar> <@navbar.navbar "categories"/> <#import "categoriesFunctions.ftl" as categoriesFunctions> @@ -65,7 +65,7 @@ </main> <!-- Scripts--> - <#import "../scripts.ftl" as scripts> + <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> <script src="<@s.url '/js/categories.js'/>"></script> </body> diff --git a/src/main/resources/templates/categories/newCategory.ftl b/src/main/resources/templates/categories/newCategory.ftl index 20704eb6a..afc5b4f44 100644 --- a/src/main/resources/templates/categories/newCategory.ftl +++ b/src/main/resources/templates/categories/newCategory.ftl @@ -1,13 +1,13 @@ <html> <head> - <#import "../header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster"/> <@header.style "spectrum"/> <@header.style "categories"/> <#import "/spring.ftl" as s> </head> <body class="budgetmaster-blue-light"> - <#import "../navbar.ftl" as navbar> + <#import "../helpers/navbar.ftl" as navbar> <@navbar.navbar "categories"/> <#import "categoriesFunctions.ftl" as categoriesFunctions> @@ -20,7 +20,7 @@ </div> </div> <div class="container"> - <#import "../validation.ftl" as validation> + <#import "../helpers/validation.ftl" as validation> <form name="NewCategory" action="<@s.url '/categories/newCategory'/>" method="post"> <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> <input type="hidden" name="ID" value="<#if category.getID()??>${category.getID()?c}</#if>"> @@ -95,7 +95,7 @@ </main> <!-- Scripts--> - <#import "../scripts.ftl" as scripts> + <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> <script src="<@s.url '/js/spectrum.js'/>"></script> <script src="<@s.url '/js/categories.js'/>"></script> diff --git a/src/main/resources/templates/error/403.ftl b/src/main/resources/templates/error/403.ftl index 2524ea66a..16b4bc82f 100644 --- a/src/main/resources/templates/error/403.ftl +++ b/src/main/resources/templates/error/403.ftl @@ -1,6 +1,6 @@ <html> <head> - <#import "../header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster - 403"/> <@header.style "login"/> <#import "/spring.ftl" as s> diff --git a/src/main/resources/templates/error/404.ftl b/src/main/resources/templates/error/404.ftl index 2df2e4dc7..ac3f84a12 100644 --- a/src/main/resources/templates/error/404.ftl +++ b/src/main/resources/templates/error/404.ftl @@ -1,6 +1,6 @@ <html> <head> - <#import "../header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster - 404"/> <@header.style "login"/> <#import "/spring.ftl" as s> diff --git a/src/main/resources/templates/error/418.ftl b/src/main/resources/templates/error/418.ftl index 98348de91..df734f8f1 100644 --- a/src/main/resources/templates/error/418.ftl +++ b/src/main/resources/templates/error/418.ftl @@ -1,6 +1,6 @@ <html> <head> - <#import "../header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster - 418"/> <@header.style "login"/> <#import "/spring.ftl" as s> @@ -32,7 +32,7 @@ </main> <!-- Scripts--> - <#import "../scripts.ftl" as scripts> + <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/error/500.ftl b/src/main/resources/templates/error/500.ftl index 87e94e37b..41b417ad7 100644 --- a/src/main/resources/templates/error/500.ftl +++ b/src/main/resources/templates/error/500.ftl @@ -1,6 +1,6 @@ <html> <head> - <#import "../header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster - 500"/> <@header.style "login"/> <#import "/spring.ftl" as s> @@ -30,7 +30,7 @@ </main> <!-- Scripts--> - <#import "../scripts.ftl" as scripts> + <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/datePicker.ftl b/src/main/resources/templates/helpers/datePicker.ftl similarity index 100% rename from src/main/resources/templates/datePicker.ftl rename to src/main/resources/templates/helpers/datePicker.ftl diff --git a/src/main/resources/templates/header.ftl b/src/main/resources/templates/helpers/header.ftl similarity index 100% rename from src/main/resources/templates/header.ftl rename to src/main/resources/templates/helpers/header.ftl diff --git a/src/main/resources/templates/navbar.ftl b/src/main/resources/templates/helpers/navbar.ftl similarity index 100% rename from src/main/resources/templates/navbar.ftl rename to src/main/resources/templates/helpers/navbar.ftl diff --git a/src/main/resources/templates/notification.ftl b/src/main/resources/templates/helpers/notification.ftl similarity index 100% rename from src/main/resources/templates/notification.ftl rename to src/main/resources/templates/helpers/notification.ftl diff --git a/src/main/resources/templates/scripts.ftl b/src/main/resources/templates/helpers/scripts.ftl similarity index 100% rename from src/main/resources/templates/scripts.ftl rename to src/main/resources/templates/helpers/scripts.ftl diff --git a/src/main/resources/templates/validation.ftl b/src/main/resources/templates/helpers/validation.ftl similarity index 100% rename from src/main/resources/templates/validation.ftl rename to src/main/resources/templates/helpers/validation.ftl diff --git a/src/main/resources/templates/index.ftl b/src/main/resources/templates/index.ftl index e17d5c934..9801f7ac9 100644 --- a/src/main/resources/templates/index.ftl +++ b/src/main/resources/templates/index.ftl @@ -1,11 +1,11 @@ <html> <head> - <#import "header.ftl" as header> + <#import "helpers/header.ftl" as header> <@header.header "BudgetMaster"/> <#import "/spring.ftl" as s> </head> <body class="budgetmaster-blue-light"> - <#import "navbar.ftl" as navbar> + <#import "helpers/navbar.ftl" as navbar> <@navbar.navbar "home"/> <main> @@ -82,7 +82,7 @@ </main> <!-- Scripts--> - <#import "scripts.ftl" as scripts> + <#import "helpers/scripts.ftl" as scripts> <@scripts.scripts/> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/login.ftl b/src/main/resources/templates/login.ftl index 3b775de69..aed68a908 100644 --- a/src/main/resources/templates/login.ftl +++ b/src/main/resources/templates/login.ftl @@ -1,6 +1,6 @@ <html> <head> - <#import "header.ftl" as header> + <#import "helpers/header.ftl" as header> <@header.header "BudgetMaster"/> <@header.style "login"/> <#import "/spring.ftl" as s> @@ -66,7 +66,7 @@ </main> <!-- Scripts--> - <#import "scripts.ftl" as scripts> + <#import "helpers/scripts.ftl" as scripts> <@scripts.scripts/> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/comingSoon.ftl b/src/main/resources/templates/placeholder/comingSoon.ftl similarity index 78% rename from src/main/resources/templates/comingSoon.ftl rename to src/main/resources/templates/placeholder/comingSoon.ftl index 755e964d7..33ea19ef6 100644 --- a/src/main/resources/templates/comingSoon.ftl +++ b/src/main/resources/templates/placeholder/comingSoon.ftl @@ -1,10 +1,10 @@ <html> <head> - <#import "header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster"/> </head> <body class="budgetmaster-blue-light"> - <#import "navbar.ftl" as navbar> + <#import "../helpers/navbar.ftl" as navbar> <@navbar.navbar active/> <main> @@ -18,7 +18,7 @@ </main> <!-- Scripts--> - <#import "scripts.ftl" as scripts> + <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/emptyPage.ftl b/src/main/resources/templates/placeholder/emptyPage.ftl similarity index 58% rename from src/main/resources/templates/emptyPage.ftl rename to src/main/resources/templates/placeholder/emptyPage.ftl index 850fa1514..ddb867436 100644 --- a/src/main/resources/templates/emptyPage.ftl +++ b/src/main/resources/templates/placeholder/emptyPage.ftl @@ -1,14 +1,14 @@ <html> <head> - <#import "header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster"/> </head> <body class="budgetmaster-blue-light"> - <#import "navbar.ftl" as navbar> + <#import "../helpers/navbar.ftl" as navbar> <@navbar.navbar active/> <!-- Scripts--> - <#import "scripts.ftl" as scripts> + <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/reports/reports.ftl b/src/main/resources/templates/reports/reports.ftl index 346346880..f169c957e 100644 --- a/src/main/resources/templates/reports/reports.ftl +++ b/src/main/resources/templates/reports/reports.ftl @@ -1,16 +1,16 @@ <html> <head> - <#import "../header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster"/> <#import "/spring.ftl" as s> </head> <body class="budgetmaster-blue-light"> - <#import "../navbar.ftl" as navbar> + <#import "../helpers/navbar.ftl" as navbar> <@navbar.navbar "reports"/> <main> <div class="card main-card background-color"> - <#import "../datePicker.ftl" as datePicker> + <#import "../helpers/datePicker.ftl" as datePicker> <@datePicker.datePicker currentDate springMacroRequestContext.getRequestUri()/> <div class="container"> <div class="row"> @@ -28,7 +28,7 @@ </main> <!-- Scripts--> - <#import "../scripts.ftl" as scripts> + <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> <script src="<@s.url '/js/datePicker.js'/>"></script> <script>document.cookie = "currentDate=${helpers.getDateString(currentDate)}";</script> diff --git a/src/main/resources/templates/import.ftl b/src/main/resources/templates/settings/import.ftl similarity index 94% rename from src/main/resources/templates/import.ftl rename to src/main/resources/templates/settings/import.ftl index 602e7b240..991b282ec 100644 --- a/src/main/resources/templates/import.ftl +++ b/src/main/resources/templates/settings/import.ftl @@ -1,11 +1,11 @@ <html> <head> - <#import "header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster"/> <#import "/spring.ftl" as s> </head> <body class="budgetmaster-blue-light"> - <#import "navbar.ftl" as navbar> + <#import "../helpers/navbar.ftl" as navbar> <@navbar.navbar "settings"/> <main> @@ -17,7 +17,7 @@ </div> </div> <div class="container"> - <#import "validation.ftl" as validation> + <#import "../helpers/validation.ftl" as validation> <form name="Import" action="<@s.url '/settings/database/import'/>" method="post" onsubmit="return validateForm()"> <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> @@ -70,7 +70,7 @@ </main> <!-- Scripts--> - <#import "scripts.ftl" as scripts> + <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> <script src="<@s.url '/js/import.js'/>"></script> </body> diff --git a/src/main/resources/templates/settings.ftl b/src/main/resources/templates/settings/settings.ftl similarity index 98% rename from src/main/resources/templates/settings.ftl rename to src/main/resources/templates/settings/settings.ftl index 655d4da73..15b31ee9e 100644 --- a/src/main/resources/templates/settings.ftl +++ b/src/main/resources/templates/settings/settings.ftl @@ -1,11 +1,11 @@ <html> <head> - <#import "header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster"/> <#import "/spring.ftl" as s> </head> <body class="budgetmaster-blue-light"> - <#import "navbar.ftl" as navbar> + <#import "../helpers/navbar.ftl" as navbar> <@navbar.navbar "settings"/> <main> @@ -16,7 +16,7 @@ </div> </div> <div class="container"> - <#import "validation.ftl" as validation> + <#import "../helpers/validation.ftl" as validation> <form name="Settings" action="<@s.url '/settings/save'/>" method="post"> <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> <input type="hidden" name="ID" value="${settings.getID()?c}"> @@ -257,7 +257,7 @@ </#if> <!-- Scripts--> - <#import "scripts.ftl" as scripts> + <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> <script src="<@s.url '/js/spectrum.js'/>"></script> <script src="<@s.url '/js/settings.js'/>"></script> diff --git a/src/main/resources/templates/transactions/newTransaction.ftl b/src/main/resources/templates/transactions/newTransaction.ftl index e928ac176..2b8a49b75 100644 --- a/src/main/resources/templates/transactions/newTransaction.ftl +++ b/src/main/resources/templates/transactions/newTransaction.ftl @@ -1,6 +1,6 @@ <html> <head> - <#import "../header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster"/> <@header.style "transactions"/> <@header.style "datepicker"/> @@ -8,7 +8,7 @@ <#import "/spring.ftl" as s> </head> <body class="budgetmaster-blue-light"> - <#import "../navbar.ftl" as navbar> + <#import "../helpers/navbar.ftl" as navbar> <@navbar.navbar "transactions"/> <#import "../categories/categoriesFunctions.ftl" as categoriesFunctions> @@ -21,7 +21,7 @@ </div> </div> <div class="container"> - <#import "../validation.ftl" as validation> + <#import "../helpers/validation.ftl" as validation> <form name="NewTransaction" action="<@s.url '/transactions/newTransaction'/>" method="post" onsubmit="return validateForm()"> <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> <input type="hidden" name="ID" value="<#if transaction.getID()??>${transaction.getID()?c}</#if>"> @@ -344,7 +344,7 @@ </main> <!-- Pass localization to JS --> - <#import "../datePicker.ftl" as datePicker> + <#import "../helpers/datePicker.ftl" as datePicker> <@datePicker.datePickerLocalization/> <script> startDate = "${startDate}".split("."); @@ -377,7 +377,7 @@ </script> <!-- Scripts--> - <#import "../scripts.ftl" as scripts> + <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> <script src="<@s.url '/js/spectrum.js'/>"></script> <script src="<@s.url '/js/transactions.js'/>"></script> diff --git a/src/main/resources/templates/transactions/transactions.ftl b/src/main/resources/templates/transactions/transactions.ftl index 5a87a362b..e0d814ade 100644 --- a/src/main/resources/templates/transactions/transactions.ftl +++ b/src/main/resources/templates/transactions/transactions.ftl @@ -1,17 +1,17 @@ <html> <head> - <#import "../header.ftl" as header> + <#import "../helpers/header.ftl" as header> <@header.header "BudgetMaster"/> <@header.style "categories"/> <#import "/spring.ftl" as s> </head> <body class="budgetmaster-blue-light"> - <#import "../navbar.ftl" as navbar> + <#import "../helpers/navbar.ftl" as navbar> <@navbar.navbar "transactions"/> <main> <div class="card main-card background-color"> - <#import "../datePicker.ftl" as datePicker> + <#import "../helpers/datePicker.ftl" as datePicker> <@datePicker.datePicker currentDate springMacroRequestContext.getRequestUri()/> <div class="container"> <div class="row"> @@ -111,7 +111,7 @@ </main> <!-- Scripts--> - <#import "../scripts.ftl" as scripts> + <#import "../helpers/scripts.ftl" as scripts> <@scripts.scripts/> <script src="<@s.url '/js/transactions.js'/>"></script> <script src="<@s.url '/js/datePicker.js'/>"></script> -- GitLab