diff --git a/assets/js/app.js b/assets/js/app.js index 341e9e0..7ef1e95 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -15188,7 +15188,7 @@ function renderRecipeLibraryList(recipes) { function openRecipeLibraryForm(id = null) { const existing = id ? _recipeLibraryCache.find(e => e.id === id) : null; - const r = existing ? existing.recipe : { title: '', ingredients: [{ name: '', qty: '' }], steps: [''] }; + const r = existing ? existing.recipe : { title: '', ingredients: [{ name: '', qty: '' }], equipment: [], steps: [''] }; document.getElementById('modal-content').innerHTML = ` +
+ +
+ ${(r.equipment || []).map(eq => ` +
+ + +
+ `).join('')} +
+ +
@@ -15252,6 +15264,11 @@ function addRecipeLibraryRow(containerId, type) { `; + } else if (type === 'equipment') { + row.innerHTML = ` + + + `; } else { row.innerHTML = ` @@ -15271,11 +15288,13 @@ async function submitRecipeLibraryForm(e, id) { qty: row.querySelector('.rl-ing-qty')?.value.trim() || '', })).filter(ing => ing.name); + const equipment = Array.from(document.querySelectorAll('#rl-equipment-list .rl-equipment-text')).map(input => input.value.trim()).filter(Boolean); + const steps = Array.from(document.querySelectorAll('#rl-steps-list .rl-step-text')).map(input => input.value.trim()).filter(Boolean); const tags = Array.from(document.querySelectorAll('#rl-tags-picker .rl-tag-chip.btn-primary')).map(b => b.dataset.tag); - const recipe = { title, ingredients, steps, tags, persons: 1 }; + const recipe = { title, ingredients, equipment, steps, tags, persons: 1 }; showLoading(true); try { @@ -15309,6 +15328,14 @@ function viewRecipeLibraryItem(id) { ${(r.ingredients || []).map(ing => `
  • ${escapeHtml(ing.name)}${ing.qty ? ' — ' + escapeHtml(ing.qty) : ''}
  • `).join('')}
    + ${(r.equipment && r.equipment.length) ? ` +
    + + +
    + ` : ''}