From 8b6f882edcf4d690e5b0bd1d3193342c271ff849 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Tue, 13 Jul 2021 21:24:08 +0200 Subject: [PATCH] Fixed missing FEATURE_FLAG_SHOPPINGLIST handling on /stockoverview, /mealplan and /stockentries pages (references #322) --- public/viewjs/mealplan.js | 24 +++++++++++++++++++++--- views/stockentries.blade.php | 2 ++ views/stockoverview.blade.php | 2 ++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/public/viewjs/mealplan.js b/public/viewjs/mealplan.js index f0302aa5..be5bb14f 100644 --- a/public/viewjs/mealplan.js +++ b/public/viewjs/mealplan.js @@ -65,7 +65,13 @@ var calendar = $("#calendar").fullCalendar({ { weekRecipeConsumeButtonDisabledClasses = "disabled"; } - weekRecipeOrderMissingButtonHtml = '' + + var weekRecipeOrderMissingButtonHtml = ""; + if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_SHOPPINGLIST) + { + weekRecipeOrderMissingButtonHtml = ''; + } + weekRecipeConsumeButtonHtml = '' } $(".fc-header-toolbar .fc-center").html("

" + weekCostsHtml + weekRecipeOrderMissingButtonHtml + weekRecipeConsumeButtonHtml + "

"); @@ -134,6 +140,12 @@ var calendar = $("#calendar").fullCalendar({ fulfillmentInfoHtml = ""; } + var shoppingListButtonHtml = ""; + if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_SHOPPINGLIST) + { + shoppingListButtonHtml = ''; + } + element.html('\
\ \ @@ -143,7 +155,7 @@ var calendar = $("#calendar").fullCalendar({
\ \ \ - \ + ' + shoppingListButtonHtml + ' \ \ ' + doneButtonHtml + ' \
\ @@ -220,6 +232,12 @@ var calendar = $("#calendar").fullCalendar({ costsAndCaloriesPerServing = '
' + productDetails.product.calories * mealPlanEntry.product_amount + ' kcal ' + '
'; } + var shoppingListButtonHtml = ""; + if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_SHOPPINGLIST) + { + shoppingListButtonHtml = ''; + } + element.html('\
\ \ @@ -230,7 +248,7 @@ var calendar = $("#calendar").fullCalendar({ \ \ \ - \ + ' + shoppingListButtonHtml + ' \ ' + doneButtonHtml + ' \ \
'); diff --git a/views/stockentries.blade.php b/views/stockentries.blade.php index f4894cf3..2376f27f 100644 --- a/views/stockentries.blade.php +++ b/views/stockentries.blade.php @@ -128,12 +128,14 @@