diff --git a/cookbook/templates/shopping_list.html b/cookbook/templates/shopping_list.html
index 95f5ca7ec..37e99432e 100644
--- a/cookbook/templates/shopping_list.html
+++ b/cookbook/templates/shopping_list.html
@@ -76,6 +76,10 @@
+
@@ -112,6 +116,11 @@
[[x.amount]] |
[[x.unit.name]] |
[[x.food.name]] |
+
+
+ |
@@ -429,8 +438,6 @@
})
},
entryChecked: function (entry) {
-
-
this.shopping_list.entries.forEach((item) => {
if (item.id === entry.id) { //TODO unwrap once same entries are merged
item.checked = entry.checked
@@ -445,8 +452,6 @@
}
})
-
-
},
addEntry: function () {
if (this.new_entry.food !== undefined) {
@@ -490,8 +495,6 @@
return '{% url 'view_recipe' 123456 %}'.replace('123456', id)
},
addRecipeToList: function (recipe) {
-
-
let slr = {
"created": true,
"id": Math.random() * 1000,
@@ -516,6 +519,10 @@
}
}
},
+ removeRecipeFromList: function (slr) {
+ this.shopping_list.entries = this.shopping_list.entries.filter(item => item.list_recipe !== slr.id)
+ this.shopping_list.recipes = this.shopping_list.recipes.filter(item => item !== slr)
+ },
searchKeywords: function (query) {
this.keywords_loading = true
this.$http.get("{% url 'api:keyword-list' %}" + '?query=' + query + '&limit=10').then((response) => {