| 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 | <%
|
|---|
| 6 | var _bc = (typeof bodyClass === 'string') ? bodyClass : '';
|
|---|
| 7 | var _onShows = _bc.indexOf('on-shows') >= 0;
|
|---|
| 8 | // Pagina's zonder actieve feed-weergave → niets in de pill is 'actief' (Solo/Cirkel
|
|---|
| 9 | // + Tijdlijn/Grid grijs). Alleen Agenda krijgt z'n eigen is-active op de agenda.
|
|---|
| 10 | var _neutral = ['on-shows','on-downloads','on-post','on-epk','on-linkbio','on-newsletter','on-archive']
|
|---|
| 11 | .some(function(c){ return _bc.indexOf(c) >= 0; });
|
|---|
| 12 | // Lezen bestaat alleen waar een leessectie is, en dat is de eigen feed. De
|
|---|
| 13 | // cirkel toont berichten van ANDEREN, opgehaald van hun servers -- daar is
|
|---|
| 14 | // "het hele stuk" niet iets wat wij in handen hebben. Dus daar geen knop:
|
|---|
| 15 | // een knop die niets doet is erger dan een knop die er niet is.
|
|---|
| 16 | var _leesbaar = _bc.indexOf('on-cirkel') < 0;
|
|---|
| 17 | %>
|
|---|
| 18 | <div class="view-switcher-wrap">
|
|---|
| 19 | <div class="container">
|
|---|
| 20 | <% if (typeof premiumUnlocked !== 'undefined' && premiumUnlocked && typeof agendaEnabled !== 'undefined' && agendaEnabled) {
|
|---|
| 21 | var _sbA = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
|
|---|
| 22 | %>
|
|---|
| 23 | <div class="agenda-pill">
|
|---|
| 24 | <a class="vs-agenda<%= _onShows ? ' is-active' : '' %>" href="<%= _sbA %>/shows" aria-label="Agenda — evenementen">
|
|---|
| 25 | <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>
|
|---|
| 26 | <span><%= t('switch.agenda') %></span>
|
|---|
| 27 | </a>
|
|---|
| 28 | </div>
|
|---|
| 29 | <% } %>
|
|---|
| 30 | <% if (typeof hasCirkel !== 'undefined' && hasCirkel) {
|
|---|
| 31 | var _onCirkel = (typeof bodyClass === 'string' && bodyClass.indexOf('on-cirkel') >= 0);
|
|---|
| 32 | var _sb = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
|
|---|
| 33 | %>
|
|---|
| 34 | <div class="feed-scope" role="tablist" aria-label="Solo of cirkel">
|
|---|
| 35 | <a class="feed-scope-btn<%= (!_neutral && !_onCirkel) ? ' is-active' : '' %>" href="<%= _sb %>/"
|
|---|
| 36 | role="tab" aria-selected="<%= (!_neutral && !_onCirkel) ? 'true' : 'false' %>"><%= t('switch.solo') %></a>
|
|---|
| 37 | <a class="feed-scope-btn<%= (!_neutral && _onCirkel) ? ' is-active' : '' %>" href="<%= _sb %>/cirkel"
|
|---|
| 38 | role="tab" aria-selected="<%= (!_neutral && _onCirkel) ? 'true' : 'false' %>"><%= t('switch.circle') %></a>
|
|---|
| 39 | </div>
|
|---|
| 40 | <% } %>
|
|---|
| 41 | <div class="view-switcher" role="tablist" aria-label="Weergave">
|
|---|
| 42 | <% if (_leesbaar) { %>
|
|---|
| 43 | <%# Lezen is de standaardweergave sinds Tijdlijn weg is: hele berichten,
|
|---|
| 44 | één per scherm. De chronologische lijst bestaat nog wel als opmaak
|
|---|
| 45 | (.feed-timeline, ook op de cirkel en het archief), maar is geen KEUZE
|
|---|
| 46 | meer -- daar was Lezen de betere vorm van. %>
|
|---|
| 47 | <button type="button" class="view-switch-btn" data-view="reader" role="tab"
|
|---|
| 48 | aria-selected="<%= (!_neutral && !(typeof site !== 'undefined' && site && site.feed_view_default === 'grid')) ? 'true' : 'false' %>">
|
|---|
| 49 | <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"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/></svg>
|
|---|
| 50 | <span><%= t('switch.reader') %></span>
|
|---|
| 51 | </button>
|
|---|
| 52 | <% } %>
|
|---|
| 53 | <button type="button" class="view-switch-btn" data-view="grid" role="tab"
|
|---|
| 54 | aria-selected="<%= (!_neutral && (typeof site !== 'undefined' && site && site.feed_view_default === 'grid')) ? 'true' : 'false' %>">
|
|---|
| 55 | <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>
|
|---|
| 56 | <span><%= t('switch.grid') %></span>
|
|---|
| 57 | </button>
|
|---|
| 58 | </div>
|
|---|
| 59 | <% if (!_neutral) { %>
|
|---|
| 60 | <div class="grid-cols-picker" aria-label="Aantal kolommen">
|
|---|
| 61 | <button type="button" class="grid-cols-btn" data-cols="2" title="2 kolommen">2</button>
|
|---|
| 62 | <button type="button" class="grid-cols-btn" data-cols="3" title="3 kolommen">3</button>
|
|---|
| 63 | <button type="button" class="grid-cols-btn" data-cols="4" title="4 kolommen">4</button>
|
|---|
| 64 | </div>
|
|---|
| 65 | <% } %>
|
|---|
| 66 | </div>
|
|---|
| 67 | </div>
|
|---|