mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-19 05:09:40 +02:00
fix(backend): 🐛 Fix recipe page issues (#778)
* fix(backend): 🐛 Fix favorite assignment on backend * fix(frontend): 🐛 fix printer button on recipe page * style(frontend): 🚸 add user feadback on copy of recipe link * fix(frontend): 🐛 Fix enableLandscape incorrect bindings to remove duplicate values * feat(frontend): ✨ add ingredient copy button for markdown list -[ ] format * feat(frontend): ✨ add remove prefix button to bulk entry * fix(frontend): 🐛 disable random button when no recipes are present * fix(frontend): ✨ fix .zip download error * fix(frontend): 🚸 close image dialog on upload/get * fix(frontend): 🐛 fix assignment on creation for categories and tags * feat(frontend): ✨ Open editor on creation / fix edit button on main screen * fix(frontend): 🐛 fix false negative regex match for urls on creationg page * feat(frontend): 🚸 provide better user feadback when recipe exists * feat(frontend): ✨ lock bulk importer on submit * remove zip from navigation * fix(frontend): ✨ rerender recipes on delete Co-authored-by: Hayden K <hay-kot@pm.me>
This commit is contained in:
parent
ec3b53cdc3
commit
9f8c61a75a
27 changed files with 323 additions and 163 deletions
|
@ -1,6 +1,9 @@
|
|||
<template>
|
||||
<div v-if="value && value.length > 0">
|
||||
<h2 class="mb-4">{{ $t("recipe.ingredients") }}</h2>
|
||||
<div class="d-flex justify-start">
|
||||
<h2 class="mb-4 mt-1">{{ $t("recipe.ingredients") }}</h2>
|
||||
<AppButtonCopy btn-class="ml-auto" :copy-text="ingredientCopyText" />
|
||||
</div>
|
||||
<div>
|
||||
<div v-for="(ingredient, index) in value" :key="'ingredient' + index">
|
||||
<h3 v-if="showTitleEditor[index]" class="mt-2">{{ ingredient.title }}</h3>
|
||||
|
@ -18,9 +21,10 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { computed, defineComponent } from "@nuxtjs/composition-api";
|
||||
import VueMarkdown from "@adapttive/vue-markdown";
|
||||
import { useFraction } from "@/composables/use-fraction";
|
||||
export default {
|
||||
export default defineComponent({
|
||||
components: {
|
||||
VueMarkdown,
|
||||
},
|
||||
|
@ -65,7 +69,16 @@ export default {
|
|||
return `${return_qty} ${unit?.name || " "} ${food?.name || " "} ${note}`;
|
||||
}
|
||||
|
||||
return { parseIngredientText };
|
||||
const ingredientCopyText = computed(() => {
|
||||
// Returns a string of all ingredients in markdown list format -[ ]
|
||||
return props.value
|
||||
.map((ingredient) => {
|
||||
return `- [ ] ${parseIngredientText(ingredient)}`;
|
||||
})
|
||||
.join("\n");
|
||||
});
|
||||
|
||||
return { parseIngredientText, ingredientCopyText };
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -101,7 +114,7 @@ export default {
|
|||
this.$set(this.showTitleEditor, index, newVal);
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue