- {{ $t("empty_list") }}
+ {{ $t("empty_list") }}
@@ -362,7 +380,7 @@
:loading="units_loading"
@search-change="searchUnits"
>
- {{ $t("empty_list") }}
+ {{ $t("empty_list") }}
@@ -392,7 +410,7 @@
:loading="foods_loading"
@search-change="searchFoods"
>
- {{ $t("empty_list") }}
+ {{ $t("empty_list") }}
@@ -617,6 +635,8 @@ export default {
paste_step: undefined,
show_file_create: false,
step_for_file_create: undefined,
+ additional_visible: false,
+ create_food: undefined,
}
},
computed: {
@@ -648,6 +668,12 @@ export default {
this.recipe_changed = this.recipe_changed !== undefined
},
},
+ "recipe.name": function () {
+ this.recipe.food_name = this.recipe.name.toLowerCase()
+ },
+ "recipe.create_food": function () {
+ this.create_food = this.recipe.create_food
+ },
},
methods: {
keyboardListener: function (e) {
@@ -734,6 +760,9 @@ export default {
.then((response) => {
StandardToasts.makeStandardToast(StandardToasts.SUCCESS_UPDATE)
this.recipe_changed = false
+ if (this.create_food) {
+ apiFactory.createFood({ name: this.recipe.food_name, recipe: { id: this.recipe.id, name: this.recipe.name } })
+ }
if (view_after) {
location.href = resolveDjangoUrl("view_recipe", this.recipe_id)
}
diff --git a/vue/src/locales/en.json b/vue/src/locales/en.json
index f2dfeb44..c6d79cf9 100644
--- a/vue/src/locales/en.json
+++ b/vue/src/locales/en.json
@@ -376,5 +376,8 @@
"Keyword": "Keyword",
"Advanced": "Advanced",
"Page": "Page",
- "Reset": "Reset"
+ "Reset": "Reset",
+ "Create Food": "Create Food",
+ "create_food_desc": "Create a food and link it to this recipe.",
+ "additional_options": "Additional Options"
}