From a4f0f383006b5092f1a75aba56734826b68f33b4 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 19 Feb 2023 15:24:51 +0100 Subject: [PATCH] meal plan simple mobile layout --- vue/src/apps/MealPlanView/MealPlanView.vue | 129 +++++++++++++++------ 1 file changed, 91 insertions(+), 38 deletions(-) diff --git a/vue/src/apps/MealPlanView/MealPlanView.vue b/vue/src/apps/MealPlanView/MealPlanView.vue index 37392547f..4770c995a 100644 --- a/vue/src/apps/MealPlanView/MealPlanView.vue +++ b/vue/src/apps/MealPlanView/MealPlanView.vue @@ -2,7 +2,7 @@
-
+
+
+
+
+
+ + + + + + + + + + + + + + +
+
+
+
+ + +
+
+

{{ day.date_label }}

+
+
+ +
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+
+
+ +
+
+
@@ -207,52 +271,21 @@ @reload-meal-types="refreshMealTypes" > - -
-
- -
- - - - - - - -
- - - - - - - - - - - - - - -
-
+
@@ -379,6 +412,22 @@ export default { return "" } }, + mobileSimpleGrid() { + let grid = [] + + if (useMealPlanStore().plan_list.length > 0 && this.current_period !== null) { + for (const x of Array(7).keys()) { + let moment_date = moment(this.current_period.periodStart).add(x, "d") + grid.push({ + date: moment_date, + create_default_date: moment_date.format("YYYY-MM-DD"), // improve meal plan edit modal to do formatting itself and accept dates + date_label: moment_date.format('DD.MM'), + plan_entries: useMealPlanStore().plan_list.filter((m) => moment(m.date).isSame(moment_date, 'day')) + }) + } + } + return grid + } }, mounted() { this.$nextTick(function () { @@ -601,6 +650,10 @@ export default {