diff --git a/vue/src/apps/CookbookView/CookbookView.vue b/vue/src/apps/CookbookView/CookbookView.vue index d6af230b5..32284f604 100644 --- a/vue/src/apps/CookbookView/CookbookView.vue +++ b/vue/src/apps/CookbookView/CookbookView.vue @@ -22,7 +22,7 @@ -
+
- +
diff --git a/vue/src/components/CookbookSlider.vue b/vue/src/components/CookbookSlider.vue index b9ace64f4..8449f8de0 100644 --- a/vue/src/components/CookbookSlider.vue +++ b/vue/src/components/CookbookSlider.vue @@ -19,11 +19,12 @@
+ v-on:editing="cookbook_editing = $event" + v-on:refresh="$emit('refresh')"> + v-if="current_page > 1" :key="display_recipes[0].recipe">
@@ -31,9 +32,10 @@ - + + v-if="current_page > 1 && display_recipes.length === 2" + :key="display_recipes[1].recipe">
@@ -50,6 +52,7 @@ import CookbookEditCard from "./CookbookEditCard"; import CookbookToc from "./CookbookToc"; import Vue2TouchEvents from "vue2-touch-events" import Vue from "vue"; +import {ApiApiFactory} from "../utils/openapi/api"; Vue.use(Vue2TouchEvents) @@ -82,6 +85,18 @@ export default { pageChange: function (page) { this.current_page = page this.display_recipes = this.recipes.slice(((this.current_page - 1) - 1) * 2, (this.current_page - 1) * 2) + this.loadRecipeDetails(page) + }, + loadRecipeDetails: function (page) { + this.display_recipes.forEach((recipe, index) => { + let apiClient = new ApiApiFactory() + + apiClient.retrieveRecipe(recipe.recipe).then(result => { + let new_entry = Object.assign({}, recipe); + new_entry.recipe_content = result.data + this.$set(this.display_recipes, index, new_entry) + }) + }) }, swipeLeft: function () { if (this.cookbook_editing) { diff --git a/vue/src/components/RecipeCard.vue b/vue/src/components/RecipeCard.vue index b8c18554b..fc27d5504 100644 --- a/vue/src/components/RecipeCard.vue +++ b/vue/src/components/RecipeCard.vue @@ -44,20 +44,22 @@

-
-
-
{{ $t('Ingredients') }}
- - -