mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-10 16:47:59 -05:00
shopping list ui somewhat bearable
This commit is contained in:
@@ -342,7 +342,7 @@ class ShoppingListRecipeSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
class ShoppingListEntrySerializer(WritableNestedModelSerializer):
|
class ShoppingListEntrySerializer(WritableNestedModelSerializer):
|
||||||
food = FoodSerializer(allow_null=True)
|
food = FoodSerializer(allow_null=True)
|
||||||
unit = UnitSerializer(allow_null=True)
|
unit = UnitSerializer(allow_null=True, required=False)
|
||||||
amount = CustomDecimalField()
|
amount = CustomDecimalField()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
@@ -109,14 +109,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class="table table-sm table-striped" style="margin-top: 1vh">
|
<table class="table table-sm" style="margin-top: 1vh">
|
||||||
|
|
||||||
<template v-for="c in display_categories">
|
<template v-for="c in display_categories">
|
||||||
<tbody>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4">[[c.name]]</td>
|
<th colspan="5">[[c.name]]</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</thead>
|
||||||
<tbody is="draggable" :list="c.entries" tag="tbody" group="people" @sort="sortEntries"
|
<tbody is="draggable" :list="c.entries" tag="tbody" group="people" @sort="sortEntries"
|
||||||
@change="dragChanged(c, $event)">
|
@change="dragChanged(c, $event)">
|
||||||
<tr v-for="(element, index) in c.entries" :key="element.id">
|
<tr v-for="(element, index) in c.entries" :key="element.id">
|
||||||
@@ -686,7 +686,7 @@
|
|||||||
'unit': this.new_entry.unit,
|
'unit': this.new_entry.unit,
|
||||||
'amount': parseFloat(this.new_entry.amount),
|
'amount': parseFloat(this.new_entry.amount),
|
||||||
'order': 0,
|
'order': 0,
|
||||||
'checked': false
|
'checked': false,
|
||||||
})
|
})
|
||||||
|
|
||||||
this.new_entry = {
|
this.new_entry = {
|
||||||
@@ -781,7 +781,7 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
addFoodType: function (tag, index) { //TODO move to central component
|
addFoodType: function (tag, index) { //TODO move to central component
|
||||||
let new_food = {'name': tag}
|
let new_food = {'name': tag, supermarket_category: null}
|
||||||
this.foods.push(new_food)
|
this.foods.push(new_food)
|
||||||
this.new_entry.food = new_food
|
this.new_entry.food = new_food
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user