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;
|
||||
|
||||
+10
@@ -796,6 +796,16 @@
|
||||
Delete Checked
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
class="form-group"
|
||||
style="
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
"
|
||||
id="crm-category-counts"
|
||||
></div>
|
||||
<span style="flex: 1; min-width: 0"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user