source: Klonkt/src/views/pages/my-site.ejs@ ce8c8c2

main
Last change on this file since ce8c8c2 was 8afbdd6, checked in by roboburr <roboburr@…>, 3 months ago

feat: viewer role + artists directory + Klonkt Hub Beta rebrand

Viewer role (replaces the separate view-mode/readonly toggle):

  • 'kijker' is now a real role (VALID_ROLES) selectable in Admin. May view EVERYTHING including Admin, but cannot modify anything.
  • isViewer(user) (= role kijker or legacy readonly flag) is the source; requireGod/requireSiteManager(BySlug) let a viewer through (viewing), the global guard 403s every write. Existing readonly accounts are migrated on each role change (readonly=0).
  • Write leaks via GET patched: /prutter/new (INSERT) blocks for viewers, /prutter/:id skips markAsRead (UPDATE); WS upgrade rejects viewers (the HTTP guard doesn't cover WebSockets).
  • Clean "Viewer mode" page (viewer-blocked) instead of raw 403 text; styled sticky banner; account page shows read-only UI instead of an upload button that silently 403s. canMutate hides write buttons.

Scalability (>50 artists):

  • Hub home shows max 24 (most active first) + "All N artists ->".
  • New searchable, paginated /artiesten directory (hub only).
  • 'user' + 'artiesten' reserved as slugs.

Rebrand PrutFolio v1 -> Klonkt Hub Beta (footer, PWA manifest, account/
admin texts, default page title, startup, README; internal package +
PWA id 'prutfolio' remain for stability).

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

  • Property mode set to 100644
File size: 2.0 KB
Line 
1<div class="container admin-page">
2 <p><a href="/" class="btn">&larr; Overzicht</a></p>
3 <h1>Mijn Klonkt Hub</h1>
4 <p class="admin-tagline"><%= mySite.title %></p>
5
6 <nav class="admin-quick-links" aria-label="Beheer-snelkoppelingen">
7 <a href="/user/<%= mySite.slug %>/posts/new" class="btn">✍️ Nieuwe post</a>
8 <a href="/admin/sites/<%= mySite.slug %>/edit" class="btn">🎨 Uiterlijk</a>
9 <a href="/user/<%= mySite.slug %>/admin/comments" class="btn">💬 Reacties</a>
10 <a href="/user/<%= mySite.slug %>" class="btn">👁️ Bekijk mijn site</a>
11 <a href="/account" class="btn">👤 Account</a>
12 </nav>
13
14 <div class="admin-stats">
15 <div class="stat-card"><div class="stat-num"><%= mine.posts %></div><div class="stat-label">Posts</div></div>
16 <div class="stat-card"><div class="stat-num"><%= mine.published %></div><div class="stat-label">Gepubliceerd</div></div>
17 </div>
18</div>
19
20<style>
21.admin-page { max-width: 1000px; margin: 3rem auto; padding: 0 1rem; }
22.admin-page h1 { font-family: var(--font-display, serif); font-size: 2rem; margin: 0 0 0.25rem; }
23.admin-tagline { color: var(--ink-muted); margin: 0 0 2rem; }
24.admin-quick-links {
25 display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
26 gap: 0.5rem; margin: 0 0 1.5rem; padding: 0;
27}
28.admin-quick-links .btn { justify-content: center; padding: 0.7rem 0.9rem; font-weight: 600; text-align: center; }
29.admin-quick-links .btn:hover { background: color-mix(in srgb, var(--accent) 8%, var(--paper-2)); border-color: var(--accent); }
30.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
31.stat-card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.25rem; text-align: center; }
32.stat-num { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; font-family: var(--font-display, serif); }
33.stat-label { color: var(--ink-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.25rem; }
34</style>
Note: See TracBrowser for help on using the repository browser.