From 3608eec8fbe75a89d260d7cba2eabd8759214d72 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Tue, 17 Aug 2021 18:05:32 +0200 Subject: [PATCH] Fixed FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS clear shopping list confirm message handling (fixes #1315) --- localization/strings.pot | 3 +++ public/viewjs/shoppinglist.js | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/localization/strings.pot b/localization/strings.pot index 23a70624..aaf2574e 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -2244,3 +2244,6 @@ msgstr "" msgid "Section" msgstr "" + +msgid "Are you sure to empty the shopping list?" +msgstr "" diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index 50ef1b74..ec1ae1f9 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -195,8 +195,14 @@ $(document).on('click', '#add-overdue-expired-products', function(e) $(document).on('click', '#clear-shopping-list', function(e) { + var confirmMessage = __t('Are you sure to empty shopping list "%s"?', $("#selected-shopping-list option:selected").text()); + if (!BoolVal(Grocy.FeatureFlags.GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS)) + { + confirmMessage = __t('Are you sure to empty the shopping list?'); + } + bootbox.confirm({ - message: __t('Are you sure to empty shopping list "%s"?', $("#selected-shopping-list option:selected").text()), + message: confirmMessage, closeButton: false, buttons: { confirm: {