source: Klonkt/src/views/pages/admin-shows.ejs@ 137cca5

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

feat(agenda): Agenda opt-in — only shown when enabled + active on /shows

  • New setting agenda_enabled (Admin → Agenda: toggle "Show agenda on the site").
  • Agenda button in the pill only appears when premium AND enabled.
  • /shows (+ /shows/notify) gated: disabled = 404 (not reachable).
  • On the agenda page, the Agenda item in the pill is now marked "active" (the pill stays visible there, as requested).

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

  • Property mode set to 100644
File size: 4.9 KB
Line 
1<%
2 var ss = (typeof shows !== 'undefined') ? shows : [];
3 var msg = (typeof msg !== 'undefined') ? msg : '';
4 var smtp = (typeof smtp !== 'undefined') ? smtp : false;
5 var nc = (typeof notifyCount !== 'undefined') ? notifyCount : 0;
6%>
7<section class="ash">
8 <p><a href="/admin" class="btn">&larr; Beheer</a></p>
9 <h1>Agenda</h1>
10
11 <% if (msg) { %><div class="ash-msg ash-<%= (typeof msgKind!=='undefined')?msgKind:'' %>"><%= msg %></div><% } %>
12
13 <% var agOn = (typeof agendaEnabled !== 'undefined') && agendaEnabled; %>
14 <form method="POST" action="<%= siteUrlBase %>/admin/shows/toggle" style="margin:0 0 14px">
15 <label style="display:flex;align-items:center;gap:10px;cursor:pointer;font-weight:600">
16 <input type="checkbox" name="enabled" value="1" <%= agOn ? 'checked' : '' %> onchange="this.form.submit()" style="width:18px;height:18px;accent-color:var(--accent)">
17 <span>Agenda tonen op de site <small style="font-weight:400;opacity:.7">(Agenda-knop in de balk + de agendapagina)</small></span>
18 </label>
19 <noscript><button type="submit" class="btn">Opslaan</button></noscript>
20 </form>
21 <% if (!agOn) { %><div class="ash-msg">De agenda staat nu <strong>uit</strong> — bezoekers zien geen Agenda-knop en de agendapagina is niet bereikbaar. Zet 'm aan om je evenementen te tonen.</div><% } %>
22
23 <p class="ash-note"><strong><%= nc %></strong> abonnee(s) voor evenement-aankondigingen.
24 <% if (!smtp) { %><br>⚠ SMTP niet ingesteld — evenementen worden opgeslagen, maar notify-mails kunnen pas verstuurd worden zodra je SMTP invult.<% } %></p>
25
26 <form method="POST" action="<%= siteUrlBase %>/admin/shows" class="ash-form">
27 <div class="ash-grid">
28 <label>Datum<input type="date" name="date" required></label>
29 <label>Tijd (optioneel)<input type="time" name="time"></label>
30 <label>Plaats<input type="text" name="city" required placeholder="Amsterdam"></label>
31 <label>Land (optioneel)<input type="text" name="country" placeholder="NL"></label>
32 <label class="ash-wide">Locatie/zaal (optioneel)<input type="text" name="venue" placeholder="Paradiso"></label>
33 <label class="ash-wide">Ticket-URL (optioneel)<input type="url" name="ticket_url" placeholder="https://..."></label>
34 <label class="ash-wide">Notitie (optioneel)<input type="text" name="notes" placeholder="Support: ..."></label>
35 </div>
36 <label class="ash-check"><input type="checkbox" name="notify" value="1" <%= smtp ? '' : 'disabled' %>> Abonnees per e-mail op de hoogte brengen<%= smtp ? '' : ' (SMTP vereist)' %></label>
37 <button type="submit" class="ash-add">+ Evenement toevoegen</button>
38 </form>
39
40 <% if (ss.length) { %>
41 <ul class="ash-list">
42 <% ss.forEach(function(s){ %>
43 <li class="ash-item">
44 <span class="ash-when"><%= s.date %><% if (s.time) { %> <%= s.time %><% } %></span>
45 <span class="ash-where"><%= s.city %><% if (s.venue) { %> — <%= s.venue %><% } %></span>
46 <form method="POST" action="<%= siteUrlBase %>/admin/shows/<%= s.id %>/delete" onsubmit="return confirm('Evenement verwijderen??')" style="margin:0">
47 <button type="submit" class="ash-del">🗑</button>
48 </form>
49 </li>
50 <% }); %>
51 </ul>
52 <% } else { %>
53 <p class="ash-empty">Nog geen evenementen.</p>
54 <% } %>
55</section>
56
57<style>
58 .ash { max-width: 680px; margin: 0 auto; padding: 24px 18px 64px; }
59 .ash h1 { margin: .4rem 0 14px; }
60 .ash-msg { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
61 .ash-ok { background: rgba(60,160,90,.15); } .ash-bad { background: rgba(200,60,60,.15); }
62 .ash-note { font-size: 13px; opacity: .8; margin: 0 0 18px; }
63 .ash-form { border: 1px solid rgba(128,128,128,.2); border-radius: 14px; padding: 16px; margin-bottom: 24px; }
64 .ash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
65 .ash-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }
66 .ash-grid .ash-wide { grid-column: 1 / -1; }
67 .ash-grid input { padding: 9px 11px; border-radius: 8px; border: 1px solid rgba(128,128,128,.4); background: transparent; color: inherit; font: inherit; font-weight: 400; }
68 .ash-check { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-size: 13.5px; }
69 .ash-add { padding: 10px 18px; border-radius: 10px; border: none; background: var(--accent,#6b8f71); color: #fff; font-weight: 600; cursor: pointer; }
70 .ash-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
71 .ash-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid rgba(128,128,128,.18); border-radius: 10px; }
72 .ash-when { font-variant-numeric: tabular-nums; font-weight: 600; flex: 0 0 auto; }
73 .ash-where { flex: 1 1 auto; opacity: .85; }
74 .ash-del { background: none; border: none; cursor: pointer; font-size: 16px; opacity: .6; }
75 .ash-empty { opacity: .7; }
76</style>
Note: See TracBrowser for help on using the repository browser.