From d1df6a6862d21f7650ab835a97d810189821fd09 Mon Sep 17 00:00:00 2001 From: dadaloop82 Date: Tue, 17 Mar 2026 12:06:14 +0000 Subject: [PATCH] 20260317b: Replace Comfort Food with Priorita cose aperte in recipe options --- api/index.php | 2 +- assets/js/app.js | 14 +++++++------- data/dispensa.db | Bin 184320 -> 184320 bytes index.html | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/api/index.php b/api/index.php index a4c3351..20923d6 100644 --- a/api/index.php +++ b/api/index.php @@ -1367,7 +1367,7 @@ function generateRecipe(PDO $db): void { 'pocafame' => 'L\'utente ha POCA FAME: proponi una porzione leggera, magari uno snack, un\'insalata o qualcosa di semplice e poco abbondante.', 'scadenze' => 'PRIORITÀ SCADENZE: usa ASSOLUTAMENTE per primi gli ingredienti più vicini alla scadenza o già scaduti (se ancora commestibili).', 'salutare' => 'Ricetta EXTRA SALUTARE: prediligi ingredienti integrali, tante verdure, pochi grassi, cotture leggere.', - 'comfort' => 'Ricetta COMFORT FOOD: qualcosa di appagante, gustoso e che dia soddisfazione.', + 'opened' => 'PRIORITÀ COSE APERTE: dai la MASSIMA PRIORITÀ ai prodotti con confezione aperta (contrassegnati [CONFEZIONE APERTA]) e a quelli in FRIGO (contrassegnati [IN FRIGO]). Questi prodotti si deteriorano più in fretta e DEVONO essere usati per primi. Costruisci la ricetta attorno a questi ingredienti.', 'zerowaste' => 'ZERO SPRECHI: cerca di usare quanti più ingredienti in scadenza possibile, combina anche ingredienti insoliti pur di non sprecare nulla.' ]; foreach ($options as $opt) { diff --git a/assets/js/app.js b/assets/js/app.js index 3314daf..2fa90d3 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -426,7 +426,7 @@ function getSettings() { if (s.pref_pocafame) s.recipe_prefs.push('pocafame'); if (s.pref_scadenze) s.recipe_prefs.push('scadenze'); if (s.pref_healthy) s.recipe_prefs.push('salutare'); - if (s.pref_comfort) s.recipe_prefs.push('comfort'); + if (s.pref_opened) s.recipe_prefs.push('opened'); if (s.pref_zerowaste) s.recipe_prefs.push('zerowaste'); s.dietary_restrictions = s.dietary || ''; return s; @@ -451,7 +451,7 @@ const _debouncedSyncSettings = debounce(function() { pref_pocafame: s.pref_pocafame, pref_scadenze: s.pref_scadenze, pref_healthy: s.pref_healthy, - pref_comfort: s.pref_comfort, + pref_opened: s.pref_opened, pref_zerowaste: s.pref_zerowaste, dietary: s.dietary, appliances: s.appliances, @@ -480,7 +480,7 @@ async function syncSettingsFromDB() { const s = getSettings(); // Merge DB settings into local (DB wins for shared prefs) for (const key of ['default_persons','pref_veloce','pref_pocafame','pref_scadenze', - 'pref_healthy','pref_comfort','pref_zerowaste','dietary','appliances', + 'pref_healthy','pref_opened','pref_zerowaste','dietary','appliances', 'spesa_provider','spesa_ai_prompt','spesa_email','spesa_password', 'spesa_logged_in','spesa_user','spesa_data','spesa_token']) { if (db[key] !== undefined) s[key] = db[key]; @@ -505,7 +505,7 @@ async function loadSettingsUI() { document.getElementById('setting-pref-pocafame').checked = !!s.pref_pocafame; document.getElementById('setting-pref-scadenze').checked = !!s.pref_scadenze; document.getElementById('setting-pref-healthy').checked = !!s.pref_healthy; - document.getElementById('setting-pref-comfort').checked = !!s.pref_comfort; + document.getElementById('setting-pref-opened').checked = !!s.pref_opened; document.getElementById('setting-pref-zerowaste').checked = !!s.pref_zerowaste; document.getElementById('setting-dietary').value = s.dietary || ''; // Camera @@ -606,7 +606,7 @@ async function saveSettings() { s.pref_pocafame = document.getElementById('setting-pref-pocafame').checked; s.pref_scadenze = document.getElementById('setting-pref-scadenze').checked; s.pref_healthy = document.getElementById('setting-pref-healthy').checked; - s.pref_comfort = document.getElementById('setting-pref-comfort').checked; + s.pref_opened = document.getElementById('setting-pref-opened').checked; s.pref_zerowaste = document.getElementById('setting-pref-zerowaste').checked; s.dietary = document.getElementById('setting-dietary').value.trim(); // Camera @@ -4991,7 +4991,7 @@ function openRecipeDialog() { 'pocafame': 'recipe-opt-pocafame', 'scadenze': 'recipe-opt-scadenze', 'salutare': 'recipe-opt-healthy', - 'comfort': 'recipe-opt-comfort', + 'opened': 'recipe-opt-opened', 'zerowaste': 'recipe-opt-zerowaste' }; Object.entries(prefMap).forEach(([key, id]) => { @@ -5407,7 +5407,7 @@ async function generateRecipe() { 'recipe-opt-pocafame': 'pocafame', 'recipe-opt-scadenze': 'scadenze', 'recipe-opt-healthy': 'salutare', - 'recipe-opt-comfort': 'comfort', + 'recipe-opt-opened': 'opened', 'recipe-opt-zerowaste': 'zerowaste' }; Object.entries(optMap).forEach(([id, key]) => { diff --git a/data/dispensa.db b/data/dispensa.db index 3064f3eb58aeeb8f7cade06d964f1540e0c8b3c2..a38bafbc8a548e04015fc3921b7db116d5134fca 100644 GIT binary patch delta 1065 zcmZuwOK%fb6u$R*9PDwN1WH>1ih2_940(E-fZT1=z zr=6RZn&)!H02^S-BJCRlz9S5SF{azC?9%p@F9z6wGspJi-xaMdENgok?tYqIP)+Gp zl&#$=`>p-#?$!PyFmtqI(S4-ubo?LMC1Wg|9_yGdcBS9@m}eOu5u=us5f$_s%Jrr3 zef#Lk{pMy`vDjIBdFy_^ktwsm>D=qwWTxC19h%OpUSB%g$A)k2vudi2E}mMNfF}BZ z276J#qC}`D$I)TRU$v>QMCULvBS+9`X-XPf+0qTmDiriG!#EGI1)Au%-Zx)oK{JH3Xtl%gad? z32ivj!xag4T>A~_5iWKUoedj%@wvBoLUIkA)uh}yDn|ho+YB{MndVtlZ#ZbvYq=48+tW$(6jh92ZdK8Y+hpWg98_Q;4rZ7J_V@=NX_HnjUm~WjN z?_*K%5&valN$Jq)zW#~d_)xGH(T!Jpf0oemrDCyE=-zw9PhLoUBc6A+ofdg+q?mY4 z`}+rvhR=$jvE!r`Jr(MGRHIe!#eLmW@CRU8}TKYT@{BHCgXkE%M s{!VrzZ;5E=PrkFT_0#NYU5sP={k(NWhr!OOhc*2_{N3-aiwmFq2Oh;n>;M1& delta 292 zcmZozz}>Kbd&4$+#v7Bj+gmYeZvJF1B*1ZvtDAxUH~+WId;vL(n`;6YIVVrx6x!S! zRTj$4z`(%AP{qVr%)+;sX9E+9P*V~UKZAOpV|1gbAV*`gu`%!DzAc{9cP25#C>olW z=o=Uq=$o6E8R(}K<>!^eXO`%h>KPdr=w%h8=jKd)vZa~JP{GjD%EZ9R)M#_@*2z{Z z%B-x)o4Gznu!=D_GjcF6$}%Y$8#AS378j)E6(_Q6m~8P?4Ovsh*Ezd5n7IEj@auE` z+pH+?iF^CM-Hh$lOpGkk+rKlaahfR@n1L)X*uL#MqhADb8?)qg_5dbcMxbI=rs>av gm;|b%7 diff --git a/index.html b/index.html index b54a0c0..23db562 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ Dispensa Manager - + @@ -653,7 +653,7 @@ - + @@ -862,7 +862,7 @@ - + @@ -911,6 +911,6 @@ - +