Launch week: Founder badge + launch week contest (Marty approved 2026-11-05, PLAN.md options B and C)
Founder badge (cosmetic only: no credits, no POL, no perks, never posted to Telegram) - Criterion: the account's earliest signed-in visit is before the launch moment (launchAt, default 2026-11-15T06:00:00-06:00). Field: accounts.firstSeen, else lastSeen. Both are written only by accounts.touchSeen() on signed-in requests (dashboard, ping, chat); touchSeen now keeps firstSeen = the previous lastSeen on the next visit, so a pre-launch member who signs in again after launch still qualifies. Carried-over shells that never signed in have neither field and never qualify. - Stored flag accounts.founder (JSON + MySQL column). Grant: launchweek.tick every 10 minutes from the launch moment, idempotent, one run per 10-minute slot across app copies (marks.claim); founderGrant '0' turns it off. Admin preview + "Grant Founder badges now" (refused before launch). - Shown in the badge strip (on the way before launch, Share works, no Telegram post), wall (wall-founder.js), Team rows (my.js + team.js), the Team activity chip, and next to names on /leaderboard. Art: /badges/badge-founder.jpg, drawn in code in the existing card layout. Launch week contest - Window [launchContestStart or launchAt, launchContestEnd) = Sun Nov 15 6:00 AM to the end of Sat Nov 21, Central (end stored exclusive, 2026-11-22T00:00:00-06:00). Count = the weekly board's tier-1 TierPaid sales. Never counted: own positions, buys by linked positions (Qualified Start), the admin account and overrideHouseIds (as contestants or buyers), launchContestExcludeEmails/Ids. launchContestMinSales 2. Ties: sales, dollars, who got there first. Prizes launchContestPrizesPol '10,6,4'. - Payout only by Admin > Launch week > Pay launch contest: the ranking is frozen on the first press, the admin's confirmed list must match it, balance + gas checked first, each place claimed once (marks.claim) and written as sending before award(memberId) from the Level 4 override payer wallet (override.payerHandle). Records tx hashes; resolve paid-with-tx or retry for blocked/failed/review. The prize email + feed line say "Launch week contest prize". - /leaderboard panel from the launch moment until the prizes are paid; /launch copy states both rules. - chatbot: CANNED founder-badge + launch-contest, FACTS lines (no amounts quoted before launch). - qa/launchweek.test.cjs (16 checks: Central window bounds, exclusions, minimum, two-copy payout once, frozen result, Founder criterion + grant, touchSeen backfill); run.sh launchweek and in all. - Versions: my.js?v=20261105fd, team.js?v=20261105fd, wall-founder.js?v=20261105fd, admin-launchweek.js?v=20261105lw (wall.js unchanged: the shared policy test pins it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+9
-1
@@ -485,6 +485,14 @@
|
||||
<p><select id="ovWeek"></select> <button class="btn small sec" type="button" id="ovShow">Show week</button> <button class="btn small" type="button" id="ovPay" hidden>Pay this week now</button></p>
|
||||
<div id="ovOut" class="small"></div>
|
||||
</div>
|
||||
<div class="card" id="lwCard">
|
||||
<div class="card-head"><h3>Launch week</h3><span class="sub">Founder badge (cosmetic) and the launch week contest (POL prizes, paid only from this button)</span></div>
|
||||
<p class="small" id="lwFounder">…</p>
|
||||
<p class="small" id="lwWindow"></p>
|
||||
<div id="lwStand" class="small"></div>
|
||||
<div id="lwPayouts" class="small"></div>
|
||||
<p><button class="btn small sec" type="button" id="lwRefresh">Refresh</button> <button class="btn small sec" type="button" id="lwGrant" hidden>Grant Founder badges now</button> <button class="btn small" type="button" id="lwPay" hidden>Pay launch contest</button></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pane" id="pane-settings" hidden>
|
||||
<div class="card" id="kitCard">
|
||||
@@ -542,6 +550,6 @@
|
||||
|
||||
<script src="/assets/common.js?v=20261105po"></script>
|
||||
<script src="/assets/admin-kb.js?v=20261020kb"></script>
|
||||
<script src="/assets/admin.js?v=20261101t"></script><script src="/assets/admin-sponsorcheck.js?v=20261022sc"></script><script src="/assets/admin-refill.js?v=20261024rf"></script><script src="/assets/admin-kits.js?v=20261024kit"></script>
|
||||
<script src="/assets/admin.js?v=20261101t"></script><script src="/assets/admin-sponsorcheck.js?v=20261022sc"></script><script src="/assets/admin-refill.js?v=20261024rf"></script><script src="/assets/admin-kits.js?v=20261024kit"></script><script src="/assets/admin-launchweek.js?v=20261105lw"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
// Admin > Launch week (2026-11-05): Founder badge preview + grant, launch contest standings and the "Pay launch contest" button.
|
||||
// The pay button sends real POL from the Level 4 override payer wallet. It shows the frozen ranking and amounts first and
|
||||
// sends exactly that list; the server refuses if anything changed, and every place is paid at most once.
|
||||
(function () {
|
||||
const $ = IAP.$;
|
||||
if (!$('lwCard')) return;
|
||||
const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
||||
async function api(path, body) {
|
||||
const r = await (await fetch(path, body === undefined ? { cache: 'no-store' } : { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) })).json();
|
||||
if (r.error) throw new Error(r.error === 'auth' ? 'Session expired. Sign in again.' : r.error);
|
||||
return r;
|
||||
}
|
||||
let last = null;
|
||||
async function load() {
|
||||
let r; try { r = await api('/api/admin/launch-week'); } catch (e) { $('lwFounder').textContent = 'Could not read launch week: ' + e.message; return; }
|
||||
last = r;
|
||||
const f = r.founder || {};
|
||||
$('lwFounder').innerHTML = '<b>Founder badge</b> (cosmetic): accounts whose earliest signed-in visit (' + esc(f.field) + ') is before ' + esc(f.launchAtCT) + ' Central. '
|
||||
+ '<b>' + (f.qualify || 0) + '</b> qualify today of ' + (f.accounts || 0) + ' accounts (' + (f.neverSignedIn || 0) + ' never signed in). Granted: ' + (f.granted || 0) + ', still to grant: ' + (f.missing || 0) + '. '
|
||||
+ (f.launched ? 'Launch has passed; the automatic grant runs every 10 minutes' : 'The automatic grant starts at the launch moment') + (f.autoGrant ? '.' : ' (switched OFF: founderGrant = 0).');
|
||||
$('lwGrant').hidden = !f.launched;
|
||||
const w = r.window || {};
|
||||
$('lwWindow').innerHTML = '<b>Launch week contest</b>: ' + esc(w.startCT) + ' to ' + esc(w.endCT) + ' Central · ' + (w.open ? (w.started ? 'OPEN' : 'not started') : 'CLOSED')
|
||||
+ ' · minimum ' + r.minSales + ' sales to place · prizes ' + (r.prizes || []).map((p, i) => (i + 1) + ': ' + p + ' POL').join(', ')
|
||||
+ ' · excluded: ' + esc((r.excluded.emails || []).join(', ')) + ' and member #' + esc((r.excluded.ids || []).join(', #'))
|
||||
+ ' · payer ' + (r.payer.keyPresent ? esc(r.payer.address) + ' holds ' + esc(r.payer.balancePol || '?') + ' POL' : 'NOT configured');
|
||||
$('lwStand').innerHTML = (r.standings || []).length ? '<table><tr><th>#</th><th>Member</th><th>Pays to</th><th>Sales</th><th>$</th><th>Places?</th></tr>' + r.standings.map(x => '<tr><td>' + x.rank + '</td><td>' + esc(x.name) + ' <span class="muted">' + esc(x.email) + '</span></td><td>#' + x.memberId + '</td><td>' + x.sales + '</td><td>$' + x.usd + '</td><td>' + (x.qualifies ? 'yes' : 'no') + '</td></tr>').join('') + '</table>' : '<p class="muted">No counted sales in the window yet.</p>';
|
||||
$('lwPayouts').innerHTML = (r.payouts || []).length ? '<p><b>Payout records</b> (frozen ' + new Date(r.frozen.at).toLocaleString('en-US', { timeZone: 'America/Chicago' }) + ' CT)</p><table><tr><th>Place</th><th>Member</th><th>POL</th><th>State</th><th>Tx</th></tr>' + r.payouts.map(x => '<tr><td>' + x.place + '</td><td>' + esc(x.name) + ' #' + x.memberId + '</td><td>' + esc(x.pol) + '</td><td>' + esc(x.state) + (x.note ? ' <span class="muted">' + esc(x.note) + '</span>' : '') + '</td><td>' + (x.tx ? '<a href="' + esc(x.tx) + '" target="_blank" rel="noopener">tx</a>' : '') + '</td></tr>').join('') + '</table>' : '';
|
||||
$('lwPay').hidden = !r.canPay || !(r.wouldPay || []).length || (r.payouts || []).length && r.payouts.every(x => x.state === 'paid');
|
||||
}
|
||||
$('lwRefresh').addEventListener('click', load);
|
||||
$('lwGrant').addEventListener('click', async () => {
|
||||
try { const r = await api('/api/admin/launch-week/founders', {}); IAP.status('Founder badge: granted to ' + (r.granted || 0) + ' accounts' + (r.skipped ? ' (' + r.skipped + ')' : '') + '.', 'ok'); load(); } catch (e) { IAP.status(e.message, 'bad'); }
|
||||
});
|
||||
$('lwPay').addEventListener('click', async () => {
|
||||
await load(); if (!last) return;
|
||||
const list = last.wouldPay || []; if (!list.length) { IAP.status('Nobody placed: nothing to pay.', 'bad'); return; }
|
||||
const total = list.reduce((n, x) => n + Number(x.pol), 0);
|
||||
const text = list.map(x => 'Place ' + x.place + ': ' + x.name + ' (member #' + x.memberId + ', ' + x.sales + ' sales) gets ' + x.pol + ' POL').join('\n') + '\n\nTotal ' + total + ' POL plus gas, sent from the payer wallet with award(memberId). Each place is paid once.';
|
||||
if (!await IAP.confirmBox(text, { title: 'Pay the launch week contest?', ok: 'Pay ' + total + ' POL', cancel: 'Cancel' })) return;
|
||||
try { const r = await api('/api/admin/launch-week/pay', { confirm: true, places: list.map(x => ({ place: x.place, memberId: x.memberId, pol: x.pol })) }); IAP.status('Launch contest: ' + (r.paidNow || 0) + ' paid now.', 'ok'); load(); } catch (e) { IAP.status(e.message, 'bad'); load(); }
|
||||
});
|
||||
load();
|
||||
})();
|
||||
+10
-6
@@ -83,7 +83,9 @@
|
||||
{ key: 'payouts', label: 'Spark', sub: 'payouts on', img: '/badges/badge-spark.jpg', ribbonY: 0.873 },
|
||||
{ key: 'firstBuyer', label: 'Surge', sub: 'first qualifying buyer', img: '/badges/badge-surge.jpg?v=2', ribbonY: 0.873 },
|
||||
{ key: 'level2', label: 'Circuit', sub: '2 qualifying buyers', img: '/badges/badge-circuit.jpg?v=2', ribbonY: 0.873 },
|
||||
{ key: 'level3', label: 'Nexus', sub: 'fully qualified', img: '/badges/badge-nexus.jpg?v=2', ribbonY: 0.873 }
|
||||
{ key: 'level3', label: 'Nexus', sub: 'fully qualified', img: '/badges/badge-nexus.jpg?v=2', ribbonY: 0.873 },
|
||||
// Founder (2026-11-05): cosmetic, stored on the account, granted at the launch moment to everyone who signed in before it
|
||||
{ key: 'founder', label: 'Founder', sub: 'in before launch', img: '/badges/badge-founder.jpg?v=1', ribbonY: 0.873, extra: true }
|
||||
];
|
||||
let lastMilestones = [];
|
||||
function renderBadges(d) {
|
||||
@@ -92,12 +94,14 @@
|
||||
const strip = $('badgeStrip');
|
||||
if (!strip) return;
|
||||
$('badgeCard').hidden = false;
|
||||
strip.innerHTML = BADGES.map(b => {
|
||||
const got = reached.includes(b.key);
|
||||
const held = reached.concat(d.founder ? ['founder'] : []);
|
||||
strip.innerHTML = BADGES.filter(b => !b.extra || d.founder || d.founderPending).map(b => {
|
||||
const got = held.includes(b.key);
|
||||
return '<div class="badge-a' + (got ? '' : ' locked') + '">'
|
||||
+ '<img class="badge-img" src="' + b.img + '" alt="' + b.label + ' badge" loading="lazy">'
|
||||
+ '<div class="bl">' + b.label + '</div><div class="bs">' + b.sub + '</div>'
|
||||
+ (got ? '<button class="share" data-badge="' + b.key + '">Share</button> <button class="share" data-badgepost="' + b.key + '" hidden>Post to Telegram</button>' : '<div class="bs">🔒 locked</div>') + '</div>';
|
||||
+ (got ? '<button class="share" data-badge="' + b.key + '">Share</button>' + (b.extra ? '' : ' <button class="share" data-badgepost="' + b.key + '" hidden>Post to Telegram</button>')
|
||||
: b.key === 'founder' ? '<div class="bs">arrives at launch, Sunday Nov 15</div>' : '<div class="bs">🔒 locked</div>') + '</div>';
|
||||
}).join('');
|
||||
strip.querySelectorAll('[data-badge]').forEach(btn =>
|
||||
btn.addEventListener('click', () => shareBadge(btn.dataset.badge, d)));
|
||||
@@ -1547,7 +1551,7 @@
|
||||
}
|
||||
el.innerHTML = r.levels.map(L => !L.members.length ? '' :
|
||||
'<div class="lin-lvl"><div class="cap">Level ' + L.level + ' · ' + L.members.length + (L.level === 1 ? ' direct' : '') + '</div>'
|
||||
+ L.members.map(m => '<div class="lin-row' + (m.own ? ' own' : '') + '"><span class="nm">' + esc(m.name) + (m.own ? ' <span class="badge">yours</span>' : '') + '</span>'
|
||||
+ L.members.map(m => '<div class="lin-row' + (m.own ? ' own' : '') + '"><span class="nm">' + esc(m.name) + (m.own ? ' <span class="badge">yours</span>' : '') + (m.founder ? ' <span class="badge" title="Founder badge: signed in before LinkSpin launched" style="background:#ffc94d;border-color:#ffc94d;color:#5a3f00">Founder</span>' : '') + '</span>'
|
||||
+ '<span class="em">' + (m.email ? esc(m.email) : (m.memberId ? '<span class="id">#' + m.memberId + '</span>' : '')) + (m.sponsor ? '<span class="sp">sponsored by ' + esc(m.sponsor) + '</span>' : '') + (m.own ? '' : '<span class="sp">' + (m.bought ? '$25+ buy ✓' : 'no $25+ buy yet') + (m.buyers ? ' · ' + m.buyers + ' qualifying buyer' + (m.buyers === 1 ? '' : 's') + ' of their own' : '') + '</span>') + '</span>'
|
||||
+ '<span class="earn' + (m.earnedWei && m.earnedWei !== '0' ? ' on' : '') + '" title="POL this person has paid you so far">'
|
||||
+ (m.earnedWei && m.earnedWei !== '0' ? '+' + IAP.fmtPol(m.earnedWei) + ' POL' : '0.00 POL') + '</span>'
|
||||
@@ -1584,7 +1588,7 @@
|
||||
+ chip('Link', (a.linkViews30 || 0) + ' views (30d) · ' + (a.joins || 0) + ' joined', (a.linkViews30 || 0) > 0 ? 'on' : '')
|
||||
+ chip('Line', (a.directs || 0) + ' direct' + (a.directs === 1 ? '' : 's') + ' · ' + (a.buyerCount || 0) + ' qualifying', (a.buyerCount || 0) > 0 ? 'on' : '')
|
||||
+ chip('Wallet', a.wallet ? (a.badges && a.badges.includes('payouts') ? 'linked · payouts on' : 'linked') : 'not linked', a.wallet ? '' : 'warn')
|
||||
+ (a.badges && a.badges.length ? chip('Badges', a.badges.map(b => ({ payouts: 'Spark', firstBuyer: 'Surge', level2: 'Circuit', level3: 'Nexus' }[b] || b)).join(' · ')) : '')
|
||||
+ (a.badges && a.badges.length ? chip('Badges', a.badges.map(b => ({ payouts: 'Spark', firstBuyer: 'Surge', level2: 'Circuit', level3: 'Nexus', founder: 'Founder' }[b] || b)).join(' · ')) : '')
|
||||
+ '<span class="lin-verdict' + (working ? ' on' : '') + '">' + (working ? 'Working' : 'Quiet') + '</span>';
|
||||
}
|
||||
async function loadUplineMessages() {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
const ms = rows(); const L = (LINE && LINE.levels || []).find(x => x.level === LEVEL); const total = L ? L.members.length : 0;
|
||||
$('rows').innerHTML = ms.length ? ms.map(m => { const today = (m.lastSeen || 0) >= dayStart();
|
||||
const sg = stageOf(m), q = quiet(m);
|
||||
return '<div class="rw st-row' + (q ? ' stalled' : '') + '" data-st="' + sg + '"><div><b>' + esc(m.name) + (m.own ? ' <span class="tag dim">YOURS</span>' : '') + '</b><br><span class="mono muted" style="font-size:11px">' + (m.memberId ? '#' + m.memberId + ' · ' : '') + 'joined ' + new Date(m.joined).toLocaleDateString() + (m.bought ? ' · $25+ buy' : '') + (m.buyers ? ' · ' + m.buyers + ' qualifying' : '') + '</span></div>'
|
||||
return '<div class="rw st-row' + (q ? ' stalled' : '') + '" data-st="' + sg + '"><div><b>' + esc(m.name) + (m.own ? ' <span class="tag dim">YOURS</span>' : '') + (m.founder ? ' <span class="tag" title="Founder badge: signed in before LinkSpin launched" style="background:#ffc94d;color:#5a3f00">FOUNDER</span>' : '') + '</b><br><span class="mono muted" style="font-size:11px">' + (m.memberId ? '#' + m.memberId + ' · ' : '') + 'joined ' + new Date(m.joined).toLocaleDateString() + (m.bought ? ' · $25+ buy' : '') + (m.buyers ? ' · ' + m.buyers + ' qualifying' : '') + '</span></div>'
|
||||
+ '<span class="mono ' + (today ? 'ok' : (m.lastSeen && Date.now() - m.lastSeen > 3 * 86400e3 ? 'warn' : '')) + '" style="font-size:12px">' + (today ? 'today' : ago(m.lastSeen)) + '</span>'
|
||||
+ '<span><span class="stg" data-st="' + sg + '">' + STAGE[sg] + '</span>' + (q ? '<br><span class="stg quiet">' + (m.lastSeen ? 'quiet ' + Math.floor((Date.now() - m.lastSeen) / 86400e3) + 'd' : 'never signed in') + '</span>' : '') + '</span>'
|
||||
+ '<span class="r num">' + (m.earnedWei && m.earnedWei !== '0' ? '+' + pol(m.earnedWei) + ' POL' : '<span class="muted">0</span>') + '</span>'
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// The Founder badge on a member's wall (2026-11-05, cosmetic). Kept apart from wall.js, which a shared policy test pins by version.
|
||||
(async function () {
|
||||
const img = document.getElementById('bioFounder'); if (!img) return;
|
||||
const name = location.pathname.split('/').pop();
|
||||
try {
|
||||
const w = await (await fetch('/api/wall/' + encodeURIComponent(name))).json();
|
||||
if (w && w.founder && w.founder.img) { img.src = w.founder.img; img.title = 'Founder badge: signed in before LinkSpin launched'; img.hidden = false; }
|
||||
} catch (e) {}
|
||||
})();
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 154 KiB |
+1
-1
@@ -55,7 +55,7 @@
|
||||
<p class="eyebrow">Launch week · Sunday, November 15, 6 AM Central</p>
|
||||
<h1>Eight things before <em>Sunday</em>.</h1>
|
||||
<p class="lead">LinkSpin is open for pre-launch now and opens to the world on Sunday, November 15 at 6 AM Central. Get these done before then, in this order, so your line is set up when everyone else arrives. Everything here reads from your live account.</p>
|
||||
<div class="lw-rule" style="margin-top:18px"><b>New for launch week</b>Members who are in before launch get a Founder badge on their profile (the exact rule is posted before Sunday). And from Sunday, November 15 through Saturday, November 21, the leaderboard runs a launch week contest with POL prizes for the top sponsors. Prize details are announced on launch day.</div>
|
||||
<div class="lw-rule" style="margin-top:18px"><b>New for launch week</b>Founder badge: every account that signs in at least once before Sunday, November 15 at 6 AM Central gets the Founder badge on launch morning. It shows on your badges, your wall, your sponsor's Team list and the leaderboard. It is a badge only, nothing else comes with it. Launch week contest: from Sunday, November 15 at 6 AM through Saturday, November 21 at 11:59 PM Central, the <a href="/leaderboard">leaderboard</a> ranks members by packages bought by the people they sponsor directly (at least 2 to place). The top 3 win POL, paid to the wallet on file after the week closes. Prize details are on the leaderboard from launch morning.</div>
|
||||
</section>
|
||||
|
||||
<div class="card" id="gate"><h3>Members only</h3><p class="muted small">Sign in to your member area to open the checklist. <a href="/links">Sign in</a></p></div>
|
||||
|
||||
+1
-1
@@ -1020,7 +1020,7 @@
|
||||
<script src="/assets/tools.js?v=20261011a"></script>
|
||||
<script src="/assets/wallet.js?v=20261021a"></script>
|
||||
<script src="/assets/promo.js?v=20261020bs3"></script>
|
||||
<script src="/assets/my.js?v=20261105lw"></script>
|
||||
<script src="/assets/my.js?v=20261105fd"></script>
|
||||
<script src="/assets/chat.js?v=20261016a"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -39,6 +39,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/cr-shell.js?v=20261102a"></script>
|
||||
<script src="/assets/team.js?v=20261020s"></script>
|
||||
<script src="/assets/team.js?v=20261105fd"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<div class="bio-head" id="bioHead" hidden>
|
||||
<img id="bioAvatar" class="bio-avatar" alt="" hidden>
|
||||
<img id="bioBadge" class="bio-badge" alt="achievement badge" hidden>
|
||||
<img id="bioFounder" class="bio-badge" alt="Founder badge" hidden>
|
||||
<div class="bio-meta">
|
||||
<p class="eyebrow">Your sponsor on LinkSpin</p>
|
||||
<h2 id="wallTitle" style="margin:.1em 0">Loading…</h2>
|
||||
@@ -50,5 +51,6 @@
|
||||
</section>
|
||||
<script src="/assets/common.js?v=20261105po"></script>
|
||||
<script src="/assets/wall.js?v=20261030pp"></script>
|
||||
<script src="/assets/wall-founder.js?v=20261105fd"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user