added mealplan info to recipes tab
This commit is contained in:
parent
f431e18336
commit
64e54ceaec
@ -115,8 +115,8 @@
|
|||||||
<b-button-group class="w-100 mt-2">
|
<b-button-group class="w-100 mt-2">
|
||||||
<b-button variant="dark" block class="btn btn-block text-left">
|
<b-button variant="dark" block class="btn btn-block text-left">
|
||||||
<span>{{ r.recipe_name }}</span> <br/>
|
<span>{{ r.recipe_name }}</span> <br/>
|
||||||
<span><small class="text-muted">{{ r.recipe_name }}</small></span>
|
<span v-if="r.mealplan_type"><small class="text-muted">{{ r.mealplan_type }} {{ formatDate(r.mealplan_from_date) }}</small></span>
|
||||||
<!-- TODO show meal plan date/type -->
|
|
||||||
</b-button>
|
</b-button>
|
||||||
<b-button variant="danger" @click="deleteRecipe(r.shopping_list_recipe_id)"><i
|
<b-button variant="danger" @click="deleteRecipe(r.shopping_list_recipe_id)"><i
|
||||||
class="fas fa-trash fa-fw"></i></b-button>
|
class="fas fa-trash fa-fw"></i></b-button>
|
||||||
@ -550,6 +550,15 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
useUserPreferenceStore,
|
useUserPreferenceStore,
|
||||||
useShoppingListStore,
|
useShoppingListStore,
|
||||||
|
// TODO move to utils
|
||||||
|
formatDate: function (datetime) {
|
||||||
|
if (!datetime) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return Intl.DateTimeFormat(window.navigator.language, {
|
||||||
|
dateStyle: "short",
|
||||||
|
}).format(Date.parse(datetime))
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* recursive function calling autosync after set amount of time has passed
|
* recursive function calling autosync after set amount of time has passed
|
||||||
*/
|
*/
|
||||||
|
@ -247,7 +247,7 @@ export default {
|
|||||||
useUserPreferenceStore,
|
useUserPreferenceStore,
|
||||||
useShoppingListStore,
|
useShoppingListStore,
|
||||||
resolveDjangoUrl,
|
resolveDjangoUrl,
|
||||||
|
// TODO move to utils
|
||||||
formatDate: function (datetime) {
|
formatDate: function (datetime) {
|
||||||
if (!datetime) {
|
if (!datetime) {
|
||||||
return
|
return
|
||||||
|
@ -294,7 +294,9 @@ export const useShoppingListStore = defineStore(_STORE_ID, {
|
|||||||
'shopping_list_recipe_id': e.list_recipe,
|
'shopping_list_recipe_id': e.list_recipe,
|
||||||
'recipe_id': e.recipe_mealplan.recipe,
|
'recipe_id': e.recipe_mealplan.recipe,
|
||||||
'recipe_name': e.recipe_mealplan.recipe_name,
|
'recipe_name': e.recipe_mealplan.recipe_name,
|
||||||
'servings': e.recipe_mealplan.servings
|
'servings': e.recipe_mealplan.servings,
|
||||||
|
'mealplan_from_date': e.recipe_mealplan.mealplan_from_date,
|
||||||
|
'mealplan_type': e.recipe_mealplan.mealplan_type,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user