source: Klonkt/src/routes/admin-settings.js@ a64f642

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

hub: overview is a headerless landing with hero image

The hub overview now starts directly with the hero — no masthead/profile-header/
view-switcher/bottom-tab (those belong to a PrutFolio and appear on /user/
pages). Hero supports a background image (setting hub_hero_image, configurable
in Admin) with a dark overlay; otherwise gradient. Roster avatars use each
artist's accent color.

  • shell.ejs: chrome gated on bodyClass 'on-hub'.
  • hub.js: artists.accent + hub.heroImage from settings.
  • admin-settings: hub_hero_image field.

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

  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[6351545]1/**
[6e0249f]2 * Admin: globale instellingen.
3 * - tenancy-modus (Solo/Hub)
4 * - hub-branding (naam/tagline/intro van de generieke hub-hoofdpagina)
[6351545]5 *
[6e0249f]6 * GET /admin/settings -> toon huidige instellingen
7 * POST /admin/settings -> sla op (god-only)
[6351545]8 *
[6e0249f]9 * De hub-pagina is generiek (van geen enkele user); deze branding leeft in
10 * globale settings, niet in een site.
[6351545]11 */
12
13import express from 'express';
14import { renderPage } from '../middleware/render.js';
15import { requireGod } from '../middleware/auth.js';
[6e0249f]16import { getTenancy, setTenancy, getSetting, setSetting } from '../services/SettingsService.js';
[6351545]17
18const router = express.Router();
19
20router.get('/', requireGod, (req, res) => {
21 renderPage(req, res, 'pages/admin-settings', {
22 pageTitle: 'Instellingen',
23 bodyClass: 'on-admin',
24 tenancy: getTenancy(),
[6e0249f]25 hubTitle: getSetting('hub_title') || '',
26 hubTagline: getSetting('hub_tagline') || '',
27 hubIntro: getSetting('hub_intro') || '',
[4c5169f]28 hubHeroImage: getSetting('hub_hero_image') || '',
[6351545]29 success: req.query.success || null,
30 });
31});
32
33router.post('/', requireGod, (req, res) => {
[6e0249f]34 if (typeof req.body.tenancy !== 'undefined') {
35 setTenancy(req.body.tenancy === 'hub' ? 'hub' : 'solo');
36 }
37 if (typeof req.body.hub_title !== 'undefined') {
38 setSetting('hub_title', (req.body.hub_title || '').toString().slice(0, 80).trim());
39 }
40 if (typeof req.body.hub_tagline !== 'undefined') {
41 setSetting('hub_tagline', (req.body.hub_tagline || '').toString().slice(0, 120).trim());
42 }
43 if (typeof req.body.hub_intro !== 'undefined') {
44 setSetting('hub_intro', (req.body.hub_intro || '').toString().slice(0, 400).trim());
45 }
[4c5169f]46 if (typeof req.body.hub_hero_image !== 'undefined') {
47 setSetting('hub_hero_image', (req.body.hub_hero_image || '').toString().slice(0, 300).trim());
48 }
[6e0249f]49 res.redirect('/admin/settings?success=' + encodeURIComponent('Opgeslagen'));
[6351545]50});
51
52export default router;
Note: See TracBrowser for help on using the repository browser.