From e89832c3aa8f52ea4b75a87fc7c24cfef3f79d95 Mon Sep 17 00:00:00 2001 From: kriddles <54413450+kriddles@users.noreply.github.com> Date: Thu, 19 Dec 2019 13:07:13 -0600 Subject: [PATCH] Check for Price Tracking in mealplan.js (#469) --- public/viewjs/mealplan.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/public/viewjs/mealplan.js b/public/viewjs/mealplan.js index 9c987d07..d8e1cedc 100644 --- a/public/viewjs/mealplan.js +++ b/public/viewjs/mealplan.js @@ -39,7 +39,12 @@ var calendar = $("#calendar").fullCalendar({ var weekRecipeConsumeButtonHtml = ""; if (weekRecipe !== null) { - weekCosts = FindObjectInArrayByPropertyValue(recipesResolved, "recipe_id", weekRecipe.id).costs; + var weekCostsHtml = ""; + if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) + { + weekCosts = FindObjectInArrayByPropertyValue(recipesResolved, "recipe_id", weekRecipe.id).costs; + weekCostsHtml = __t("Week costs") + ': ' + weekCosts.toString() + " "; + } var weekRecipeOrderMissingButtonDisabledClasses = ""; if (FindObjectInArrayByPropertyValue(recipesResolved, "recipe_id", weekRecipe.id).need_fulfilled_with_shopping_list == 1) @@ -54,7 +59,7 @@ var calendar = $("#calendar").fullCalendar({ weekRecipeOrderMissingButtonHtml = '' weekRecipeConsumeButtonHtml = '' } - $(".fc-header-toolbar .fc-center").html("