Skip to content

Commit

Permalink
shopping fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vabene1111 committed Jan 2, 2025
1 parent 2841e08 commit 9e99edf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
3 changes: 3 additions & 0 deletions vue3/src/components/dialogs/ShoppingLineItemDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
</b>
{{ e.food.name }}
</v-list-item-title>
<v-list-item-subtitle v-if="e.completedAt">
<v-icon icon="fa-solid fa-check" size="small" color="success"></v-icon> {{$t('Completed')}} {{DateTime.fromJSDate(e.completedAt).toLocaleString(DateTime.DATETIME_SHORT)}}
</v-list-item-subtitle>
<v-list-item-subtitle v-if="e.recipeMealplan && e.recipeMealplan.recipeName !== ''">
{{ e.recipeMealplan.servings }} x
<router-link :to="{name: 'view_recipe', params: {id: e.recipeMealplan.id}}" target="_blank" class="text-decoration-none"><b>
Expand Down
32 changes: 19 additions & 13 deletions vue3/src/components/display/ShoppingLineItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,24 +167,30 @@ const infoRow = computed(() => {
for (let i in entries.value) {
let e = entries.value[i]
if (authors.indexOf(e.createdBy.displayName) === -1) {
authors.push(e.createdBy.displayName)
}
if (!e.checked && !isDelayed(e)
|| (e.checked && useUserPreferenceStore().deviceSettings.shopping_show_checked_entries)
|| (isDelayed(e) && useUserPreferenceStore().deviceSettings.shopping_show_delayed_entries)) {
if (e.listRecipe != null) {
if (e.listRecipeData.recipe != null) {
let recipe_name = e.listRecipeData.recipeData.name
if (recipes.indexOf(recipe_name) === -1) {
recipes.push(recipe_name.substring(0, 14) + (recipe_name.length > 14 ? '..' : ''))
}
if (authors.indexOf(e.createdBy.displayName) === -1) {
authors.push(e.createdBy.displayName)
}
if (e.listRecipeData.mealplan != null) {
let meal_plan_entry = (e.listRecipeData.mealPlanData.mealType.name.substring(0, 8) || '') + ' (' + DateTime.fromJSDate(e.listRecipeData.mealPlanData.fromDate).toLocaleString(DateTime.DATE_SHORT) + ')'
if (meal_pans.indexOf(meal_plan_entry) === -1) {
meal_pans.push(meal_plan_entry)
if (e.listRecipe != null) {
if (e.listRecipeData.recipe != null) {
let recipe_name = e.listRecipeData.recipeData.name
if (recipes.indexOf(recipe_name) === -1) {
recipes.push(recipe_name.substring(0, 14) + (recipe_name.length > 14 ? '..' : ''))
}
}
if (e.listRecipeData.mealplan != null) {
let meal_plan_entry = (e.listRecipeData.mealPlanData.mealType.name.substring(0, 8) || '') + ' (' + DateTime.fromJSDate(e.listRecipeData.mealPlanData.fromDate).toLocaleString(DateTime.DATE_SHORT) + ')'
if (meal_pans.indexOf(meal_plan_entry) === -1) {
meal_pans.push(meal_plan_entry)
}
}
}
}
}
Expand Down

0 comments on commit 9e99edf

Please sign in to comment.