Actualiser assets/js/app.js
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled

This commit is contained in:
2026-06-17 14:00:42 +00:00
parent fecbbafd38
commit f6fe0a55bd
+14 -4
View File
@@ -5197,20 +5197,30 @@ function _applyInsightPhase() {
// ===== DASHBOARD ===== // ===== DASHBOARD =====
function renderDashboardLocationCards(counts) { function renderDashboardLocationCards(counts) {
const container = document.getElementById('dashboard-location-cards'); const statsContainer = document.getElementById('dashboard-stats');
if (!container) return; if (!statsContainer) return;
const keys = Object.keys(LOCATIONS); const keys = Object.keys(LOCATIONS);
container.innerHTML = keys.map(key => { const cardsHtml = keys.map(key => {
const info = LOCATIONS[key]; const info = LOCATIONS[key];
const count = counts[key] !== undefined ? counts[key] : '-'; const count = counts[key] !== undefined ? counts[key] : '-';
return ` return `
<div class="stat-card" onclick="showPage('inventory', '${key}')"> <div class="stat-card stat-card-location" onclick="showPage('inventory', '${key}')">
<span class="stat-icon">${info.icon}</span> <span class="stat-icon">${info.icon}</span>
<span class="stat-value">${count}</span> <span class="stat-value">${count}</span>
<span class="stat-label">${escapeHtml(info.label)}</span> <span class="stat-label">${escapeHtml(info.label)}</span>
</div> </div>
`; `;
}).join(''); }).join('');
// Remove previously injected location cards (keep the static "Courses" card)
statsContainer.querySelectorAll('.stat-card-location').forEach(el => el.remove());
// Insert before the Courses card (first remaining child)
const shoppingCard = statsContainer.querySelector('.stat-card');
if (shoppingCard) {
shoppingCard.insertAdjacentHTML('beforebegin', cardsHtml);
} else {
statsContainer.insertAdjacentHTML('afterbegin', cardsHtml);
}
} }
async function loadDashboard() { async function loadDashboard() {
// Render one card per known location, with shimmer while loading // Render one card per known location, with shimmer while loading