source: Klonkt/src/views/partials/view-switcher.ejs@ b200738

main
Last change on this file since b200738 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: 3.5 KB
Line 
1<%# View switcher partial — Tijdlijn / Grid + grid-cols picker.
2 Mounted in shell.ejs once, visible on every non-admin page. Click
3 handlers are wired in shell.ejs via event-delegation on document so
4 HTMX-swapped content keeps working without rebinding. %>
5<div class="view-switcher-wrap">
6 <div class="container">
7 <% if (typeof tenancy !== 'undefined' && tenancy === 'circle') {
8 var _onCirkel = (typeof bodyClass === 'string' && bodyClass.indexOf('on-cirkel') >= 0);
9 var _sb = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
10 %>
11 <div class="feed-scope" role="tablist" aria-label="Solo of cirkel">
12 <a class="feed-scope-btn<%= _onCirkel ? '' : ' is-active' %>" href="<%= _sb %>/"
13 role="tab" aria-selected="<%= _onCirkel ? 'false' : 'true' %>">Solo</a>
14 <a class="feed-scope-btn<%= _onCirkel ? ' is-active' : '' %>" href="<%= _sb %>/cirkel"
15 role="tab" aria-selected="<%= _onCirkel ? 'true' : 'false' %>">Cirkel</a>
16 </div>
17 <% } %>
18 <div class="view-switcher" role="tablist" aria-label="Weergave">
19 <% if (typeof premiumUnlocked !== 'undefined' && premiumUnlocked && typeof agendaEnabled !== 'undefined' && agendaEnabled) {
20 var _sbA = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
21 var _agActive = (typeof bodyClass === 'string' && bodyClass.indexOf('on-shows') >= 0);
22 %>
23 <a class="vs-agenda<%= _agActive ? ' is-active' : '' %>" href="<%= _sbA %>/shows" aria-label="Agenda — evenementen">
24 <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
25 <span>Agenda</span>
26 </a>
27 <% } %>
28 <button type="button" class="view-switch-btn" data-view="timeline" role="tab"
29 aria-selected="<%= (typeof site !== 'undefined' && site && site.feed_view_default === 'grid') ? 'false' : 'true' %>">
30 <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>
31 <span>Tijdlijn</span>
32 </button>
33 <button type="button" class="view-switch-btn" data-view="grid" role="tab"
34 aria-selected="<%= (typeof site !== 'undefined' && site && site.feed_view_default === 'grid') ? 'true' : 'false' %>">
35 <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/></svg>
36 <span>Grid</span>
37 </button>
38 </div>
39 <div class="grid-cols-picker" aria-label="Aantal kolommen">
40 <button type="button" class="grid-cols-btn" data-cols="2" title="2 kolommen">2</button>
41 <button type="button" class="grid-cols-btn" data-cols="3" title="3 kolommen">3</button>
42 <button type="button" class="grid-cols-btn" data-cols="4" title="4 kolommen">4</button>
43 </div>
44 </div>
45</div>
Note: See TracBrowser for help on using the repository browser.