From a0741f6ad32ccd4fc00b5399922c9cc0d5ba7aab Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 19 Jan 2021 20:55:51 +0100 Subject: [PATCH] added warning message to meal plan if no type is given --- cookbook/templates/meal_plan.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cookbook/templates/meal_plan.html b/cookbook/templates/meal_plan.html index 123b1dacf..17cd1678c 100644 --- a/cookbook/templates/meal_plan.html +++ b/cookbook/templates/meal_plan.html @@ -21,8 +21,6 @@ {% block content %}
- -
@@ -461,6 +459,10 @@ for (let mte of this.meal_types_edit) { this.$set(mte, 'delete', false) } + + if (this.meal_types.length === 0){ + this.makeToast(gettext('Information'), gettext('To use the meal plan please first create at least one meal plan type.'), 'warning') + } }).catch((err) => { console.log("getPlanTypes error: ", err); this.makeToast(gettext('Error'), gettext('There was an error loading a resource!') + err.bodyText, 'danger')