source: Klonkt/src/views/partials/chrome.ejs@ 3f4049e

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

fix: hide view-switcher (Timeline/Grid + pager) on a fresh install with no site

Chrome showed the timeline/grid switcher on the welcome/setup page too (no
site = nothing to switch between). Now gated on the existence of a site.

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

  • Property mode set to 100644
File size: 2.4 KB
Line 
1<%
2// Site-chrome (topnav + profielkop + view-switcher) in één vaste slot #pcms-chrome.
3//
4// Waarom een slot: bij htmx-navigatie verversen we deze hele chrome out-of-band
5// (oob=true), zodat de kop ALTIJD bij de nieuwe pagina/artiest hoort — terwijl de
6// audioplayer (los in document.body, buiten dit slot) blijft leven → geen
7// verspringen. Op de hub-landing (bareChrome) is het slot leeg: hero = de header.
8//
9// Wordt zowel door shell.ejs (oob niet gezet) als door render.js bij partials
10// (oob=true) gerenderd. De logica staat hier zodat beide identiek zijn.
11//
12// _isAuth → focus-scherm (in/uitloggen): helemaal geen chrome.
13// _headerless → hub-homepagina én de Prutter-chat: WÉL de mini topnav-balk,
14// GEEN profielkop (hub: hero = header; chat: full-height view).
15// anders → topnav + profielkop (+ view-switcher buiten admin).
16var _isAdmin = typeof bodyClass === 'string' && bodyClass.indexOf('on-admin') >= 0;
17var _isAuth = typeof bodyClass === 'string' && bodyClass.indexOf('on-auth') >= 0;
18var _isChat = typeof bodyClass === 'string' && bodyClass.indexOf('on-chat') >= 0;
19var hubLanding = (typeof bodyClass === 'string' && bodyClass.indexOf('on-hub') >= 0)
20 || ((typeof tenancy !== 'undefined' && tenancy === 'hub') && !siteUrlBase && !_isAdmin);
21// Zelfstandige premium-feature-pagina's hebben hun eigen kop → geen profielkop/
22// switcher, wél de topnav (Robin 2026-06-18: "bovenste weg, behoud de nav").
23// NB: on-shows (agenda) én on-downloads (de downloads-LIJST) horen hier NIET bij —
24// die willen de volledige chrome (profielkop + pill) behouden. De downloads-lijst is
25// vaak gepind en prominent, dus hij mag niet kaal zijn. De losse e-mail-capture
26// (/download/:id → on-download) blijft wél een focus-pagina zonder kop.
27var _featurePage = typeof bodyClass === 'string' &&
28 bodyClass.indexOf('on-downloads') < 0 &&
29 ['on-epk', 'on-download', 'on-linkbio', 'on-newsletter'].some(function (c) { return bodyClass.indexOf(c) >= 0; });
30var _headerless = hubLanding || _isChat || _featurePage;
31%>
32<div id="pcms-chrome"<% if (typeof oob !== 'undefined' && oob) { %> hx-swap-oob="true"<% } %>>
33<% if (!_isAuth) { %>
34 <%- include('topnav') %>
35 <% if (!_headerless) { %>
36 <%- include('profile-header') %>
37 <% if (!_isAdmin && (typeof site !== 'undefined' && site)) { %><%- include('view-switcher') %><% } %>
38 <% } %>
39<% } %>
40</div>
Note: See TracBrowser for help on using the repository browser.