Changeset 68b27a4 in Klonkt for src/routes/shows.js


Ignore:
Timestamp:
06/20/2026 07:28:43 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
0fcc09c
Parents:
d7b5a6c
Message:

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@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/shows.js

    rd7b5a6c r68b27a4  
    1616import { mailerConfigured, sendMail } from '../config/mailer.js';
    1717import { addSubscriber } from '../services/SubscriberService.js';
     18import { getSetting } from '../services/SettingsService.js';
    1819
    1920const router = express.Router();
     21
     22// Agenda is opt-in: pas bereikbaar als de beheerder 'm heeft ingeschakeld.
     23function agendaOn() { return getSetting('agenda_enabled') === '1'; }
    2024
    2125function esc(s) { return String(s || '').replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c])); }
     
    3034
    3135router.get('/shows', (req, res, next) => {
    32   if (!premiumUnlocked()) return next();
     36  if (!premiumUnlocked() || !agendaOn()) return next();
    3337  const site = res.locals.site;
    3438  if (!site) return next();
     
    4246
    4347router.post('/shows/notify', async (req, res, next) => {
    44   if (!premiumUnlocked()) return next();
     48  if (!premiumUnlocked() || !agendaOn()) return next();
    4549  const site = res.locals.site;
    4650  if (!site) return next();
Note: See TracChangeset for help on using the changeset viewer.