From 5e2dba7b048d1131d0bb693e2d5a99ca40c17439 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 22 Sep 2020 00:32:42 +0200 Subject: [PATCH] added basic exporting --- cookbook/templates/shopping_list.html | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/cookbook/templates/shopping_list.html b/cookbook/templates/shopping_list.html index 615b27190..6ac9eca30 100644 --- a/cookbook/templates/shopping_list.html +++ b/cookbook/templates/shopping_list.html @@ -196,6 +196,31 @@ + + {% trans 'Export' %} + + +
+
+ +
+ +
+ +
+
+ + + +
+
+ + +
+ @@ -220,6 +245,7 @@ shopping_list_id: {% if shopping_list_id %}{{ shopping_list_id }}{% else %}null{% endif %}, loading: true, edit_mode: false, + export_text_prefix: '', //TODO add userpreference recipe_query: '', recipes: [], shopping_list: undefined, @@ -264,6 +290,13 @@ return entries }, + export_text() { + let text = '' + for (let e of this.display_entries) { + text += `${this.export_text_prefix}${e.amount} ${e.unit.name} ${e.food.name} \n` + } + return text + }, }, /* watch: {