From e2e0cc587ef68c80f6bdd3a4e0716cad1da1c63c Mon Sep 17 00:00:00 2001 From: artus40 Date: Tue, 12 Feb 2019 15:24:07 +0100 Subject: [PATCH] lets stop minor design fixes and get real... --- web/vue/src/App.vue | 17 +++++++++++++---- web/vue/src/components/Heading.vue | 2 +- web/vue/src/components/Planner.vue | 22 +++++++++++++++------- web/vue/src/components/RecipeDetails.vue | 10 +++++++++- web/vue/src/components/RecipeList.vue | 2 +- 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/web/vue/src/App.vue b/web/vue/src/App.vue index 45d9159..1a8d03b 100644 --- a/web/vue/src/App.vue +++ b/web/vue/src/App.vue @@ -2,14 +2,14 @@
-

Loading...

+
Loading...
Error: {{ status.error_msg }}
-

Livre de recettes

+ v-on:close="closeActiveView" + v-on:add="addToPlanning" /> @@ -18,7 +18,7 @@

Planning

- +
@@ -60,6 +60,11 @@ export default { closeActiveView: function() { this.active_view = -1; }, + addToPlanning: function(idx) { + let mealKey = ["Lundi", "Lunch"]; + let mealData = this.items[idx]; + this.$refs.weekPlanning.setMeal(mealKey, mealData); + }, deleteRecipe: function(id) { fetch("http://localhost:8000/api/delete/" + id) .then((res) => res.json()) @@ -87,10 +92,14 @@ export default { this.statue.error_msg = err; console.error(err); }); + }, + initWeekPlanning: function() { + this.$refs.weekPlanning.fetchSolution(); } }, mounted () { this.fetchRecipesList(); + this.initWeekPlanning(); } } diff --git a/web/vue/src/components/Heading.vue b/web/vue/src/components/Heading.vue index c24b77c..b399376 100644 --- a/web/vue/src/components/Heading.vue +++ b/web/vue/src/components/Heading.vue @@ -1,5 +1,5 @@