| [6351545] | 1 | <div class="container admin-page">
|
|---|
| [bbf9d1a] | 2 | <h1><%= t('aset.title') %></h1>
|
|---|
| 3 | <p><a href="/admin" class="btn">← <%= t('aset.back_admin') %></a></p>
|
|---|
| [6351545] | 4 |
|
|---|
| 5 | <% if (success) { %><div class="alert alert-success"><%= success %></div><% } %>
|
|---|
| [1b4d5dd] | 6 | <% if (typeof error !== 'undefined' && error) { %><div class="alert alert-error"><%= error %></div><% } %>
|
|---|
| [6351545] | 7 |
|
|---|
| [eacd3d6] | 8 | <%# ── Mode: Solo or Cirkels (ActivityPub) — the primary, top-of-page choice ── %>
|
|---|
| 9 | <section class="set-card set-card--mode" style="margin-top:1rem">
|
|---|
| 10 | <h2><%= t('aset.mode') %></h2>
|
|---|
| 11 | <p class="set-help"><%= t('aset.mode_help') %></p>
|
|---|
| [92f6976] | 12 | <form method="post" action="/admin/settings/ap" class="set-form" id="mode-form"
|
|---|
| 13 | data-was-cirkels="<%= (typeof apEnabledSetting === 'undefined' || apEnabledSetting) ? '1' : '0' %>"
|
|---|
| 14 | data-confirm="<%= t('aset.mode_18plus_confirm') %>">
|
|---|
| [eacd3d6] | 15 | <label class="set-opt">
|
|---|
| 16 | <input type="radio" name="mode" value="solo" <%= (typeof apEnabledSetting !== 'undefined' && !apEnabledSetting) ? 'checked' : '' %>>
|
|---|
| 17 | <span><strong><%= t('aset.mode_solo') %></strong><small><%= t('aset.mode_solo_help') %></small></span>
|
|---|
| 18 | </label>
|
|---|
| 19 | <label class="set-opt">
|
|---|
| 20 | <input type="radio" name="mode" value="cirkels" <%= (typeof apEnabledSetting === 'undefined' || apEnabledSetting) ? 'checked' : '' %>>
|
|---|
| 21 | <span><strong><%= t('aset.mode_cirkels') %></strong><small><%= t('aset.mode_cirkels_help') %></small></span>
|
|---|
| 22 | </label>
|
|---|
| [92f6976] | 23 | <p class="set-help" style="margin:.2rem 0 0;color:var(--accent);font-weight:600">🔞 <%= t('aset.mode_18plus') %></p>
|
|---|
| [eacd3d6] | 24 | <div class="set-actions"><button type="submit" class="btn btn-primary"><%= t('aset.save') %></button></div>
|
|---|
| 25 | </form>
|
|---|
| [92f6976] | 26 | <script>
|
|---|
| 27 | (function () {
|
|---|
| 28 | var f = document.getElementById('mode-form');
|
|---|
| 29 | if (!f || f.__age18wired) return; f.__age18wired = true;
|
|---|
| 30 | f.addEventListener('submit', function (e) {
|
|---|
| 31 | var sel = f.querySelector('input[name=mode]:checked');
|
|---|
| 32 | if (sel && sel.value === 'cirkels' && f.getAttribute('data-was-cirkels') === '0') {
|
|---|
| 33 | if (!window.confirm(f.getAttribute('data-confirm'))) e.preventDefault();
|
|---|
| 34 | }
|
|---|
| 35 | });
|
|---|
| 36 | })();
|
|---|
| 37 | </script>
|
|---|
| [eacd3d6] | 38 | </section>
|
|---|
| 39 |
|
|---|
| [834bcc3] | 40 | <%# ── Default language for visitors ── %>
|
|---|
| [5e61b17] | 41 | <section class="set-card" style="margin-top:1rem">
|
|---|
| 42 | <h2><%= t('aset.default_lang') %></h2>
|
|---|
| 43 | <p class="set-help"><%= t('aset.default_lang_hint') %></p>
|
|---|
| 44 | <form method="post" action="/admin/settings" class="set-form">
|
|---|
| 45 | <label class="set-field">
|
|---|
| 46 | <span><%= t('aset.default_lang') %></span>
|
|---|
| 47 | <select name="default_lang">
|
|---|
| 48 | <option value=""<%= !defaultLang ? ' selected' : '' %>><%= t('aset.default_lang_auto') %></option>
|
|---|
| 49 | <% langs.forEach(function(l){ %>
|
|---|
| 50 | <option value="<%= l.code %>"<%= defaultLang === l.code ? ' selected' : '' %>><%= l.name %></option>
|
|---|
| 51 | <% }); %>
|
|---|
| 52 | </select>
|
|---|
| 53 | </label>
|
|---|
| 54 | <button type="submit" class="btn btn-primary"><%= t('aset.save') %></button>
|
|---|
| 55 | </form>
|
|---|
| 56 | </section>
|
|---|
| 57 |
|
|---|
| [834bcc3] | 58 | <%# ── Timezone ── %>
|
|---|
| [421c2d4] | 59 | <section class="set-card" style="margin-top:1rem">
|
|---|
| 60 | <h2><%= t('aset.timezone') %></h2>
|
|---|
| 61 | <p class="set-help"><%= t('aset.timezone_hint') %></p>
|
|---|
| 62 | <form method="post" action="/admin/settings" class="set-form">
|
|---|
| 63 | <label class="set-field">
|
|---|
| 64 | <span><%= t('aset.timezone') %></span>
|
|---|
| 65 | <select name="timezone">
|
|---|
| 66 | <option value=""<%= !timezone ? ' selected' : '' %>><%= t('aset.timezone_auto') %></option>
|
|---|
| 67 | <%
|
|---|
| 68 | var _tz = ['Europe/Amsterdam','Europe/Brussels','Europe/Berlin','Europe/Paris','Europe/London','Europe/Madrid','Europe/Rome','Europe/Lisbon','Europe/Warsaw','Europe/Athens','UTC','America/New_York','America/Chicago','America/Los_Angeles','America/Sao_Paulo','Asia/Tokyo','Asia/Dubai','Australia/Sydney'];
|
|---|
| 69 | if (timezone && _tz.indexOf(timezone) < 0) _tz.unshift(timezone);
|
|---|
| 70 | %>
|
|---|
| 71 | <% _tz.forEach(function(z){ %><option value="<%= z %>"<%= timezone === z ? ' selected' : '' %>><%= z %></option><% }); %>
|
|---|
| 72 | </select>
|
|---|
| 73 | </label>
|
|---|
| 74 | <button type="submit" class="btn btn-primary"><%= t('aset.save') %></button>
|
|---|
| 75 | </form>
|
|---|
| 76 | </section>
|
|---|
| 77 |
|
|---|
| [dd856db] | 78 | <%# Mode-specific config — Circle settings below the mode card. (Hub removed.) %>
|
|---|
| [323abb0] | 79 |
|
|---|
| [834bcc3] | 80 | <%# Premium (Patreon) — only visible when the self-hoster enables the premium layer
|
|---|
| 81 | (env KLONKT_PREMIUM_ENABLED=on). Hidden by default; nothing gated. %>
|
|---|
| [1b4d5dd] | 82 | <% if (premium && premium.enabled) { %>
|
|---|
| 83 | <section class="set-card" style="margin-top:1rem">
|
|---|
| [bbf9d1a] | 84 | <h2><%= t('aset.premium') %></h2>
|
|---|
| 85 | <p class="set-help"><%= t('aset.premium_help_1') %> <strong><%= t('aset.premium_lifetime') %></strong> <%= t('aset.premium_help_2') %></p>
|
|---|
| [1b4d5dd] | 86 | <% if (premium.premium) { %>
|
|---|
| [bbf9d1a] | 87 | <p class="set-help"><strong>✓ <%= t('aset.premium_active') %></strong>
|
|---|
| 88 | <% if (premium.supportCents) { %><%= t('aset.lifetime_support') %> $<%= (premium.supportCents/100).toFixed(2) %>.<% } %></p>
|
|---|
| 89 | <a href="/admin/patreon/disconnect" class="btn"><%= t('aset.patreon_disconnect') %></a>
|
|---|
| [1b4d5dd] | 90 | <% } else if (premium.connected) { %>
|
|---|
| [bbf9d1a] | 91 | <p class="set-help"><%= t('aset.patreon_no_lifetime') %><% if (premium.supportCents) { %>
|
|---|
| 92 | (<%= t('aset.now') %> $<%= (premium.supportCents/100).toFixed(2) %>)<% } %>. <%= t('aset.patreon_support_again') %></p>
|
|---|
| 93 | <a href="/admin/patreon/connect" class="btn btn-primary"><%= t('aset.patreon_reconnect') %></a>
|
|---|
| [1b4d5dd] | 94 | <% } else { %>
|
|---|
| [bbf9d1a] | 95 | <p class="set-help"><%= t('aset.patreon_not_connected') %></p>
|
|---|
| 96 | <a href="/admin/patreon/connect" class="btn btn-primary"><%= t('aset.patreon_connect') %></a>
|
|---|
| [1b4d5dd] | 97 | <% } %>
|
|---|
| 98 | </section>
|
|---|
| 99 | <% } %>
|
|---|
| 100 |
|
|---|
| [834bcc3] | 101 | <%# Newsletter signup in the footer (premium). %>
|
|---|
| [da6fd02] | 102 | <% if (typeof premiumUnlocked === 'undefined' || premiumUnlocked) { %>
|
|---|
| 103 | <section class="set-card" style="margin-top:1rem">
|
|---|
| [bbf9d1a] | 104 | <h2><%= t('aset.newsletter') %></h2>
|
|---|
| 105 | <p class="set-help"><%= t('aset.newsletter_help_1') %> <strong><%= t('aset.newsletter_footer_field') %></strong> <%= t('aset.newsletter_help_2') %> <code><%= (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '' %>/nieuwsbrief</code>.)</p>
|
|---|
| [da6fd02] | 106 | <form method="post" action="/admin/settings/footer" class="set-form">
|
|---|
| 107 | <label class="set-toggle" style="display:flex;align-items:center;gap:.6rem;cursor:pointer">
|
|---|
| 108 | <input type="checkbox" name="footer_newsletter" value="1" <%= footerNewsletter ? 'checked' : '' %>>
|
|---|
| [bbf9d1a] | 109 | <span><%= t('aset.newsletter_show_footer') %></span>
|
|---|
| [da6fd02] | 110 | </label>
|
|---|
| [bbf9d1a] | 111 | <div class="set-actions"><button type="submit" class="btn btn-primary"><%= t('aset.save') %></button></div>
|
|---|
| [da6fd02] | 112 | </form>
|
|---|
| 113 | </section>
|
|---|
| 114 | <% } %>
|
|---|
| 115 |
|
|---|
| [834bcc3] | 116 | <%# E-mail / SMTP — required for sending newsletters, notify-mails and password resets. %>
|
|---|
| [ca507ef] | 117 | <section class="set-card" style="margin-top:1rem">
|
|---|
| [bbf9d1a] | 118 | <h2><%= t('aset.email_smtp') %></h2>
|
|---|
| 119 | <p class="set-help"><%= t('aset.smtp_help_1') %> <strong><%= t('aset.smtp_help_newsletter') %></strong><%= t('aset.smtp_help_2') %> <strong><%= t('aset.smtp_help_notify') %></strong><%= t('aset.smtp_help_3') %>
|
|---|
| 120 | <% if (smtp && smtp.configured) { %><br><strong><%= t('aset.status_set') %> ✓</strong><% if (smtp.fromEnv) { %> <small>(<%= t('aset.via_env') %>)</small><% } %><% } else { %><br><%= t('aset.smtp_not_set') %><% } %></p>
|
|---|
| [ca507ef] | 121 |
|
|---|
| 122 | <form method="post" action="/admin/settings/smtp" class="set-form">
|
|---|
| [bbf9d1a] | 123 | <label><span><%= t('aset.smtp_host') %></span>
|
|---|
| [ca507ef] | 124 | <input type="text" name="smtp_host" value="<%= smtp ? smtp.host : '' %>" placeholder="smtp.jouwprovider.nl" autocomplete="off">
|
|---|
| 125 | </label>
|
|---|
| [bbf9d1a] | 126 | <label><span><%= t('aset.smtp_port') %> <small style="font-weight:400">— <%= t('aset.smtp_port_hint') %></small></span>
|
|---|
| [ca507ef] | 127 | <input type="text" name="smtp_port" value="<%= (smtp && smtp.port) ? smtp.port : '' %>" placeholder="587" autocomplete="off" inputmode="numeric">
|
|---|
| 128 | </label>
|
|---|
| [bbf9d1a] | 129 | <label><span><%= t('aset.smtp_user') %></span>
|
|---|
| [ca507ef] | 130 | <input type="text" name="smtp_user" value="<%= smtp ? smtp.user : '' %>" placeholder="jij@jouwprovider.nl" autocomplete="off">
|
|---|
| 131 | </label>
|
|---|
| [bbf9d1a] | 132 | <label><span><%= t('aset.smtp_pass') %> <% if (smtp && smtp.passSet) { %><small style="font-weight:400">— <%= t('aset.smtp_pass_set_hint') %></small><% } %></span>
|
|---|
| 133 | <input type="password" name="smtp_pass" placeholder="<%= (smtp && smtp.passSet) ? t('aset.smtp_pass_ph_set') : t('aset.smtp_pass_ph') %>" autocomplete="off">
|
|---|
| [ca507ef] | 134 | </label>
|
|---|
| [bbf9d1a] | 135 | <label><span><%= t('aset.smtp_from') %> <small style="font-weight:400">— <%= t('aset.smtp_from_hint') %></small></span>
|
|---|
| 136 | <input type="text" name="smtp_from" value="<%= smtp ? smtp.from : '' %>" placeholder="<%= t('aset.smtp_from_ph') %>" autocomplete="off">
|
|---|
| [ca507ef] | 137 | </label>
|
|---|
| 138 | <div class="set-actions">
|
|---|
| [bbf9d1a] | 139 | <button type="submit" class="btn btn-primary"><%= t('aset.smtp_save') %></button>
|
|---|
| [ca507ef] | 140 | <% if (smtp && (smtp.host || smtp.passSet)) { %>
|
|---|
| [bbf9d1a] | 141 | <button type="submit" name="clear" value="1" class="btn" formnovalidate><%= t('aset.clear') %></button>
|
|---|
| [ca507ef] | 142 | <% } %>
|
|---|
| 143 | </div>
|
|---|
| 144 | </form>
|
|---|
| 145 |
|
|---|
| 146 | <% if (smtp && smtp.configured) { %>
|
|---|
| 147 | <form method="post" action="/admin/settings/smtp/test" class="set-form" style="margin-top:.8rem">
|
|---|
| [bbf9d1a] | 148 | <label><span><%= t('aset.test_mail_to') %></span>
|
|---|
| [ca507ef] | 149 | <input type="email" name="to" placeholder="jij@email.nl" autocomplete="off">
|
|---|
| 150 | </label>
|
|---|
| [bbf9d1a] | 151 | <div class="set-actions"><button type="submit" class="btn">✉ <%= t('aset.send_test_mail') %></button></div>
|
|---|
| [ca507ef] | 152 | </form>
|
|---|
| 153 | <% } %>
|
|---|
| 154 | </section>
|
|---|
| 155 |
|
|---|
| [6351545] | 156 | </div>
|
|---|
| 157 |
|
|---|
| 158 | <style>
|
|---|
| 159 | .admin-page { max-width: 700px; margin: 3rem auto; padding: 0 1rem; }
|
|---|
| 160 | .admin-page h1 { font-family: var(--font-display, serif); font-size: 2rem; margin: 0 0 0.25rem; }
|
|---|
| 161 | .admin-tagline { color: var(--ink-muted); margin: 0 0 2rem; }
|
|---|
| 162 | .admin-tagline a { color: var(--accent); }
|
|---|
| 163 | .set-card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem; }
|
|---|
| [834bcc3] | 164 | /* Mode-specific card (Hub/Circle): accent border on the left so it visually
|
|---|
| 165 | belongs to the selected mode, directly below the Mode card. */
|
|---|
| [323abb0] | 166 | .set-card--mode { border-left: 3px solid var(--accent); }
|
|---|
| [6351545] | 167 | .set-card h2 { font-family: var(--font-display, serif); font-size: 1.25rem; margin: 0 0 0.5rem; }
|
|---|
| 168 | .set-help { color: var(--ink-muted); font-size: 0.9rem; margin: 0 0 1.25rem; }
|
|---|
| [834bcc3] | 169 | /* Google setup guide (collapsible) */
|
|---|
| [c50f22e] | 170 | .set-google-guide { margin: 0 0 1rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); }
|
|---|
| 171 | .set-google-guide > summary { cursor: pointer; padding: 0.6rem 0.85rem; font-size: 0.9rem; font-weight: 600; color: var(--accent); list-style: none; }
|
|---|
| 172 | .set-google-guide > summary::-webkit-details-marker { display: none; }
|
|---|
| 173 | .set-google-guide > summary::before { content: "▸ "; }
|
|---|
| 174 | .set-google-guide[open] > summary::before { content: "▾ "; }
|
|---|
| 175 | .set-google-steps { margin: 0; padding: 0 1rem 0.6rem 2rem; font-size: 0.88rem; color: var(--ink); line-height: 1.5; }
|
|---|
| 176 | .set-google-steps li { margin: 0.35rem 0; }
|
|---|
| 177 | .set-google-guide code { background: var(--paper-2); padding: 0.05rem 0.35rem; border-radius: 4px; font-size: 0.85em; }
|
|---|
| 178 | .set-google-guide .set-help { padding: 0 0.85rem; }
|
|---|
| [0804d61] | 179 | .set-form { display: flex; flex-direction: column; gap: 1rem; max-width: 460px; }
|
|---|
| [834bcc3] | 180 | /* Bare <label>s inside a set-form inherit the same neat stacked style as .set-field:
|
|---|
| 181 | label text on top, input full-width. (.set-toggle = checkbox row, excluded.) */
|
|---|
| [323abb0] | 182 | .set-form > label:not(.set-toggle):not(.set-opt) { display: flex; flex-direction: column; gap: 0.3rem; }
|
|---|
| 183 | .set-form > label:not(.set-toggle):not(.set-opt) > span { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft, var(--ink-muted)); }
|
|---|
| 184 | .set-form > label:not(.set-toggle):not(.set-opt) > span small { font-weight: 400; }
|
|---|
| 185 | .set-form > label:not(.set-toggle):not(.set-opt) input {
|
|---|
| [0804d61] | 186 | width: 100%; box-sizing: border-box; padding: 0.55rem 0.7rem;
|
|---|
| 187 | border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink);
|
|---|
| 188 | font: inherit; font-size: 0.95rem;
|
|---|
| 189 | }
|
|---|
| [323abb0] | 190 | .set-form > label:not(.set-toggle):not(.set-opt) input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
|
|---|
| [0804d61] | 191 | .set-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }
|
|---|
| [6351545] | 192 | .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); }
|
|---|
| 193 | .set-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
|
|---|
| 194 | .set-opt input { margin-top: 0.25rem; flex-shrink: 0; }
|
|---|
| 195 | .set-opt span { display: flex; flex-direction: column; gap: 0.2rem; }
|
|---|
| 196 | .set-opt small { color: var(--ink-muted); font-size: 0.82rem; }
|
|---|
| 197 | .set-opt code { background: var(--paper-2); padding: 0.05rem 0.35rem; border-radius: 3px; font-size: 0.85em; }
|
|---|
| 198 | .set-form .btn { align-self: flex-start; }
|
|---|
| [6e0249f] | 199 | .set-field { display: flex; flex-direction: column; gap: 0.3rem; }
|
|---|
| 200 | .set-field > span { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft, var(--ink-muted)); }
|
|---|
| 201 | .set-field input, .set-field textarea {
|
|---|
| 202 | width: 100%; box-sizing: border-box; padding: 0.55rem 0.7rem;
|
|---|
| 203 | border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink);
|
|---|
| 204 | font: inherit; font-size: 0.95rem;
|
|---|
| 205 | }
|
|---|
| 206 | .set-field textarea { resize: vertical; }
|
|---|
| 207 | .set-field input:focus, .set-field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
|
|---|
| [834bcc3] | 208 | /* Selects styled the same as inputs instead of the bare native dropdown:
|
|---|
| 209 | custom chevron, accent focus ring, full width. */
|
|---|
| [d6bdbae] | 210 | .set-form select {
|
|---|
| 211 | appearance: none; -webkit-appearance: none;
|
|---|
| 212 | width: 100%; box-sizing: border-box;
|
|---|
| 213 | padding: 0.55rem 2.2rem 0.55rem 0.7rem;
|
|---|
| 214 | border: 1px solid var(--rule); border-radius: 6px;
|
|---|
| 215 | background-color: var(--paper); color: var(--ink);
|
|---|
| 216 | font: inherit; font-size: 0.95rem; cursor: pointer;
|
|---|
| 217 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
|
|---|
| 218 | background-repeat: no-repeat; background-position: right 0.7rem center;
|
|---|
| 219 | transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|---|
| 220 | }
|
|---|
| 221 | .set-form select:hover { border-color: var(--ink-soft, #888); }
|
|---|
| 222 | .set-form select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
|
|---|
| 223 | .set-form select option { background: var(--paper); color: var(--ink); }
|
|---|
| [6351545] | 224 | .alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
|
|---|
| 225 | .alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
|
|---|
| 226 | </style>
|
|---|