Credits column: balance view = credits left, all-time view = total purchased
This commit is contained in:
1 parent
585f133412
commit
345eca7f1e
1 file changed
+12
-7
+12
-7
@@ -274,7 +274,9 @@ PAGE_HTML = """<!DOCTYPE html>
|
|||||||
.range-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
|
.range-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
|
||||||
.range-btn { cursor: pointer; border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 8px; font-size: 12px; font-weight: 600; padding: 5px 12px; }
|
.range-btn { cursor: pointer; border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 8px; font-size: 12px; font-weight: 600; padding: 5px 12px; }
|
||||||
.range-btn.active { background: var(--green-mid); color: #fff; border-color: var(--green-mid); }
|
.range-btn.active { background: var(--green-mid); color: #fff; border-color: var(--green-mid); }
|
||||||
.members-all-time .balance-col { display: none; }
|
.members-all-time .balance-col.allowance-only,
|
||||||
|
.members-all-time .balance-col.remaining-only { display: none; }
|
||||||
|
.members-all-time .credits-col-head .mode-note::after { content: " (total purchased)"; }
|
||||||
.table-scroll { overflow-x: auto; border-radius: 12px; }
|
.table-scroll { overflow-x: auto; border-radius: 12px; }
|
||||||
.table-scroll table { min-width: 980px; }
|
.table-scroll table { min-width: 980px; }
|
||||||
th.sortable { cursor: pointer; user-select: none; }
|
th.sortable { cursor: pointer; user-select: none; }
|
||||||
@@ -322,8 +324,8 @@ PAGE_HTML = """<!DOCTYPE html>
|
|||||||
<th class="sortable" onclick="sortMembers('active')">Status<span class="arrow" id="arrow-members-active"></span></th>
|
<th class="sortable" onclick="sortMembers('active')">Status<span class="arrow" id="arrow-members-active"></span></th>
|
||||||
<th class="sortable" onclick="sortMembers('activated')">Activated<span class="arrow" id="arrow-members-activated"></span></th>
|
<th class="sortable" onclick="sortMembers('activated')">Activated<span class="arrow" id="arrow-members-activated"></span></th>
|
||||||
<th class="sortable" onclick="sortMembers('manual')">Source<span class="arrow" id="arrow-members-manual"></span></th>
|
<th class="sortable" onclick="sortMembers('manual')">Source<span class="arrow" id="arrow-members-manual"></span></th>
|
||||||
<th class="sortable balance-col" onclick="sortMembers('balance')">Allowance<span class="arrow" id="arrow-members-balance"></span></th>
|
<th class="sortable balance-col allowance-only" onclick="sortMembers('balance')">Allowance<span class="arrow" id="arrow-members-balance"></span></th>
|
||||||
<th class="sortable balance-col" onclick="sortMembers('credit_balance')">Credits<span class="arrow" id="arrow-members-credit_balance"></span></th>
|
<th class="sortable balance-col credits-col-head" onclick="sortMembers('credit_balance')">Credits<span class="mode-note"></span><span class="arrow" id="arrow-members-credit_balance"></span></th>
|
||||||
<th class="sortable" onclick="sortMembers('spend')"><span id="spend-mode-label">Spend</span><span class="arrow" id="arrow-members-spend"></span></th>
|
<th class="sortable" onclick="sortMembers('spend')"><span id="spend-mode-label">Spend</span><span class="arrow" id="arrow-members-spend"></span></th>
|
||||||
<th class="sortable balance-col" onclick="sortMembers('remaining')">Remaining<span class="arrow" id="arrow-members-remaining"></span></th>
|
<th class="sortable balance-col" onclick="sortMembers('remaining')">Remaining<span class="arrow" id="arrow-members-remaining"></span></th>
|
||||||
<th class="sortable balance-col" onclick="sortMembers('reset_at')">Reset<span class="arrow" id="arrow-members-reset_at"></span></th>
|
<th class="sortable balance-col" onclick="sortMembers('reset_at')">Reset<span class="arrow" id="arrow-members-reset_at"></span></th>
|
||||||
@@ -483,8 +485,11 @@ function renderMembers() {
|
|||||||
? '<span class="pill active">yes</span>'
|
? '<span class="pill active">yes</span>'
|
||||||
: '<span class="pill inactive">pending</span>';
|
: '<span class="pill inactive">pending</span>';
|
||||||
const credits = m.credit_balance ?? 0;
|
const credits = m.credit_balance ?? 0;
|
||||||
const creditsCell = credits > 0
|
const creditsLeft = m.credits_remaining ?? credits;
|
||||||
? fmt(credits)
|
// Balance view: credits LEFT. All-time view: total purchased.
|
||||||
|
const creditsShown = memberMode === 'all' ? credits : creditsLeft;
|
||||||
|
const creditsCell = creditsShown > 0
|
||||||
|
? fmt(creditsShown)
|
||||||
: '<span style="color:var(--muted)">—</span>';
|
: '<span style="color:var(--muted)">—</span>';
|
||||||
const src = m.manual
|
const src = m.manual
|
||||||
? '<span class="pill manual" title="Manual member (no OC subscription; exempt from sweep)">manual</span>'
|
? '<span class="pill manual" title="Manual member (no OC subscription; exempt from sweep)">manual</span>'
|
||||||
@@ -494,10 +499,10 @@ function renderMembers() {
|
|||||||
'<td><span class="pill ' + pill + '">' + pill + '</span></td>' +
|
'<td><span class="pill ' + pill + '">' + pill + '</span></td>' +
|
||||||
'<td>' + act + '</td>' +
|
'<td>' + act + '</td>' +
|
||||||
'<td>' + src + '</td>' +
|
'<td>' + src + '</td>' +
|
||||||
'<td class="num balance-col">' + fmt(m.balance) + '</td>' +
|
'<td class="num balance-col allowance-only">' + fmt(m.balance) + '</td>' +
|
||||||
'<td class="num balance-col">' + creditsCell + '</td>' +
|
'<td class="num balance-col">' + creditsCell + '</td>' +
|
||||||
'<td class="num">' + fmt(memberSpend(m)) + '</td>' +
|
'<td class="num">' + fmt(memberSpend(m)) + '</td>' +
|
||||||
'<td class="num balance-col remaining-col">' + fmt(m.remaining) + '</td>' +
|
'<td class="num balance-col remaining-col remaining-only">' + fmt(m.remaining) + '</td>' +
|
||||||
'<td class="balance-col">' + esc(reset) + '</td>' +
|
'<td class="balance-col">' + esc(reset) + '</td>' +
|
||||||
'<td><div class="adjust">' +
|
'<td><div class="adjust">' +
|
||||||
'<input id="add-' + i(m.email) + '" placeholder="+$" />' +
|
'<input id="add-' + i(m.email) + '" placeholder="+$" />' +
|
||||||
|
|||||||
Reference in new issue
Block a user