diff --git a/vue/src/components/RecipeContextMenu.vue b/vue/src/components/RecipeContextMenu.vue
index 1bd7531ec..ce2bbfb89 100644
--- a/vue/src/components/RecipeContextMenu.vue
+++ b/vue/src/components/RecipeContextMenu.vue
@@ -31,6 +31,9 @@
{{ $t("Print") }}
+
+
+
{{ $t("Export") }}
@@ -202,6 +205,22 @@ export default {
addToShopping() {
this.$bvModal.show(`shopping_${this.modal_id}`)
},
+ copyToNew: function () {
+ let recipename = window.prompt(this.$t("copy_to_new"), this.$t("recipe_name"))
+ let apiClient = new ApiApiFactory()
+ apiClient.retrieveRecipe(this.recipe.id).then((results) => {
+ apiClient
+ .createRecipe({ ...results.data, ...{ id: undefined, name: recipename } })
+ .then((newrecipe) => {
+ console.log(newrecipe.data, this.resolveDjangoUrl("view_recipe", newrecipe.data.id))
+ StandardToasts.makeStandardToast(StandardToasts.SUCCESS_CREATE)
+ window.open(this.resolveDjangoUrl("view_recipe", newrecipe.data.id))
+ })
+ .catch((error) => {
+ StandardToasts.makeStandardToast(StandardToasts.FAIL_CREATE)
+ })
+ })
+ },
},
}
diff --git a/vue/src/locales/en.json b/vue/src/locales/en.json
index 9bf72a48c..d941bfef3 100644
--- a/vue/src/locales/en.json
+++ b/vue/src/locales/en.json
@@ -296,5 +296,7 @@
"food_recipe_help": "Linking a recipe here will include the linked recipe in any other recipe that use this food",
"Foods": "Foods",
"review_shopping": "Review shopping entries before saving",
- "view_recipe": "View Recipe"
+ "view_recipe": "View Recipe",
+ "copy_to_new": "Copy To New Recipe",
+ "recipe_name": "Recipe Name"
}