diff --git a/app/main.py b/app/main.py index 42ed92c..144e317 100644 --- a/app/main.py +++ b/app/main.py @@ -630,7 +630,9 @@ PAGE_HTML = """ /* ---------- Guest access (members inviting a friend) ---------- */ .guest-hint { color: var(--muted); font-size: 12px; margin-bottom: 12px; } - .new-key .name-input { max-width: 200px; } + /* Standard guest-invite form (shared with the admin panel): ONE field. */ + .guest-invite-title { font-size: 14px; font-weight: 700; margin: 0 0 8px; } + .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } .guest-trail { margin-top: 6px; } .guest-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; @@ -843,11 +845,12 @@ PAGE_HTML = """
@@ -1018,9 +1021,13 @@ function renderGuests(d) { }).join(''); } -async function sendGuestInvite() { +// The standard guest-invite form (ONE field: the guest's email). The inviter +// is the logged-in member — automatic, no field; the portal applies the +// member-side protections (active member, one per 30 days, recipient checks) +// and, with the trial gate on, holds the request for approval. +async function sendGuestInvite(ev) { + if (ev) ev.preventDefault(); const email = ($('guest-email').value || '').trim(); - const name = ($('guest-name').value || '').trim(); const btn = $('guest-btn'); const label = btn.textContent; if (!email || email.indexOf('@') < 1) { flash('Enter their email address', false); return; } @@ -1029,7 +1036,7 @@ async function sendGuestInvite() { try { const r = await fetch('/api/guests', { method: 'POST', headers: {'Content-Type': 'application/json'}, - body: JSON.stringify({ email, name }) + body: JSON.stringify({ email }) }); const d = await r.json().catch(() => ({})); if (!r.ok || d.error) { @@ -1037,7 +1044,6 @@ async function sendGuestInvite() { return; } $('guest-email').value = ''; - $('guest-name').value = ''; flash(d.note || 'Request sent — waiting for approval.', true); await loadGuests(); } catch (e) {