From ecc85a97801a3d662e4682847597ba7bb6aca1fe Mon Sep 17 00:00:00 2001 From: Robert Goldmann <deadlocker@gmx.de> Date: Sat, 20 Feb 2021 12:17:43 +0100 Subject: [PATCH] #563 - add icons for all modal buttons --- src/main/resources/templates/accounts/accounts.ftl | 4 ++-- src/main/resources/templates/categories/categories.ftl | 4 ++-- src/main/resources/templates/charts/manage.ftl | 2 +- src/main/resources/templates/filter/filterMacros.ftl | 4 ++-- src/main/resources/templates/helpers/globalDatePicker.ftl | 4 ++-- src/main/resources/templates/helpers/header.ftl | 6 +++--- src/main/resources/templates/helpers/navbar.ftl | 4 ++-- src/main/resources/templates/templates/templates.ftl | 2 +- src/main/resources/templates/transactions/transactions.ftl | 2 +- src/main/resources/templates/whatsNewModal.ftl | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/resources/templates/accounts/accounts.ftl b/src/main/resources/templates/accounts/accounts.ftl index 604721dd3..449262113 100644 --- a/src/main/resources/templates/accounts/accounts.ftl +++ b/src/main/resources/templates/accounts/accounts.ftl @@ -56,7 +56,7 @@ </main> <#if currentAccount??> - <@header.modalConfirmDelete title=locale.getString("info.title.account.delete") confirmUrl='/accounts' cancelUrlBase="/accounts" itemId=currentAccount.getID() confirmButtonText=locale.getString("info.button.account.delete")> + <@header.modalConfirmDelete title=locale.getString("info.title.account.delete") confirmUrl='/accounts' cancelUrlBase="/accounts" itemId=currentAccount.getID() confirmButtonTextKey="info.button.account.delete"> <p>${locale.getString("info.text.account.delete", currentAccount.getName(), currentAccount.getReferringTransactions()?size)}</p> </@header.modalConfirmDelete> </#if> @@ -69,7 +69,7 @@ <p>${locale.getString("warning.text.account.delete", currentAccount.getName())}</p> </div> <div class="modal-footer background-color"> - <a href="<@s.url '/accounts'/>" class="modal-action modal-close waves-effect waves-light green btn-flat white-text">${locale.getString("ok")}</a> + <@header.buttonLink url='/accounts' icon='done' localizationKey='ok' color='green' id='buttonCloseWhatsNew' classes='modal-action modal-close text-white'/> </div> </div> </#if> diff --git a/src/main/resources/templates/categories/categories.ftl b/src/main/resources/templates/categories/categories.ftl index 7e1ce1490..200d46b6b 100644 --- a/src/main/resources/templates/categories/categories.ftl +++ b/src/main/resources/templates/categories/categories.ftl @@ -74,8 +74,8 @@ </div> <div class="modal-footer background-color"> - <a href="<@s.url '/categories'/>" class="modal-action modal-close waves-effect waves-light red btn-flat white-text">${locale.getString("cancel")}</a> - <a id="buttonDeleteCategory" class="modal-action modal-close waves-effect waves-light green btn-flat white-text">${locale.getString("delete")}</a> + <@header.buttonLink url='/categories' icon='clear' localizationKey='cancel' color='red' classes='modal-action modal-close text-white'/> + <@header.buttonLink url='' icon='delete' localizationKey='delete' color='green' id='buttonDeleteCategory' classes='modal-action modal-close text-white' noUrl=true/> </div> </div> </#if> diff --git a/src/main/resources/templates/charts/manage.ftl b/src/main/resources/templates/charts/manage.ftl index 5538a6428..9a3aa8501 100644 --- a/src/main/resources/templates/charts/manage.ftl +++ b/src/main/resources/templates/charts/manage.ftl @@ -57,7 +57,7 @@ </div> <#if currentChart??> - <@header.modalConfirmDelete title=locale.getString("info.title.chart.delete") confirmUrl='/charts/manage' cancelUrlBase='/charts' itemId=currentChart.getID() confirmButtonText=locale.getString("info.title.chart.delete")> + <@header.modalConfirmDelete title=locale.getString("info.title.chart.delete") confirmUrl='/charts/manage' cancelUrlBase='/charts' itemId=currentChart.getID() confirmButtonTextKey='info.title.chart.delete'> <p>${locale.getString("info.text.chart.delete", currentChart.getName())}</p> </@header.modalConfirmDelete> </#if> diff --git a/src/main/resources/templates/filter/filterMacros.ftl b/src/main/resources/templates/filter/filterMacros.ftl index 740437698..35f871588 100644 --- a/src/main/resources/templates/filter/filterMacros.ftl +++ b/src/main/resources/templates/filter/filterMacros.ftl @@ -90,7 +90,7 @@ </form> </div> <div class="modal-footer background-color"> - <a href="" class="modal-action modal-close waves-effect waves-light red btn-flat white-text">${locale.getString("cancel")}</a> + <@header.buttonLink url='' icon='clear' localizationKey='cancel' color='red' classes='modal-action modal-close text-white'/> </div> </div> </#macro> @@ -103,7 +103,7 @@ <@buttonsCharts/> </div> <div class="modal-footer background-color"> - <a class="modal-action modal-close waves-effect waves-light red btn-flat white-text">${locale.getString("cancel")}</a> + <@header.buttonLink url='' icon='clear' localizationKey='cancel' color='red' classes='modal-action modal-close text-white'/> </div> </div> </#macro> diff --git a/src/main/resources/templates/helpers/globalDatePicker.ftl b/src/main/resources/templates/helpers/globalDatePicker.ftl index a6f23cffa..38c9c8c5a 100644 --- a/src/main/resources/templates/helpers/globalDatePicker.ftl +++ b/src/main/resources/templates/helpers/globalDatePicker.ftl @@ -25,8 +25,8 @@ </div> </div> <div class="modal-footer background-color"> - <a href="#" class="modal-action modal-close waves-effect waves-light red btn-flat white-text">${locale.getString("cancel")}</a> - <a href="<@s.url '/setDate?target=${target}'/>" id="buttonChooseDate" class="modal-action modal-close waves-effect waves-light green btn-flat white-text">${locale.getString("ok")}</a> + <@header.buttonLink url='' icon='clear' localizationKey='cancel' color='red' classes='modal-action modal-close text-white'/> + <@header.buttonLink url='/setDate?target=' + target icon='done' localizationKey='ok' color='green' id='buttonChooseDate' classes='modal-action modal-close text-white' noUrl=true/> </div> </div> </#macro> diff --git a/src/main/resources/templates/helpers/header.ftl b/src/main/resources/templates/helpers/header.ftl index e16b6d2fb..28b2859bd 100644 --- a/src/main/resources/templates/helpers/header.ftl +++ b/src/main/resources/templates/helpers/header.ftl @@ -40,7 +40,7 @@ </#if> </#macro> -<#macro modalConfirmDelete title confirmUrl cancelUrlBase itemId confirmButtonText id="modalConfirmDelete" classes=""> +<#macro modalConfirmDelete title confirmUrl cancelUrlBase itemId confirmButtonTextKey id="modalConfirmDelete" classes=""> <div id="${id}" class="modal background-color ${classes}"> <div class="modal-content"> <h4>${title}</h4> @@ -48,8 +48,8 @@ <#nested> </div> <div class="modal-footer background-color"> - <a href="<@s.url confirmUrl/>" class="modal-action modal-close waves-effect waves-light red btn-flat white-text">${locale.getString("cancel")}</a> - <a href="<@s.url cancelUrlBase + "/" + itemId?c + "/delete" />" class="modal-action modal-close waves-effect waves-light green btn-flat white-text">${confirmButtonText}</a> + <@buttonLink url=confirmUrl icon='clear' localizationKey='cancel' color='red' classes='modal-action modal-close text-white'/> + <@buttonLink url=cancelUrlBase + '/' + itemId?c + '/delete' icon='delete' localizationKey=confirmButtonTextKey color='green' classes='modal-action modal-close text-white'/> </div> </div> </#macro> diff --git a/src/main/resources/templates/helpers/navbar.ftl b/src/main/resources/templates/helpers/navbar.ftl index cea30f735..2fbbcf568 100644 --- a/src/main/resources/templates/helpers/navbar.ftl +++ b/src/main/resources/templates/helpers/navbar.ftl @@ -148,8 +148,8 @@ <p>${locale.getString("info.text.backup.reminder")}</p> </div> <div class="modal-footer background-color"> - <a href="<@s.url '/backupReminder/cancel'/>" id="buttonCloseReminder" class="modal-action modal-close waves-effect waves-light red btn-flat white-text">${locale.getString("cancel")}</a> - <a href="<@s.url '/backupReminder/settings'/>" class="modal-action modal-close waves-effect waves-light green btn-flat white-text">${locale.getString("info.button.backup.reminder")}</a> + <@header.buttonLink url='/backupReminder/cancel' icon='clear' localizationKey='cancel' color='red' id='buttonCloseReminder' classes='modal-action modal-close text-white'/> + <@header.buttonLink url='/backupReminder/settings' icon='cogs' localizationKey='cancel' color='green' id='buttonCloseReminder' classes='info.button.backup.reminder'/> </div> </div> </#if> diff --git a/src/main/resources/templates/templates/templates.ftl b/src/main/resources/templates/templates/templates.ftl index eadd163bc..7697670af 100644 --- a/src/main/resources/templates/templates/templates.ftl +++ b/src/main/resources/templates/templates/templates.ftl @@ -41,7 +41,7 @@ </div> <#if currentTemplate??> - <@header.modalConfirmDelete title=locale.getString("info.title.template.delete") confirmUrl='/templates' cancelUrlBase='/templates' itemId=currentTemplate.getID() confirmButtonText=locale.getString("info.title.template.delete")> + <@header.modalConfirmDelete title=locale.getString("info.title.template.delete") confirmUrl='/templates' cancelUrlBase='/templates' itemId=currentTemplate.getID() confirmButtonTextKey='info.title.template.delete'> <p>${locale.getString("info.text.template.delete", currentTemplate.getTemplateName())}</p> </@header.modalConfirmDelete> </#if> diff --git a/src/main/resources/templates/transactions/transactions.ftl b/src/main/resources/templates/transactions/transactions.ftl index 8b90c30ea..5784e5a4f 100644 --- a/src/main/resources/templates/transactions/transactions.ftl +++ b/src/main/resources/templates/transactions/transactions.ftl @@ -88,7 +88,7 @@ </div> <#if currentTransaction??> - <@header.modalConfirmDelete title=locale.getString("info.title.transaction.delete") confirmUrl='/transactions' cancelUrlBase='/transactions' itemId=currentTransaction.getID() confirmButtonText=locale.getString("delete")> + <@header.modalConfirmDelete title=locale.getString("info.title.transaction.delete") confirmUrl='/transactions' cancelUrlBase='/transactions' itemId=currentTransaction.getID() confirmButtonTextKey='delete'> <#if currentTransaction.isRepeating()> <p>${locale.getString("info.text.transaction.repeating.delete", currentTransaction.name)}</p> <#else> diff --git a/src/main/resources/templates/whatsNewModal.ftl b/src/main/resources/templates/whatsNewModal.ftl index 93a3abdc8..1619f3297 100644 --- a/src/main/resources/templates/whatsNewModal.ftl +++ b/src/main/resources/templates/whatsNewModal.ftl @@ -35,7 +35,7 @@ </div> </div> <div class="modal-footer background-color"> - <@header.buttonLink url='/about/whatsNewModal/close' icon='done' localizationKey='ok' id='buttonCloseWhatsNew' classes='modal-action modal-close green text-white'/> + <@header.buttonLink url='/about/whatsNewModal/close' icon='done' localizationKey='ok' color='green' id='buttonCloseWhatsNew' classes='modal-action modal-close text-white'/> </div> </div> -- GitLab