fix: log.title emoji; add price estimate total to shopping stat card
This commit is contained in:
@@ -2609,6 +2609,15 @@ body {
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
}
|
}
|
||||||
|
.stat-price-total {
|
||||||
|
display: block;
|
||||||
|
font-size: 0.62rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #15803d;
|
||||||
|
margin-top: 2px;
|
||||||
|
white-space: nowrap;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
/* ===== PRODUCT PREVIEW ===== */
|
/* ===== PRODUCT PREVIEW ===== */
|
||||||
.product-preview, .product-preview-small {
|
.product-preview, .product-preview-small {
|
||||||
|
|||||||
@@ -9001,6 +9001,7 @@ async function fetchAllPrices(forceRefresh = false) {
|
|||||||
if (totalEl) totalEl.textContent = pricesFound > 0 ? `ca. ${sym}${runningTotal.toFixed(2)}` : '–';
|
if (totalEl) totalEl.textContent = pricesFound > 0 ? `ca. ${sym}${runningTotal.toFixed(2)}` : '–';
|
||||||
if (fetchBtn) fetchBtn.disabled = false;
|
if (fetchBtn) fetchBtn.disabled = false;
|
||||||
if (refreshBtn) { refreshBtn.disabled = false; refreshBtn.textContent = '🔄'; }
|
if (refreshBtn) { refreshBtn.disabled = false; refreshBtn.textContent = '🔄'; }
|
||||||
|
_updateDashboardPriceTotal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9228,6 +9229,29 @@ function _updateSmartUrgencyBadge() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _updateDashboardPriceTotal() {
|
||||||
|
const el = document.getElementById('stat-price-total');
|
||||||
|
if (!el) return;
|
||||||
|
const s = getSettings();
|
||||||
|
if (!s.price_enabled || !shoppingItems.length) { el.style.display = 'none'; return; }
|
||||||
|
const sym = _currencySymbol(s.price_currency || 'EUR');
|
||||||
|
const items = _buildPricePayload();
|
||||||
|
let total = 0, count = 0;
|
||||||
|
for (const item of items) {
|
||||||
|
const e = _cachedPrices[item.name];
|
||||||
|
if (e && e._qty === item.quantity && e._unit === item.unit && e.estimated_total != null) {
|
||||||
|
total += e.estimated_total;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (count > 0) {
|
||||||
|
el.textContent = `ca. ${sym}${total.toFixed(2)}`;
|
||||||
|
el.style.display = '';
|
||||||
|
} else {
|
||||||
|
el.style.display = 'none';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sync the on_bring flag for every smartShoppingItem against the current shoppingItems list.
|
* Sync the on_bring flag for every smartShoppingItem against the current shoppingItems list.
|
||||||
* The server cache can be up to 10 min old so on_bring may be stale — this corrects it
|
* The server cache can be up to 10 min old so on_bring may be stale — this corrects it
|
||||||
@@ -9579,6 +9603,7 @@ async function loadShoppingCount() {
|
|||||||
}
|
}
|
||||||
} catch { /* ignore */ }
|
} catch { /* ignore */ }
|
||||||
}
|
}
|
||||||
|
_updateDashboardPriceTotal();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+3
-2
@@ -11,7 +11,7 @@
|
|||||||
<title>EverShelf</title>
|
<title>EverShelf</title>
|
||||||
<link rel="manifest" href="manifest.json">
|
<link rel="manifest" href="manifest.json">
|
||||||
<link rel="icon" type="image/png" href="assets/img/logo/logo_icon.png">
|
<link rel="icon" type="image/png" href="assets/img/logo/logo_icon.png">
|
||||||
<link rel="stylesheet" href="assets/css/style.css?v=20260507a">
|
<link rel="stylesheet" href="assets/css/style.css?v=20260507b">
|
||||||
<!-- QuaggaJS for barcode scanning -->
|
<!-- QuaggaJS for barcode scanning -->
|
||||||
<script src="https://cdn.jsdelivr.net/npm/@ericblade/quagga2@1.8.4/dist/quagga.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/@ericblade/quagga2@1.8.4/dist/quagga.min.js"></script>
|
||||||
<!-- @xenova/transformers: ES-module bootstrap that exposes a lazy category-classifier as window._categoryPipelinePromise -->
|
<!-- @xenova/transformers: ES-module bootstrap that exposes a lazy category-classifier as window._categoryPipelinePromise -->
|
||||||
@@ -120,6 +120,7 @@
|
|||||||
<span class="stat-value" id="stat-spesa">-</span>
|
<span class="stat-value" id="stat-spesa">-</span>
|
||||||
<span class="stat-label" data-i18n="nav.shopping">Spesa</span>
|
<span class="stat-label" data-i18n="nav.shopping">Spesa</span>
|
||||||
<span class="stat-urgent" id="stat-urgent" style="display:none"></span>
|
<span class="stat-urgent" id="stat-urgent" style="display:none"></span>
|
||||||
|
<span class="stat-price-total" id="stat-price-total" style="display:none"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1461,6 +1462,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="assets/js/app.js?v=20260507a"></script>
|
<script src="assets/js/app.js?v=20260507b"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -440,7 +440,7 @@
|
|||||||
"use_data_no_barcode": "✅ KI-Daten verwenden (ohne Barcode)"
|
"use_data_no_barcode": "✅ KI-Daten verwenden (ohne Barcode)"
|
||||||
},
|
},
|
||||||
"log": {
|
"log": {
|
||||||
"title": "� Verlauf",
|
"title": "📒 Verlauf",
|
||||||
"type_added": "Hinzugefügt",
|
"type_added": "Hinzugefügt",
|
||||||
"type_waste": "Entsorgt",
|
"type_waste": "Entsorgt",
|
||||||
"type_used": "Verwendet",
|
"type_used": "Verwendet",
|
||||||
|
|||||||
@@ -440,7 +440,7 @@
|
|||||||
"use_data_no_barcode": "✅ Usa dati AI (senza barcode)"
|
"use_data_no_barcode": "✅ Usa dati AI (senza barcode)"
|
||||||
},
|
},
|
||||||
"log": {
|
"log": {
|
||||||
"title": "� Storico",
|
"title": "📒 Storico",
|
||||||
"type_added": "Aggiunto",
|
"type_added": "Aggiunto",
|
||||||
"type_waste": "Buttato",
|
"type_waste": "Buttato",
|
||||||
"type_used": "Usato",
|
"type_used": "Usato",
|
||||||
|
|||||||
Reference in New Issue
Block a user