minor cleanup
This commit is contained in:
parent
2af7b64d4f
commit
2763eed5b2
@ -18,6 +18,6 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='userpreference',
|
model_name='userpreference',
|
||||||
name='csv_prefix',
|
name='csv_prefix',
|
||||||
field=models.CharField(blank=True, max_length=3),
|
field=models.CharField(blank=True, max_length=10),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
@ -334,7 +334,7 @@ class UserPreference(models.Model, PermissionModelMixin):
|
|||||||
default_delay = models.DecimalField(default=4, max_digits=8, decimal_places=4)
|
default_delay = models.DecimalField(default=4, max_digits=8, decimal_places=4)
|
||||||
shopping_recent_days = models.PositiveIntegerField(default=7)
|
shopping_recent_days = models.PositiveIntegerField(default=7)
|
||||||
csv_delim = models.CharField(max_length=2, default=",")
|
csv_delim = models.CharField(max_length=2, default=",")
|
||||||
csv_prefix = models.CharField(max_length=3, blank=True,)
|
csv_prefix = models.CharField(max_length=10, blank=True,)
|
||||||
|
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
space = models.ForeignKey(Space, on_delete=models.CASCADE, null=True)
|
space = models.ForeignKey(Space, on_delete=models.CASCADE, null=True)
|
||||||
|
@ -211,7 +211,6 @@ export default {
|
|||||||
if (e !== "cancel") {
|
if (e !== "cancel") {
|
||||||
switch (this.this_action) {
|
switch (this.this_action) {
|
||||||
case this.Actions.DELETE:
|
case this.Actions.DELETE:
|
||||||
console.log("delete")
|
|
||||||
this.deleteThis(this.this_item.id)
|
this.deleteThis(this.this_item.id)
|
||||||
break
|
break
|
||||||
case this.Actions.CREATE:
|
case this.Actions.CREATE:
|
||||||
|
@ -687,9 +687,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// this.genericAPI inherited from ApiMixin
|
// this.genericAPI inherited from ApiMixin
|
||||||
download(type) {
|
|
||||||
console.log("you just downloaded", type)
|
|
||||||
},
|
|
||||||
addItem() {
|
addItem() {
|
||||||
let api = new ApiApiFactory()
|
let api = new ApiApiFactory()
|
||||||
api.createShoppingListEntry(this.new_item)
|
api.createShoppingListEntry(this.new_item)
|
||||||
|
@ -19,9 +19,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td @click="done">
|
<td @click="done">
|
||||||
<template v-if="ingredient.food !== null">
|
<template v-if="ingredient.food !== null">
|
||||||
<a :href="resolveDjangoUrl('view_recipe', ingredient.food.recipe.id)" v-if="ingredient.food.recipe !== null" target="_blank" rel="noopener noreferrer">{{
|
<a :href="resolveDjangoUrl('view_recipe', ingredient.food.recipe.id)" v-if="ingredient.food.recipe !== null" target="_blank" rel="noopener noreferrer">{{ ingredient.food.name }}</a>
|
||||||
ingredient.food.name
|
|
||||||
}}</a>
|
|
||||||
<span v-if="ingredient.food.recipe === null">{{ ingredient.food.name }}</span>
|
<span v-if="ingredient.food.recipe === null">{{ ingredient.food.name }}</span>
|
||||||
</template>
|
</template>
|
||||||
</td>
|
</td>
|
||||||
@ -179,20 +177,17 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
calculateAmount: function(x) {
|
calculateAmount: function (x) {
|
||||||
return calculateAmount(x, this.ingredient_factor)
|
return calculateAmount(x, this.ingredient_factor)
|
||||||
},
|
},
|
||||||
// sends parent recipe ingredient to notify complete has been toggled
|
// sends parent recipe ingredient to notify complete has been toggled
|
||||||
done: function() {
|
done: function () {
|
||||||
this.$emit("checked-state-changed", this.ingredient)
|
this.$emit("checked-state-changed", this.ingredient)
|
||||||
},
|
},
|
||||||
// sends true/false to parent to save all ingredient shopping updates as a batch
|
// sends true/false to parent to save all ingredient shopping updates as a batch
|
||||||
changeShopping: function() {
|
changeShopping: function () {
|
||||||
this.$emit("add-to-shopping", { item: this.ingredient, add: this.shop })
|
this.$emit("add-to-shopping", { item: this.ingredient, add: this.shop })
|
||||||
},
|
},
|
||||||
editFood: function() {
|
|
||||||
console.log("edit the food")
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -78,9 +78,7 @@ export default {
|
|||||||
footer_text: String,
|
footer_text: String,
|
||||||
footer_icon: String,
|
footer_icon: String,
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {},
|
||||||
console.log(this.recipe)
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
detailed: function () {
|
detailed: function () {
|
||||||
return this.recipe?.steps !== undefined
|
return this.recipe?.steps !== undefined
|
||||||
|
Loading…
Reference in New Issue
Block a user