diff --git a/public/locales/de.json b/public/locales/de.json index 896e14f..382cbcf 100644 --- a/public/locales/de.json +++ b/public/locales/de.json @@ -319,7 +319,9 @@ "savedRecipePlaceholder": "Rezept auswählen", "saveAsRecipe": "Als Rezept speichern", "recipeScaleLabel": "Zutaten skalieren", - "deletedToast": "Mahlzeit gelöscht" + "deletedToast": "Mahlzeit gelöscht", + "cookLabel": "Koch/Köchin", + "cookNone": "Keine Koch-Zuweisung" }, "calendar": { "title": "Kalender", diff --git a/public/locales/en.json b/public/locales/en.json index ee436b7..596ff06 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -313,7 +313,9 @@ "savedRecipePlaceholder": "Select recipe", "saveAsRecipe": "Save as recipe", "recipeScaleLabel": "Scale ingredients", - "deletedToast": "Meal deleted" + "deletedToast": "Meal deleted", + "cookLabel": "Cook", + "cookNone": "No assigned cook" }, "calendar": { "title": "Calendar", diff --git a/public/pages/meals.js b/public/pages/meals.js index b2ebb6a..167cd1c 100644 --- a/public/pages/meals.js +++ b/public/pages/meals.js @@ -38,6 +38,7 @@ let state = { currentWeek: null, // YYYY-MM-DD (Montag) meals: [], recipes: [], + familyMembers: [], // Familienmitglieder für Koch-Zuweisung lists: [], // Einkaufslisten für Transfer-Dropdown categories: [], // Einkaufskategorien für Zutaten modal: null, @@ -126,6 +127,15 @@ async function loadRecipes() { } } +async function loadFamilyMembers() { + try { + const res = await api.get('/family/members'); + state.familyMembers = res.data; + } catch { + state.familyMembers = []; + } +} + async function loadPreferences() { try { const res = await api.get('/preferences'); @@ -169,7 +179,7 @@ export async function render(container, { user }) { const today = new Date().toISOString().slice(0, 10); const monday = getMondayOf(today); - await Promise.all([loadWeek(monday), loadLists(), loadPreferences(), loadCategories(), loadRecipes()]); + await Promise.all([loadWeek(monday), loadLists(), loadPreferences(), loadCategories(), loadRecipes(), loadFamilyMembers()]); renderWeekGrid(); wireNav(); @@ -252,6 +262,7 @@ function renderSlot(date, type, mealsForDay) { const ingLabel = ingCount > 0 ? (ingCount !== 1 ? t('meals.ingredientCountPlural', { count: ingCount }) : t('meals.ingredientCount', { count: ingCount })) : ''; const ingDoneLabel = ingCount > 0 && ingDone === ingCount ? ' ✓' : ''; const canTransfer = ingCount > 0 && ingDone < ingCount; + const cookName = meal.cook_assignment?.cook_name; return `