source: Klonkt/src/views/pages/paid-result.ejs@ 9a00f28

main
Last change on this file since 9a00f28 was 9a00f28, checked in by Robin <roboburr@…>, 7 weeks ago

Fix: test feedback round, cirkels tagline + report details + full i18n

Three findings from Bart's test pass, tied together by the new i18n keys:

  1. The admin tagline said "Solo mode" even with Cirkels (federation) on. Solo-tenancy now distinguishes: apEnabled -> "Cirkels-modus: jouw site, verbonden met de fediverse", else the solo line. New key in nl/en/de.
  1. Reports only showed who reported; now they show the reason and WHICH post. getNotifications resolves the stored objects URIs of a report: our own /ap/notes/<id> become "Over de post: <title>" links under the description; an empty reason renders "Geen reden opgegeven". Other URIs (the actor itself) are skipped, the row already names the account.
  1. Notificaties and Betaalde posts were hardcoded Dutch on an English-configured Klonkt. Everything now goes through t(): the two admin pages (including their client-side status strings, passed via the JSON data block), the admin menu buttons, and the visitor-facing paid pages (gate, passkey, result). Server-side push payloads translate too, using the SITE's content language (fallback KLONKT_DEFAULT_LANG), and the test ping uses the request language. Full nl/en/de dictionaries.

Changed files:
src/services/i18n.js

  • admin.tagline_cirkels, admin.b_paid/b_push/back, notif.report_about/ report_noreason, and the push.*, apaid.*, pgate.*, ppk.*, pres.* blocks in nl/en/de

src/routes/admin.js, src/views/pages/admin.ejs

  • circlesOn (apEnabled) -> cirkels tagline; menu buttons via t()

src/services/ActivityPubService.js

  • report objects resolved to post links; push payloads via i18nT with pushLang(slug) (site language)

src/views/pages/fedi-notifications.ejs

  • report reason fallback + "Over de post" links (+ styles)

src/routes/admin-push.js, src/views/pages/admin-push.ejs

  • pageTitleKey push.t; all copy + JS status strings via t()

src/routes/admin-paid.js, src/views/pages/admin-paid.ejs

  • pageTitleKey apaid.t; all copy via t(), copy-button label via data-attr

src/routes/paid.js

  • pageTitleKey pres.t / ppk.t

src/views/pages/paid-gate.ejs, paid-passkey.ejs, paid-result.ejs

  • visitor copy + JS strings via t()

src/routes/push.js

  • test notification via resolveLang(req)

-robo
Co-Authored-By: Claude Opus 4.8 <noreply@…>

  • Property mode set to 100644
File size: 2.3 KB
Line 
1<%
2 var _slug = (typeof postSlug !== 'undefined' && postSlug) ? postSlug : '';
3 var _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
4 var _patron = (typeof patronUrl !== 'undefined' && patronUrl) ? patronUrl : '';
5%>
6<section class="pr">
7 <div class="pr-card">
8 <div class="pr-ic">🔒</div>
9 <% if (reason === 'notpatron') { %>
10 <h1 class="pr-h1"><%= t('pres.notpatron_h') %></h1>
11 <p class="pr-sub"><%= t('pres.notpatron_p') %></p>
12 <% } else if (reason === 'tier') { %>
13 <h1 class="pr-h1"><%= t('pres.tier_h') %></h1>
14 <p class="pr-sub"><%= t('pres.tier_p', { need: ((typeof neededCents !== 'undefined' ? neededCents : 0)/100).toFixed(2), have: ((typeof haveCents !== 'undefined' ? haveCents : 0)/100).toFixed(2) }) %></p>
15 <% } else if (reason === 'expired') { %>
16 <h1 class="pr-h1"><%= t('pres.expired_h') %></h1>
17 <p class="pr-sub"><%= t('pres.expired_p') %></p>
18 <% } else { %>
19 <h1 class="pr-h1"><%= t('pres.declined_h') %></h1>
20 <p class="pr-sub"><%= t('pres.declined_p') %></p>
21 <% } %>
22
23 <div class="pr-actions">
24 <% if ((reason === 'notpatron' || reason === 'tier') && _patron) { %>
25 <a class="pr-btn" href="<%= _patron %>" target="_blank" rel="noopener"><%= t('pres.join') %></a>
26 <% } %>
27 <% if (_slug) { %>
28 <a class="pr-btn pr-btn-ghost" href="<%= _base %>/<%= _slug %>"><%= t('pres.back_post') %></a>
29 <% } else { %>
30 <a class="pr-btn pr-btn-ghost" href="<%= _base %>/"><%= t('pres.back_site') %></a>
31 <% } %>
32 </div>
33 </div>
34</section>
35
36<style>
37 .pr { max-width: 460px; margin: 0 auto; padding: 56px 18px; text-align: center; }
38 .pr-card { border: 1px solid color-mix(in srgb, var(--ink,#000) 16%, transparent); border-radius: 18px; padding: 34px 26px; }
39 .pr-ic { font-size: 38px; margin-bottom: 6px; }
40 .pr-h1 { font-size: 23px; margin: 0 0 8px; }
41 .pr-sub { opacity: .85; line-height: 1.6; margin: 0 0 20px; }
42 .pr-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
43 .pr-btn { display: inline-block; padding: 11px 20px; border-radius: 10px; background: var(--accent,#6b8f71); color: #fff; text-decoration: none; font-weight: 600; }
44 .pr-btn-ghost { background: transparent; color: var(--ink,#222); border: 1px solid color-mix(in srgb, var(--ink,#000) 22%, transparent); }
45</style>
Note: See TracBrowser for help on using the repository browser.