source: Klonkt/src/views/pages/fan-gate.ejs@ b9dc94c

main
Last change on this file since b9dc94c was b9dc94c, checked in by roboburr <roboburr@…>, 3 months ago

Release scheduling + fan-only previews (premium feature #3)

  • DB: posts.publish_at (scheduled go-live) + posts.fan_only.
  • Release scheduling: published + future publish_at -> status 'scheduled' (excluded from public status='published' queries). Scheduler.js publishes them when the time is reached (setInterval 60s + on boot) + adds them to posts_fts. No public queries changed -> low risk.
  • Fan-only: posts.fan_only; the single-post view shows anonymous visitors a clean login gate (pages/fan-gate.ejs, link /auth/login?next=) instead of the content; logged-in fans see everything. Listings show the teaser.
  • create/save: read publish_at + fan_only; FTS excludes 'scheduled'.
  • editor (post-edit): premium-gated fields "Fans only" + "Publish on" (datetime-local) + "scheduled for" notice.
  • server.js: startScheduler() after initializeDatabase.

node --check passed.

Co-Authored-By: Claude <noreply@…>

  • Property mode set to 100644
File size: 1.0 KB
Line 
1<section class="fg">
2 <div class="fg-card">
3 <div class="fg-lock">🔒</div>
4 <h1 class="fg-h1">Alleen voor fans</h1>
5 <% if (typeof fgTitle !== 'undefined' && fgTitle) { %><p class="fg-which">"<%= fgTitle %>"</p><% } %>
6 <p class="fg-sub">Dit is exclusief voor ingelogde fans. Log in om het te bekijken.</p>
7 <p><a class="fg-btn" href="/auth/login?next=<%= encodeURIComponent(fgNext || '/') %>">Inloggen / aanmelden</a></p>
8 </div>
9</section>
10
11<style>
12 .fg { max-width: 480px; margin: 0 auto; padding: 56px 18px; text-align: center; }
13 .fg-card { border: 1px solid rgba(128,128,128,.2); border-radius: 18px; padding: 36px 28px; }
14 .fg-lock { font-size: 40px; margin-bottom: 8px; }
15 .fg-h1 { font-size: 26px; margin: 0 0 6px; }
16 .fg-which { font-style: italic; opacity: .8; margin: 0 0 12px; }
17 .fg-sub { opacity: .85; line-height: 1.6; margin: 0 0 20px; }
18 .fg-btn { display: inline-block; padding: 12px 22px; border-radius: 10px; background: var(--accent,#6b8f71); color: #fff; text-decoration: none; font-weight: 600; }
19</style>
Note: See TracBrowser for help on using the repository browser.