pivot
This commit is contained in:
@@ -1496,6 +1496,23 @@ function crmRender() {
|
||||
? `${total} contact${total !== 1 ? "s" : ""}`
|
||||
: `${filtered.length} / ${total} contacts`;
|
||||
|
||||
// Compute category counts from all records (unfiltered)
|
||||
const catCounts = {};
|
||||
for (const r of crmRecords) {
|
||||
const cat = (r.category || "Uncategorized").trim();
|
||||
catCounts[cat] = (catCounts[cat] || 0) + 1;
|
||||
}
|
||||
const catContainer = document.getElementById("crm-category-counts");
|
||||
if (catContainer) {
|
||||
catContainer.innerHTML = Object.entries(catCounts)
|
||||
.sort((a, b) => b[1] - a[1])
|
||||
.map(
|
||||
([cat, cnt]) =>
|
||||
`<span style="font-size:11px;color:var(--text-muted);background:var(--bg-input);border:1px solid var(--border);border-radius:4px;padding:1px 6px;white-space:nowrap">${escHtml(cat)}: ${cnt}</span>`,
|
||||
)
|
||||
.join("");
|
||||
}
|
||||
|
||||
// Reset check-all state
|
||||
const checkAll = document.getElementById("crm-check-all");
|
||||
if (checkAll) checkAll.checked = false;
|
||||
|
||||
Reference in New Issue
Block a user