From af8eb227363611b3f29a04299042de1d80b6e9df Mon Sep 17 00:00:00 2001 From: dadaloop82 Date: Tue, 10 Mar 2026 16:42:43 +0000 Subject: [PATCH] =?UTF-8?q?Dashboard:=20rimuovi=20lista=20prodotti,=20rino?= =?UTF-8?q?mina=20Inventario=E2=86=92Dispensa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rimossa lista completa prodotti per location dalla dashboard (solo stat cards + scadenze) - Rinominato 'Inventario' in 'Dispensa' nel nav e nell'header pagina - Dashboard piรน leggera: non carica piรน inventory_list --- assets/js/app.js | 24 ++---------------------- index.html | 21 ++------------------- 2 files changed, 4 insertions(+), 41 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index 719352f..1b05be6 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -380,10 +380,9 @@ function showPage(pageId, param = null) { // ===== DASHBOARD ===== async function loadDashboard() { try { - const [summaryData, statsData, invData] = await Promise.all([ + const [summaryData, statsData] = await Promise.all([ api('inventory_summary'), - api('stats'), - api('inventory_list') + api('stats') ]); // Update stat cards @@ -459,25 +458,6 @@ async function loadDashboard() { expiredSection.style.display = 'none'; } - // Full inventory grouped by location, then by category within each location - const allItems = invData.inventory || []; - const grouped = { dispensa: [], frigo: [], freezer: [], altro: [] }; - allItems.forEach(item => { - const loc = grouped[item.location] !== undefined ? item.location : 'altro'; - grouped[loc].push(item); - }); - - for (const [loc, items] of Object.entries(grouped)) { - const section = document.getElementById(`dash-section-${loc}`); - const container = document.getElementById(`dash-inv-${loc}`); - if (items.length === 0) { - section.style.display = 'none'; - } else { - section.style.display = 'block'; - container.innerHTML = renderGroupedByCategory(items, true); - } - } - } catch (err) { console.error('Dashboard load error:', err); } diff --git a/index.html b/index.html index 05c7063..352b267 100644 --- a/index.html +++ b/index.html @@ -64,30 +64,13 @@
- -
-

๐Ÿ—„๏ธ Dispensa

-
-
-
-

๐ŸงŠ Frigo

-
-
-
-

โ„๏ธ Freezer

-
-
-
-

๐Ÿ“ฆ Altro

-
-
@@ -500,7 +483,7 @@