Changeset 9a00f28 in Klonkt for src/routes
- Timestamp:
- 07/22/2026 08:18:39 AM (7 weeks ago)
- Branches:
- main
- Children:
- 6b5d7da
- Parents:
- 96c714f
- git-author:
- Robin <roboburr@…> (07/22/2026 08:18:19 AM)
- git-committer:
- Robin <roboburr@…> (07/22/2026 08:18:39 AM)
- Location:
- src/routes
- Files:
-
- 5 edited
-
admin-paid.js (modified) (1 diff)
-
admin-push.js (modified) (1 diff)
-
admin.js (modified) (2 diffs)
-
paid.js (modified) (4 diffs)
-
push.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/admin-paid.js
r96c714f r9a00f28 36 36 if (!gate(req, res)) return; 37 37 renderPage(req, res, 'pages/admin-paid', { 38 pageTitle : 'Betaalde posts',38 pageTitleKey: 'apaid.t', 39 39 bodyClass: 'on-admin', 40 40 status: PaidPatreon.ownerStatus(res.locals.site.id), -
src/routes/admin-push.js
r96c714f r9a00f28 12 12 router.get('/', requireSiteManager, async (req, res) => { 13 13 renderPage(req, res, 'pages/admin-push', { 14 pageTitle : 'Notificaties',14 pageTitleKey: 'push.t', 15 15 bodyClass: 'on-admin', 16 16 vapidKey: await Push.publicKey(), // null → feature unavailable -
src/routes/admin.js
r96c714f r9a00f28 9 9 import { renderPage } from '../middleware/render.js'; 10 10 import { requireAuth } from '../middleware/auth.js'; 11 import { getTenancy } from '../services/SettingsService.js';11 import { getTenancy, apEnabled } from '../services/SettingsService.js'; 12 12 import { getPrimarySite } from '../middleware/site.js'; 13 13 … … 96 96 bodyClass: 'on-admin', 97 97 tenancy, 98 circlesOn: apEnabled(), // solo vs cirkels tagline (federatie aan/uit) 98 99 primarySite, 99 100 stats, -
src/routes/paid.js
r96c714f r9a00f28 54 54 if (!payload || payload.purpose !== 'patron' || payload.siteId !== r.site.id) { 55 55 return renderPage(req, res, 'pages/paid-result', { 56 pageTitle : 'Ontgrendelen', bodyClass: 'on-special', ok: false, reason: 'expired',56 pageTitleKey: 'pres.t', bodyClass: 'on-special', ok: false, reason: 'expired', 57 57 }); 58 58 } … … 60 60 const code = String(req.query.code || ''); 61 61 if (req.query.error || !code) { 62 return renderPage(req, res, 'pages/paid-result', { pageTitle : 'Ontgrendelen', bodyClass: 'on-special', ok: false, reason: 'declined', postSlug: payload.post, patronUrl });62 return renderPage(req, res, 'pages/paid-result', { pageTitleKey: 'pres.t', bodyClass: 'on-special', ok: false, reason: 'declined', postSlug: payload.post, patronUrl }); 63 63 } 64 64 const membership = await PaidPatreon.verifyPatron(r.site.id, code, baseUrl(req) + '/paid/callback').catch(() => null); … … 67 67 if (!active || cents < payload.cents) { 68 68 return renderPage(req, res, 'pages/paid-result', { 69 pageTitle : 'Ontgrendelen', bodyClass: 'on-special', ok: false,69 pageTitleKey: 'pres.t', bodyClass: 'on-special', ok: false, 70 70 reason: active ? 'tier' : 'notpatron', neededCents: payload.cents, haveCents: cents, postSlug: payload.post, patronUrl, 71 71 }); … … 76 76 const blob = signBlob({ purpose: 'reg', siteId: r.site.id, cents, challenge: options.challenge }, 900); 77 77 renderPage(req, res, 'pages/paid-passkey', { 78 pageTitle : 'Maak je passkey', bodyClass: 'on-special',78 pageTitleKey: 'ppk.t', bodyClass: 'on-special', 79 79 optionsJson: JSON.stringify(options), regBlob: blob, postSlug: payload.post, 80 80 }); -
src/routes/push.js
r96c714f r9a00f28 9 9 import { requireAuth } from '../middleware/auth.js'; 10 10 import Push from '../services/PushService.js'; 11 import { t as i18nT, resolveLang } from '../services/i18n.js'; 11 12 12 13 const router = express.Router(); … … 55 56 // A test ping to all of the caller's own devices (bypasses alert prefs). 56 57 router.post('/test', requireAuth, async (req, res) => { 58 const L = resolveLang(req); 57 59 const sent = await Push.notifyUser(req.session.user.id, { 58 type: 'test', title: 'Klonkt-testnotificatie',59 body: 'Werkt. Zo komen meldingen binnen op dit apparaat.', url: '/admin/push',60 type: 'test', title: i18nT(L, 'push.n_test_t'), 61 body: i18nT(L, 'push.n_test_b'), url: '/admin/push', 60 62 }); 61 63 res.json({ ok: true, sent });
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)