Changeset 834bcc3 in Klonkt for src/routes/admin.js
- Timestamp:
- 06/23/2026 06:14:27 PM (3 months ago)
- Branches:
- main
- Children:
- d774679
- Parents:
- bb42dfb
- File:
-
- 1 edited
-
src/routes/admin.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/admin.js
rbb42dfb r834bcc3 14 14 const router = express.Router(); 15 15 16 // Recent e posts van één site, CONCEPTEN BOVENAAN, met mode-bewuste edit/view-URLs.17 // Lost op dat drafts (status != published) nergens terug te vinden waren: de18 // t ijdlijn toont alleen gepubliceerdeposts.16 // Recent posts from one site, DRAFTS ON TOP, with mode-aware edit/view URLs. 17 // Solves the problem that drafts (status != published) were not findable anywhere: 18 // the timeline shows only published posts. 19 19 function sitePosts(siteId, siteSlug, tenancy, limit = 60) { 20 20 const base = tenancy === 'hub' ? `/user/${siteSlug}` : ''; … … 35 35 const user = req.session.user; 36 36 37 // Een kijker mag het volledige (god-)Beheer alleen-lezen inzien — net als god 38 // dus, alleen schrijven is globaal geblokkeerd. Een gewone artiest die een 39 // eigen site bezit krijgt een "Mijn Klonkt Hub"-dashboard, gescopet op z'n 40 // eigen site. Bezit 'ie geen site -> geen beheer. 37 // A kijker may view the full (god) admin panel read-only — same as god, 38 // but writing is globally blocked. A regular artist who owns a site gets 39 // a "My Klonkt Hub" dashboard, scoped to their own site. No site -> no admin. 41 40 if (user.role !== 'god' && user.role !== 'kijker') { 42 41 const mySite = db.prepare( … … 60 59 const tenancy = getTenancy(); 61 60 62 // De primaire/hoofd-site — in solo dé site, in hub de hoofdsite. Geeft de63 // " Uiterlijk"-tegel z'n edit-link + de posts/concepten-lijst.61 // The primary/main site — in solo THE site, in hub the main site. Provides the 62 // "Appearance" tile with its edit link + the posts/drafts list. 64 63 const primarySite = getPrimarySite(); 65 64 … … 73 72 }; 74 73 75 // Sites/users -tabellen zijn alleen in hub relevant; in solo besparen we de query.74 // Sites/users tables are only relevant in hub mode; in solo we skip the query. 76 75 const sites = tenancy === 'hub' ? db.prepare(` 77 76 SELECT s.slug, s.title, s.created_at, u.username AS owner_username … … 89 88 `).all() : []; 90 89 91 // Posts/ concepten van de primaire site (in solo = de site; in hub = de92 // hoofdsite van de admin). Concepten staan bovenaan zodat ze vindbaar zijn.90 // Posts/drafts of the primary site (in solo = the site; in hub = the admin's 91 // main site). Drafts are listed first so they are easy to find. 93 92 const posts = primarySite ? sitePosts(primarySite.id, primarySite.slug, tenancy) : []; 94 93 … … 105 104 }); 106 105 107 // Handleiding — doorzoekbare uitleg van alle Beheer-functies. Zichtbaar voor wie108 // het Beheer mag zien (ingelogd); puur statische hulptekst, niets gevoeligs.106 // Handleiding — searchable explanation of all admin features. Visible to anyone 107 // who may view the admin panel (logged in); purely static help text, nothing sensitive. 109 108 router.get('/handleiding', requireAuth, (req, res) => { 110 109 renderPage(req, res, 'pages/admin-help', {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)