refferal
This commit is contained in:
@@ -311,7 +311,7 @@ function dnsRender() {
|
|||||||
.getElementById("dns-filter-type")
|
.getElementById("dns-filter-type")
|
||||||
.value.toUpperCase();
|
.value.toUpperCase();
|
||||||
|
|
||||||
const HIDDEN_NAMES = ["fr", "n8n", "admin", "app", "@"];
|
const HIDDEN_NAMES = ["fr", "n8n", "usa", "admin", "app", "@"];
|
||||||
|
|
||||||
const filtered = dnsRecords.filter((r) => {
|
const filtered = dnsRecords.filter((r) => {
|
||||||
const name = r.name.toLowerCase();
|
const name = r.name.toLowerCase();
|
||||||
@@ -1419,6 +1419,9 @@ function crmRender() {
|
|||||||
const searchCategory = (
|
const searchCategory = (
|
||||||
document.getElementById("crm-search-category")?.value ?? ""
|
document.getElementById("crm-search-category")?.value ?? ""
|
||||||
).toLowerCase();
|
).toLowerCase();
|
||||||
|
const searchAffiliate = (
|
||||||
|
document.getElementById("crm-search-affiliate")?.value ?? ""
|
||||||
|
).toLowerCase();
|
||||||
|
|
||||||
let filtered = crmRecords.filter((r) => {
|
let filtered = crmRecords.filter((r) => {
|
||||||
const name = (r.Name ?? "").toLowerCase();
|
const name = (r.Name ?? "").toLowerCase();
|
||||||
@@ -1427,13 +1430,15 @@ function crmRender() {
|
|||||||
const stage = (r.Stage ?? "").toLowerCase();
|
const stage = (r.Stage ?? "").toLowerCase();
|
||||||
const strategy = (r.strategy ?? "").toLowerCase();
|
const strategy = (r.strategy ?? "").toLowerCase();
|
||||||
const category = (r.category ?? "").toLowerCase();
|
const category = (r.category ?? "").toLowerCase();
|
||||||
|
const affiliate = (r.affiliate ?? "").toLowerCase();
|
||||||
return (
|
return (
|
||||||
(!searchName || name.includes(searchName)) &&
|
(!searchName || name.includes(searchName)) &&
|
||||||
(!searchCompany || company.includes(searchCompany)) &&
|
(!searchCompany || company.includes(searchCompany)) &&
|
||||||
(!searchEmail || email.includes(searchEmail)) &&
|
(!searchEmail || email.includes(searchEmail)) &&
|
||||||
(!searchStage || stage.includes(searchStage)) &&
|
(!searchStage || stage.includes(searchStage)) &&
|
||||||
(!searchStrategy || strategy.includes(searchStrategy)) &&
|
(!searchStrategy || strategy.includes(searchStrategy)) &&
|
||||||
(!searchCategory || category.includes(searchCategory))
|
(!searchCategory || category.includes(searchCategory)) &&
|
||||||
|
(!searchAffiliate || affiliate.includes(searchAffiliate))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1467,7 +1472,7 @@ function crmRender() {
|
|||||||
|
|
||||||
const tbody = document.getElementById("crm-table-body");
|
const tbody = document.getElementById("crm-table-body");
|
||||||
if (filtered.length === 0) {
|
if (filtered.length === 0) {
|
||||||
tbody.innerHTML = `<tr><td colspan="8"><div class="empty-state">
|
tbody.innerHTML = `<tr><td colspan="9"><div class="empty-state">
|
||||||
<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
||||||
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
|
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
|
||||||
<circle cx="9" cy="7" r="4"/>
|
<circle cx="9" cy="7" r="4"/>
|
||||||
@@ -1484,11 +1489,11 @@ function crmRender() {
|
|||||||
.map((r) => {
|
.map((r) => {
|
||||||
const id = r.id;
|
const id = r.id;
|
||||||
const name = escHtml(r.Name ?? "");
|
const name = escHtml(r.Name ?? "");
|
||||||
const company = escHtml(r.Company ?? "");
|
|
||||||
const email = escHtml(r.email ?? "");
|
const email = escHtml(r.email ?? "");
|
||||||
const stage = escHtml(r.Stage ?? "");
|
const stage = escHtml(r.Stage ?? "");
|
||||||
const strategy = escHtml(r.strategy ?? "");
|
const strategy = escHtml(r.strategy ?? "");
|
||||||
const category = escHtml(r.category ?? "");
|
const category = escHtml(r.category ?? "");
|
||||||
|
const affiliate = escHtml(r.affiliate ?? "");
|
||||||
const dateNext = r.date_next_contact
|
const dateNext = r.date_next_contact
|
||||||
? formatDate(r.date_next_contact)
|
? formatDate(r.date_next_contact)
|
||||||
: "—";
|
: "—";
|
||||||
@@ -1501,6 +1506,7 @@ function crmRender() {
|
|||||||
<td><span class="badge ${stage === "Hold" ? "badge-other" : "badge-green"}">${stage || "—"}</span></td>
|
<td><span class="badge ${stage === "Hold" ? "badge-other" : "badge-green"}">${stage || "—"}</span></td>
|
||||||
<td style="max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap" title="${strategy}">${strategy || "—"}</td>
|
<td style="max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap" title="${strategy}">${strategy || "—"}</td>
|
||||||
<td>${category ? escHtml(category) : "—"}</td>
|
<td>${category ? escHtml(category) : "—"}</td>
|
||||||
|
<td>${affiliate || "—"}</td>
|
||||||
<td class="text-muted">${dateNext}</td>
|
<td class="text-muted">${dateNext}</td>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
})
|
})
|
||||||
@@ -1509,6 +1515,23 @@ function crmRender() {
|
|||||||
crmUpdateDeleteBtn();
|
crmUpdateDeleteBtn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ─── CRM — Clear all filters ──────────────────────────────────── */
|
||||||
|
function crmClearFilters() {
|
||||||
|
[
|
||||||
|
"name",
|
||||||
|
"company",
|
||||||
|
"email",
|
||||||
|
"stage",
|
||||||
|
"strategy",
|
||||||
|
"category",
|
||||||
|
"affiliate",
|
||||||
|
].forEach((f) => {
|
||||||
|
const el = document.getElementById("crm-search-" + f);
|
||||||
|
if (el) el.value = "";
|
||||||
|
});
|
||||||
|
crmRender();
|
||||||
|
}
|
||||||
|
|
||||||
/* ─── CRM — Sort ───────────────────────────────────────────────── */
|
/* ─── CRM — Sort ───────────────────────────────────────────────── */
|
||||||
function crmToggleSort(key) {
|
function crmToggleSort(key) {
|
||||||
if (crmSortKey === key) {
|
if (crmSortKey === key) {
|
||||||
|
|||||||
+88
-66
@@ -798,72 +798,6 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<span style="flex: 1; min-width: 0"></span>
|
<span style="flex: 1; min-width: 0"></span>
|
||||||
<div
|
|
||||||
class="form-group"
|
|
||||||
style="flex: 1; min-width: 120px"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="crm-search-name"
|
|
||||||
placeholder="Search Name…"
|
|
||||||
oninput="crmRender()"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="form-group"
|
|
||||||
style="flex: 1; min-width: 120px"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="crm-search-company"
|
|
||||||
placeholder="Search Company…"
|
|
||||||
oninput="crmRender()"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="form-group"
|
|
||||||
style="flex: 1; min-width: 140px"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="crm-search-email"
|
|
||||||
placeholder="Search Email…"
|
|
||||||
oninput="crmRender()"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="form-group"
|
|
||||||
style="flex: 1; min-width: 100px"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="crm-search-stage"
|
|
||||||
placeholder="Search Stage…"
|
|
||||||
oninput="crmRender()"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="form-group"
|
|
||||||
style="flex: 1; min-width: 120px"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="crm-search-strategy"
|
|
||||||
placeholder="Search Strategy…"
|
|
||||||
oninput="crmRender()"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="form-group"
|
|
||||||
style="flex: 1; min-width: 100px"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="crm-search-category"
|
|
||||||
placeholder="Search Category…"
|
|
||||||
oninput="crmRender()"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -991,6 +925,21 @@
|
|||||||
data-sort="category"
|
data-sort="category"
|
||||||
></span>
|
></span>
|
||||||
</th>
|
</th>
|
||||||
|
<th
|
||||||
|
onclick="
|
||||||
|
crmToggleSort('affiliate')
|
||||||
|
"
|
||||||
|
style="
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
Referral
|
||||||
|
<span
|
||||||
|
class="sort-arrow"
|
||||||
|
data-sort="affiliate"
|
||||||
|
></span>
|
||||||
|
</th>
|
||||||
<th
|
<th
|
||||||
onclick="
|
onclick="
|
||||||
crmToggleSort(
|
crmToggleSort(
|
||||||
@@ -1010,6 +959,79 @@
|
|||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
<tr class="crm-search-row">
|
||||||
|
<th></th>
|
||||||
|
<th>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
id="crm-search-name"
|
||||||
|
placeholder="Filter Name…"
|
||||||
|
oninput="crmRender()"
|
||||||
|
class="crm-filter-input"
|
||||||
|
/>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
id="crm-search-company"
|
||||||
|
placeholder="Filter Company…"
|
||||||
|
oninput="crmRender()"
|
||||||
|
class="crm-filter-input"
|
||||||
|
/>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
id="crm-search-email"
|
||||||
|
placeholder="Filter Email…"
|
||||||
|
oninput="crmRender()"
|
||||||
|
class="crm-filter-input"
|
||||||
|
/>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
id="crm-search-stage"
|
||||||
|
placeholder="Filter Stage…"
|
||||||
|
oninput="crmRender()"
|
||||||
|
class="crm-filter-input"
|
||||||
|
/>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
id="crm-search-strategy"
|
||||||
|
placeholder="Filter Strategy…"
|
||||||
|
oninput="crmRender()"
|
||||||
|
class="crm-filter-input"
|
||||||
|
/>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
id="crm-search-category"
|
||||||
|
placeholder="Filter Category…"
|
||||||
|
oninput="crmRender()"
|
||||||
|
class="crm-filter-input"
|
||||||
|
/>
|
||||||
|
</th>
|
||||||
|
<th style="white-space: nowrap">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
id="crm-search-affiliate"
|
||||||
|
placeholder="Filter Referral…"
|
||||||
|
oninput="crmRender()"
|
||||||
|
class="crm-filter-input"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
class="btn btn-ghost btn-sm"
|
||||||
|
onclick="crmClearFilters()"
|
||||||
|
title="Clear all filters"
|
||||||
|
>
|
||||||
|
✕
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
<tbody id="crm-table-body">
|
<tbody id="crm-table-body">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="9">
|
<td colspan="9">
|
||||||
|
|||||||
+21
@@ -819,3 +819,24 @@ hr.sep {
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
padding: 3px 0;
|
padding: 3px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ─── CRM filter inputs ──────────────────────────────────── */
|
||||||
|
.crm-filter-input {
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: var(--bg-input);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
color: var(--text);
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 4px 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-family: inherit;
|
||||||
|
}
|
||||||
|
.crm-filter-input:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: var(--border-hi);
|
||||||
|
}
|
||||||
|
.crm-search-row th {
|
||||||
|
padding: 6px 4px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user