Downline Banners (Marty 2026-11-13: keep the name): renamed everywhere members see it, new stacked-banner logo + favicon; network sign-in (arrive signed in from InstantAdPay/LinkSpin as your wallet); share links, sponsor and directs use network usernames (?ref=username resolves through InstantAdPay)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-13 07:35:22 -06:00
parent 63199e767a
commit 0507c1a815
15 changed files with 302 additions and 55 deletions
+4 -2
View File
@@ -7,6 +7,8 @@
const c = await BL.getConfig();
const me = await BL.getJSON('/api/me');
if (!me.signedIn) {
// network sign-in (2026-11-13): signed in on InstantAdPay already? One quick hop there and back signs you in here too
try { const ss = await BL.getJSON('/api/sso/status'); if (ss && ss.check) { location.replace('/sso/start?mode=check&to=' + encodeURIComponent('/my' + location.hash)); return; } } catch (e) {}
$('signin').hidden = false;
$('signBtn').onclick = async () => {
try { BL.status('Check your wallet for the sign-in message.'); await BLWallet.signIn(); location.reload(); }
@@ -18,7 +20,7 @@
async function load() {
const d = await BL.getJSON('/api/my');
if (d.error) return BL.status(d.error, 'err');
$('dash').hidden = false; $('me').textContent = d.address;
$('dash').hidden = false; $('me').textContent = d.username ? '@' + d.username + ' (' + BL.short(d.address) + ')' : d.address;
const delivered = d.spots.reduce((t, s) => t + s.views, 0);
$('stats').innerHTML = [['Spots owned', d.spots.length], ['Views delivered', delivered + ' of ' + d.spots.filter(s => s.kind !== 3).length * c.viewsOwed],
['POL paid in', BL.fmtPol(d.paidInWei)], ['POL paid out to you', BL.fmtPol(d.paidOutWei)]]
@@ -30,7 +32,7 @@
for (const s of d.spots) box.appendChild(editor('spot', s));
$('defaults').innerHTML = ''; $('defaults').appendChild(editor('default', { img: d.defaults.img || '', link: d.defaults.link || '', showing: { img: d.defaults.img || '/art/house-line.svg' } }));
$('payouts').innerHTML = d.payouts.length ? '<table class="tbl"><tr><th>Spot sold</th><th>Why</th><th>POL</th><th>Tx</th></tr>' + d.payouts.map(p => '<tr><td>#' + p.spotId + '</td><td>' + esc(ROLE[p.role] || p.role) + '</td><td>' + BL.fmtPol(p.amount, 6) + '</td><td class="mono small">' + txLink(p.tx) + '</td></tr>').join('') + '</table>' : '<p class="muted">No payments yet. You are paid when spots sell after yours, or when someone you referred buys.</p>';
$('directs').innerHTML = d.directs.length ? '<table class="tbl"><tr><th>Member</th><th>Joined</th><th>Spots</th><th>Paid spots</th><th>POL paid in</th></tr>' + d.directs.map(m => '<tr><td class="mono small">' + esc(BL.short(m.address)) + '</td><td>' + new Date(m.joinedAt).toLocaleDateString() + '</td><td>' + m.spots + '</td><td>' + m.paidSpots + '</td><td>' + BL.fmtPol(m.paidInWei) + '</td></tr>').join('') + '</table>' : '<p class="muted">Nobody has joined through your link yet.</p>';
$('directs').innerHTML = d.directs.length ? '<table class="tbl"><tr><th>Member</th><th>Joined</th><th>Spots</th><th>Paid spots</th><th>POL paid in</th></tr>' + d.directs.map(m => '<tr><td class="mono small">' + esc(m.username ? '@' + m.username : BL.short(m.address)) + '</td><td>' + new Date(m.joinedAt).toLocaleDateString() + '</td><td>' + m.spots + '</td><td>' + m.paidSpots + '</td><td>' + BL.fmtPol(m.paidInWei) + '</td></tr>').join('') + '</table>' : '<p class="muted">Nobody has joined through your link yet.</p>';
}
const txLink = h => c.explorer ? '<a target="_blank" rel="noopener" href="' + esc(c.explorer + '/tx/' + h) + '">' + esc(h.slice(0, 10)) + '...</a>' : esc(h.slice(0, 10)) + '...';
function editor(kind, s) {