1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-27 17:19:40 +02:00

feature/recipe-patch-improvements (#382)

* automated docs update

* recipe rating component

* recipe partial updates - closes #25

* use Vue.delete to update store

* format

* arrow functions

* fix tests

* format

* initial context menu

* localize

* add confirmation dialog

* context menu

* fix bare exception

* update line length

* format all file with prettier

* update changelog

* download as json

* update python dependencies

* update javascript dependencies

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden 2021-05-01 20:46:02 -08:00 committed by GitHub
parent c196445e61
commit be378cb20c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
121 changed files with 18942 additions and 4765 deletions

View file

@ -1,23 +1,10 @@
<template>
<v-container>
<v-card
v-if="skeleton"
:color="`white ${theme.isDark ? 'darken-2' : 'lighten-4'}`"
class="pa-3"
>
<v-skeleton-loader
class="mx-auto"
height="700px"
type="card"
></v-skeleton-loader>
<v-card v-if="skeleton" :color="`white ${theme.isDark ? 'darken-2' : 'lighten-4'}`" class="pa-3">
<v-skeleton-loader class="mx-auto" height="700px" type="card"></v-skeleton-loader>
</v-card>
<v-card v-else id="myRecipe">
<v-img
height="400"
:src="getImage(recipeDetails.slug)"
class="d-print-none"
:key="imageKey"
>
<v-img height="400" :src="getImage(recipeDetails.slug)" class="d-print-none" :key="imageKey">
<RecipeTimeCard
class="force-bottom"
:prepTime="recipeDetails.prepTime"
@ -62,12 +49,7 @@
height="1500px"
:options="jsonEditorOptions"
/>
<RecipeEditor
v-else
v-model="recipeDetails"
ref="recipeEditor"
@upload="getImageFile"
/>
<RecipeEditor v-else v-model="recipeDetails" ref="recipeEditor" @upload="getImageFile" />
</v-card>
</v-container>
</template>
@ -80,7 +62,6 @@ import RecipeEditor from "@/components/Recipe/RecipeEditor";
import RecipeTimeCard from "@/components/Recipe/RecipeTimeCard.vue";
import EditorButtonRow from "@/components/Recipe/EditorButtonRow";
import { user } from "@/mixins/user";
import store from "@/store";
import { router } from "@/routes";
export default {
@ -100,7 +81,6 @@ export default {
data() {
return {
skeleton: true,
// currentRecipe: this.$route.params.recipe,
form: false,
jsonEditor: false,
jsonEditorOptions: {
@ -130,6 +110,8 @@ export default {
},
mounted() {
this.getRecipeDetails();
this.jsonEditor = false;
this.form = this.$route.query.edit === "true" && this.loggedIn;
},
watch: {
@ -142,6 +124,9 @@ export default {
currentRecipe() {
return this.$route.params.recipe;
},
edit() {
return true;
},
showIcons() {
return this.form;
},
@ -161,7 +146,6 @@ export default {
async getRecipeDetails() {
this.recipeDetails = await api.recipes.requestDetails(this.currentRecipe);
this.skeleton = false;
this.form = false;
},
getImage(image) {
if (image) {
@ -171,7 +155,6 @@ export default {
async deleteRecipe() {
let response = await api.recipes.delete(this.recipeDetails.slug);
if (response) {
store.dispatch("requestRecentRecipes");
router.push(`/`);
}
},
@ -203,10 +186,6 @@ export default {
}
}
},
showForm() {
this.form = true;
this.jsonEditor = false;
},
},
};
</script>
@ -229,4 +208,4 @@ export default {
top: 0;
z-index: 2;
}
</style>
</style>