implemented scoring system
Some checks failed
PHPUnit / test (push) Has been cancelled

This commit is contained in:
2026-06-08 19:10:23 +02:00
parent 4589be119c
commit 63adef79df
19 changed files with 2873 additions and 36 deletions

View File

@ -48,6 +48,12 @@ function renderHomeDashboard(ov, isAdmin) {
links.push({ href: '#/dev', label: 'Admin settings', desc: 'Dev import, exports, database tools' });
}
const scoringProfiles = ov.scoringProfiles || [];
const primaryProfile = scoringProfiles[0];
const greenPct = primaryProfile && primaryProfile.clientCount
? Math.round(((primaryProfile.bands?.green ?? 0) / primaryProfile.clientCount) * 100)
: null;
el.innerHTML = `
<div class="insights-kpi-grid">
<a href="#/clients" class="insights-kpi card home-kpi-link">
@ -66,6 +72,16 @@ function renderHomeDashboard(ov, isAdmin) {
<div class="insights-kpi-value">${ov.submissionsLast30d ?? 0}</div>
<div class="insights-kpi-label">Uploads (30 days)</div>
</a>
${primaryProfile ? `
<a href="#/insights" class="insights-kpi card home-kpi-link">
<div class="insights-kpi-value">${primaryProfile.clientCount ?? 0}</div>
<div class="insights-kpi-label">${esc(primaryProfile.name)} scored</div>
</a>` : ''}
${greenPct != null ? `
<a href="#/insights" class="insights-kpi card home-kpi-link">
<div class="insights-kpi-value">${greenPct}%</div>
<div class="insights-kpi-label">Green (${esc(primaryProfile.name)})</div>
</a>` : ''}
</div>
<div class="card" style="margin-top:20px">