source: Klonkt/src/views/pages/admin-settings.ejs@ 6351545

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

tenancy: runtime Solo/Hub mode + mode-aware /admin (Phase 1)

Admin can switch live between modes in Admin -> Settings:

  • solo: exactly one site (the primary/owner site), no /sites routing, leaner /admin.
  • hub: main site + /sites/:slug routing (company; /gebruikers + assignment flow = Phase 2).

Switching is non-destructive (hides only, deletes nothing).

  • app_settings (key/value singleton) + SettingsService (cached getTenancy/setTenancy).
  • resolveSite: solo pins to the primary site + disables /sites/:slug + host mapping.
  • /admin/settings (god-only) toggle; /admin dashboard rewritten, mode-aware.

Tested on the demo: solo/hub dashboard tiles, /sites routing per mode, toggle back/forth.

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

  • Property mode set to 100644
File size: 2.7 KB
Line 
1<div class="container admin-page">
2 <h1>Instellingen</h1>
3 <p class="admin-tagline"><a href="/admin">&larr; Terug naar beheer</a></p>
4
5 <% if (success) { %><div class="alert alert-success"><%= success %></div><% } %>
6
7 <section class="set-card">
8 <h2>Modus</h2>
9 <p class="set-help">
10 Bepaalt hoe deze installatie werkt. Wisselen is veilig: er wordt niets verwijderd —
11 Solo verbergt alleen de multi-onderdelen en toont je primaire site.
12 </p>
13
14 <form method="post" action="/admin/settings" class="set-form">
15 <label class="set-opt">
16 <input type="radio" name="tenancy" value="solo" <%= tenancy === 'solo' ? 'checked' : '' %>>
17 <span>
18 <strong>Solo</strong> — één site (de jouwe).
19 <small>Geen gebruikers-directory, geen site-wissel. Bezoekers kunnen wel met Google inloggen om te reageren.</small>
20 </span>
21 </label>
22 <label class="set-opt">
23 <input type="radio" name="tenancy" value="hub" <%= tenancy === 'hub' ? 'checked' : '' %>>
24 <span>
25 <strong>Hub</strong> — bedrijfssite met <code>/gebruikers</code>.
26 <small>Jij (admin) wijst gebruikers een eigen PrutFolio toe. Gesloten cirkel: geen open registratie.</small>
27 </span>
28 </label>
29 <button type="submit" class="btn btn-primary">Opslaan</button>
30 </form>
31 </section>
32</div>
33
34<style>
35.admin-page { max-width: 700px; margin: 3rem auto; padding: 0 1rem; }
36.admin-page h1 { font-family: var(--font-display, serif); font-size: 2rem; margin: 0 0 0.25rem; }
37.admin-tagline { color: var(--ink-muted); margin: 0 0 2rem; }
38.admin-tagline a { color: var(--accent); }
39.set-card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem; }
40.set-card h2 { font-family: var(--font-display, serif); font-size: 1.25rem; margin: 0 0 0.5rem; }
41.set-help { color: var(--ink-muted); font-size: 0.9rem; margin: 0 0 1.25rem; }
42.set-form { display: flex; flex-direction: column; gap: 1rem; }
43.set-opt { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.85rem 1rem; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; background: var(--paper); }
44.set-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
45.set-opt input { margin-top: 0.25rem; flex-shrink: 0; }
46.set-opt span { display: flex; flex-direction: column; gap: 0.2rem; }
47.set-opt small { color: var(--ink-muted); font-size: 0.82rem; }
48.set-opt code { background: var(--paper-2); padding: 0.05rem 0.35rem; border-radius: 3px; font-size: 0.85em; }
49.set-form .btn { align-self: flex-start; }
50.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
51.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
52</style>
Note: See TracBrowser for help on using the repository browser.