diff --git a/cookbook/templates/shopping_list.html b/cookbook/templates/shopping_list.html
index fd8bbd7cd..3b15256c7 100644
--- a/cookbook/templates/shopping_list.html
+++ b/cookbook/templates/shopping_list.html
@@ -109,23 +109,13 @@
-
-
-
- | # |
- 1 |
- 2 |
- 3 |
- |
-
-
-
+
- |
+
[[element.amount]] |
[[element.unit.name]] |
[[element.food.name]] |
@@ -344,6 +334,7 @@
if (item.list_recipe !== null) {
item.amount = item.amount * this.multiplier_cache[item.list_recipe]
}
+ item.unit = ((element.unit !== undefined && element.unit !== null) ? element.unit : {'name': ''})
entries.push(item)
});
@@ -539,7 +530,7 @@
this.shopping_list.entries.push({
'list_recipe': null,
'food': this.new_entry.food,
- 'unit': ((this.new_entry.unit !== undefined) ? this.new_entry.unit : {'name': ''}),
+ 'unit': this.new_entry.unit,
'amount': parseFloat(this.new_entry.amount),
'order': 0,
'checked': false
@@ -592,7 +583,7 @@
this.shopping_list.entries.push({
'list_recipe': slr.id,
'food': i.food,
- 'unit': ((i.unit !== undefined && i.unit !== null) ? i.unit : {'name': ''}),
+ 'unit': i.unit,
'amount': i.amount,
'order': 0
})