source: Klonkt/src/views/pages/admin-site-edit.ejs@ face47a

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

fix(hub): show Owner select only in hub mode (removes solo footgun)

The god-only Owner select was also shown in solo mode, where it is pointless/
confusing (one site, one owner). Now gated on tenancy==='hub'. The server was
already god-only (admin-sites.js line 338); this covers the visible side.

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

  • Property mode set to 100644
File size: 25.5 KB
Line 
1<div class="container admin-site-edit-page">
2 <p><a href="/admin" class="btn">&larr; <%= t('asite.back_admin') %></a></p>
3 <h1><%= isNew ? t('asite.title_new') : t('asite.title_edit') + ': ' + site.title %></h1>
4
5 <% if (typeof success !== 'undefined' && success) { %><div class="audio-flash audio-flash--ok"><%= success %></div><% } %>
6 <% if (error) { %><div class="audio-flash audio-flash--err"><%= error %></div><% } %>
7
8 <form method="post" action="<%= isNew ? '/admin/sites/create' : '/admin/sites/' + site.slug + '/save' %>" class="site-form">
9
10 <fieldset>
11 <legend><%= t('asite.identity') %></legend>
12 <label>
13 <span><%= t('asite.slug') %> <% if (!isNew) { %><em><%= t('asite.slug_fixed') %></em><% } %></span>
14 <span class="slug-url">
15 <span class="slug-url-host" id="slug-host"
16 data-prefix="<%= (typeof tenancy !== 'undefined' && tenancy === 'hub') ? '/user/' : '/' %>">website.com/</span><input
17 type="text" name="slug" id="slug-input" class="slug-url-input" value="<%= site.slug %>" required <% if (!isNew) { %>readonly<% } %>
18 pattern="[a-z0-9_-]{2,40}" placeholder="<%= t('asite.slug_placeholder') %>"
19 autocapitalize="none" autocorrect="off" spellcheck="false">
20 </span>
21 </label>
22 <label>
23 <span><%= t('asite.field_title') %> <small class="form-hint-inline"><%= t('asite.field_title_hint') %></small></span>
24 <input type="text" name="title" value="<%= site.title || '' %>" required maxlength="200">
25 </label>
26 <%# Eigenaar (her)toewijzen — ALLEEN god ÉN alleen in hub-modus. In hub geef
27 je zo elke gebruiker z'n eigen, zelf te beheren Klonkt. In solo (één site,
28 één eigenaar) is dit zinloos/verwarrend, dus verborgen. %>
29 <% if (user && user.role === 'god' && (typeof tenancy !== 'undefined' && tenancy === 'hub')) { %>
30 <label>
31 <span><%= t('asite.owner') %> <small class="form-hint-inline"><%= t('asite.owner_hint') %></small></span>
32 <% var _godSuffix = t('asite.owner_god_suffix'); %>
33 <select name="owner_id">
34 <% (typeof users !== 'undefined' ? users : []).forEach(function(u){ %>
35 <option value="<%= u.id %>" <%= (site.owner_id === u.id) ? 'selected' : '' %>><%= u.username %><%= u.role === 'god' ? _godSuffix : '' %></option>
36 <% }); %>
37 </select>
38 </label>
39 <% } %>
40 <label>
41 <span><%= t('asite.tagline') %> <small class="form-hint-inline"><%= t('asite.tagline_hint') %></small></span>
42 <input type="text" name="tagline" value="<%= site.tagline || '' %>" maxlength="200">
43 </label>
44 <label>
45 <span><%= t('asite.bio') %> <small class="form-hint-inline"><%= t('asite.bio_hint') %></small></span>
46 <textarea name="description" rows="3" maxlength="500"><%= site.description || '' %></textarea>
47 </label>
48 <label>
49 <span><%= t('asite.profile_photo') %></span>
50 <div class="photo-picker" id="photo-picker">
51 <div class="photo-thumb" id="photo-thumb" <%= site.profile_photo ? '' : 'data-empty' %>>
52 <img id="photo-preview" src="<%= site.profile_photo || '' %>" alt="" <%= site.profile_photo ? '' : 'hidden' %>>
53 <span class="photo-empty" aria-hidden="true">
54 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
55 </span>
56 </div>
57 <div class="photo-controls">
58 <input type="text" name="profile_photo" id="photo-url" value="<%= site.profile_photo || '' %>" placeholder="<%= t('asite.photo_url_placeholder') %>">
59 <div class="photo-actions">
60 <button type="button" class="btn" id="photo-upload-trigger"><%= t('asite.photo_upload') %></button>
61 <button type="button" class="btn" id="photo-clear" <%= site.profile_photo ? '' : 'hidden' %>><%= t('asite.photo_clear') %></button>
62 <small id="photo-status" class="form-hint photo-status"></small>
63 </div>
64 <input type="file" id="photo-upload-field" accept="image/jpeg,image/png,image/webp,image/gif" hidden>
65 </div>
66 </div>
67 </label>
68 <label>
69 <span><%= t('asite.language') %></span>
70 <input type="text" name="language" value="<%= site.language || 'nl' %>" maxlength="8">
71 </label>
72 <label class="cb">
73 <input type="checkbox" name="profile_enabled" value="1" <%= site.profile_enabled ? 'checked' : '' %>>
74 <span><%= t('asite.profile_enabled') %></span>
75 </label>
76 </fieldset>
77
78 <fieldset>
79 <legend><%= t('asite.appearance') %></legend>
80
81 <%# ── Curated accent picker ───────────────────────────────────────
82 Was a free-form <input type="color">; now a fixed set of 8 hand-
83 picked colors that work in both light and dark themes. The hex is
84 still what's stored in the DB — we just constrain WHICH hex. %>
85 <fieldset class="accent-grid">
86 <legend><%= t('asite.accent_color') %></legend>
87 <% const _curAccent = (site.accent || '#c2410c').toLowerCase(); %>
88 <% accents.forEach(function(a) { %>
89 <label class="accent-swatch" title="<%= a.name %>">
90 <input type="radio" name="accent" value="<%= a.color %>" <%= a.color.toLowerCase() === _curAccent ? 'checked' : '' %>>
91 <span class="accent-dot" style="background: <%= a.color %>;" aria-hidden="true"></span>
92 <span class="accent-swatch-name"><%= a.name %></span>
93 </label>
94 <% }); %>
95 </fieldset>
96
97 <%# ── Default theme for new visitors ───────────────────────────
98 'auto' (empty value) lets the browser/OS decide via prefers-color-scheme.
99 'light' / 'dark' force the site default for visitors who haven't picked
100 their own preference yet. Logged-in users with users.theme set, and
101 visitors with a localStorage override, still win over this default. %>
102 <fieldset class="theme-default">
103 <legend><%= t('asite.theme_default') %></legend>
104 <% const td = site.theme_override || ''; %>
105 <label class="cb">
106 <input type="radio" name="theme_override" value="" <%= td === '' ? 'checked' : '' %>>
107 <span><%= t('asite.theme_auto') %></span>
108 </label>
109 <label class="cb">
110 <input type="radio" name="theme_override" value="light" <%= td === 'light' ? 'checked' : '' %>>
111 <span><%= t('asite.theme_light') %></span>
112 </label>
113 <label class="cb">
114 <input type="radio" name="theme_override" value="dark" <%= td === 'dark' ? 'checked' : '' %>>
115 <span><%= t('asite.theme_dark') %></span>
116 </label>
117 </fieldset>
118
119 <fieldset class="palette-grid">
120 <legend><%= t('asite.palette') %></legend>
121 <% palettes.forEach(function(p) { %>
122 <label class="palette-swatch">
123 <input type="radio" name="palette" value="<%= p.key %>" <%= (site.palette || 'sage') === p.key ? 'checked' : '' %>>
124 <span class="palette-preview" aria-hidden="true">
125 <span class="pp-half pp-light" style="background: <%= p.light.paper %>; color: <%= p.light.ink %>;">
126 <span class="pp-letter">Aa</span>
127 <span class="pp-accent" style="background: <%= p.light.accent %>;"></span>
128 </span>
129 <span class="pp-half pp-dark" style="background: <%= p.dark.paper %>; color: <%= p.dark.ink %>;">
130 <span class="pp-letter">Aa</span>
131 <span class="pp-accent" style="background: <%= p.dark.accent %>;"></span>
132 </span>
133 </span>
134 <span class="palette-swatch-name"><%= p.name %></span>
135 </label>
136 <% }); %>
137 </fieldset>
138 </fieldset>
139
140 <fieldset>
141 <legend><%= t('asite.behavior') %></legend>
142 <label class="cb">
143 <input type="checkbox" name="is_public" value="1" <%= site.is_public ? 'checked' : '' %>>
144 <span><%= t('asite.is_public') %></span>
145 </label>
146 <label class="cb">
147 <input type="checkbox" name="robots_index" value="1" <%= site.robots_index ? 'checked' : '' %>>
148 <span><%= t('asite.robots_index') %></span>
149 </label>
150 <label class="cb">
151 <input type="checkbox" name="require_login_to_comment" value="1" <%= site.require_login_to_comment ? 'checked' : '' %>>
152 <span><%= t('asite.require_login_comment') %></span>
153 </label>
154 <label>
155 <span><%= t('asite.comment_moderation') %></span>
156 <select name="comments_moderation_mode">
157 <option value="trust" <%= (site.comments_moderation_mode || 'trust') === 'trust' ? 'selected' : '' %>><%= t('asite.moderation_trust') %></option>
158 <option value="moderate" <%= site.comments_moderation_mode === 'moderate' ? 'selected' : '' %>><%= t('asite.moderation_moderate') %></option>
159 </select>
160 </label>
161 <label class="cb">
162 <input type="checkbox" name="enable_audio_player" value="1" <%= site.enable_audio_player ? 'checked' : '' %>>
163 <span><%= t('asite.enable_audio') %></span>
164 </label>
165 <%# Prutter is een Hub-only premium-functie — toggle alleen tonen in Hub-modus. %>
166 <% if (typeof tenancy !== 'undefined' && tenancy === 'hub') { %>
167 <label class="cb">
168 <input type="checkbox" name="enable_prutter" value="1" <%= site.enable_prutter ? 'checked' : '' %>>
169 <span><%= t('asite.enable_prutter') %> <small class="form-hint-inline"><%= t('asite.enable_prutter_hint') %></small></span>
170 </label>
171 <% } %>
172 </fieldset>
173
174 <fieldset class="profile-links-fieldset">
175 <legend><%= t('asite.links') %></legend>
176 <p class="form-hint"><%= t('asite.links_hint') %></p>
177
178 <div id="profile-links-rows">
179 <% (parsedLinks || []).forEach(function(l) { %>
180 <div class="profile-link-row">
181 <select name="profile_link_platform[]">
182 <% platforms.forEach(function(p) { %>
183 <option value="<%= p.key %>" <%= l.platform === p.key ? 'selected' : '' %>><%= p.label %></option>
184 <% }); %>
185 </select>
186 <input type="text" name="profile_link_url[]" value="<%= l.url %>" placeholder="https://…" required>
187 <button type="button" class="btn btn-danger pl-remove">×</button>
188 </div>
189 <% }); %>
190 </div>
191
192 <template id="profile-link-template">
193 <div class="profile-link-row">
194 <select name="profile_link_platform[]">
195 <% platforms.forEach(function(p) { %>
196 <option value="<%= p.key %>"><%= p.label %></option>
197 <% }); %>
198 </select>
199 <input type="text" name="profile_link_url[]" placeholder="https://…" required>
200 <button type="button" class="btn btn-danger pl-remove">×</button>
201 </div>
202 </template>
203
204 <button type="button" id="profile-link-add" class="btn"><%= t('asite.link_add') %></button>
205 </fieldset>
206
207 <fieldset>
208 <legend><%= t('asite.feed_view') %></legend>
209 <label>
210 <span><%= t('asite.feed_default') %></span>
211 <select name="feed_view_default">
212 <option value="timeline" <%= (site.feed_view_default || 'timeline') === 'timeline' ? 'selected' : '' %>><%= t('asite.feed_timeline') %></option>
213 <option value="grid" <%= site.feed_view_default === 'grid' ? 'selected' : '' %>><%= t('asite.feed_grid') %></option>
214 </select>
215 </label>
216 <label class="cb">
217 <input type="checkbox" name="feed_view_switch" value="1" <%= site.feed_view_switch ? 'checked' : '' %>>
218 <span><%= t('asite.feed_switch') %></span>
219 </label>
220 <label class="cb">
221 <input type="checkbox" name="show_search" value="1" <%= site.show_search ? 'checked' : '' %>>
222 <span><%= t('asite.show_search') %></span>
223 </label>
224 <label class="cb">
225 <input type="checkbox" name="show_archive_link" value="1" <%= site.show_archive_link ? 'checked' : '' %>>
226 <span><%= t('asite.show_archive') %></span>
227 </label>
228 </fieldset>
229
230 <fieldset class="seo-pointer">
231 <legend><%= t('asite.seo') %></legend>
232 <p><%= t('asite.seo_pointer') %> <a href="/admin/seo"><%= t('asite.seo_link') %></a>.</p>
233 </fieldset>
234
235 <fieldset>
236 <legend><%= t('asite.custom_legend') %> <em><%= t('asite.optional') %></em></legend>
237 <label>
238 <span><%= t('asite.custom_css') %></span>
239 <textarea name="custom_css" rows="3" placeholder=".foo { color: red; }"><%= site.custom_css || '' %></textarea>
240 </label>
241 <label>
242 <span><%= t('asite.custom_head') %></span>
243 <textarea name="custom_head_html" rows="3" placeholder="<meta name=&quot;...&quot;>"><%= site.custom_head_html || '' %></textarea>
244 </label>
245 <label>
246 <span><%= t('asite.custom_foot') %></span>
247 <textarea name="custom_foot_html" rows="3"><%= site.custom_foot_html || '' %></textarea>
248 </label>
249 </fieldset>
250
251 <button type="submit" class="btn btn-primary"><%= isNew ? t('asite.submit_create') : t('asite.submit_save') %></button>
252 </form>
253</div>
254
255<script>
256(function() {
257 // Slug-URL-veld: toon de echte host als gedimde prefix (de slug zelf is
258 // gekleurd via CSS). Hub → host/user/<slug>, anders host/<slug>.
259 var sh = document.getElementById('slug-host');
260 if (sh) sh.textContent = location.host + (sh.dataset.prefix || '/');
261})();
262(function() {
263 // Profile-links repeater: add row from <template>, remove on click.
264 var rows = document.getElementById('profile-links-rows');
265 var tpl = document.getElementById('profile-link-template');
266 var add = document.getElementById('profile-link-add');
267 if (!rows || !tpl || !add) return;
268
269 add.addEventListener('click', function() {
270 var clone = tpl.content.cloneNode(true);
271 rows.appendChild(clone);
272 });
273 rows.addEventListener('click', function(e) {
274 if (e.target && e.target.classList.contains('pl-remove')) {
275 var row = e.target.closest('.profile-link-row');
276 if (row) row.remove();
277 }
278 });
279})();
280
281// P63 — Profile photo picker: upload via /admin/sites/upload-photo,
282// then write the returned URL into the visible input. Live thumb preview.
283(function() {
284 var picker = document.getElementById('photo-picker');
285 if (!picker) return;
286 var thumb = document.getElementById('photo-thumb');
287 var preview = document.getElementById('photo-preview');
288 var urlEl = document.getElementById('photo-url');
289 var trigger = document.getElementById('photo-upload-trigger');
290 var clear = document.getElementById('photo-clear');
291 var field = document.getElementById('photo-upload-field');
292 var status = document.getElementById('photo-status');
293
294 function showPreview(url) {
295 if (url) {
296 preview.src = url;
297 preview.hidden = false;
298 thumb.removeAttribute('data-empty');
299 clear.hidden = false;
300 } else {
301 preview.src = '';
302 preview.hidden = true;
303 thumb.setAttribute('data-empty', '');
304 clear.hidden = true;
305 }
306 }
307
308 if (urlEl) {
309 urlEl.addEventListener('input', function() {
310 showPreview(urlEl.value.trim());
311 });
312 }
313
314 if (trigger && field) {
315 trigger.addEventListener('click', function() { field.click(); });
316 field.addEventListener('change', async function() {
317 var file = field.files && field.files[0];
318 if (!file) return;
319 status.classList.remove('is-error');
320 status.textContent = 'Uploaden…';
321 try {
322 var fd = new FormData();
323 fd.append('photo', file);
324 var r = await fetch('/admin/sites/upload-photo', {
325 method: 'POST',
326 body: fd,
327 credentials: 'same-origin',
328 });
329 var j = await r.json();
330 if (!r.ok || !j.ok) throw new Error(j.error || ('Upload mislukt (' + r.status + ')'));
331 urlEl.value = j.url;
332 showPreview(j.url);
333 status.textContent = 'Geüpload ✓';
334 setTimeout(function() { status.textContent = ''; }, 2000);
335 } catch (e) {
336 status.classList.add('is-error');
337 status.textContent = 'Mislukt: ' + e.message;
338 } finally {
339 field.value = '';
340 }
341 });
342 }
343
344 if (clear) {
345 clear.addEventListener('click', function() {
346 urlEl.value = '';
347 showPreview('');
348 status.textContent = '';
349 // Note: doesn't delete the file from disk — saving the form with empty
350 // URL leaves the file orphaned on the server. Acceptable for now.
351 });
352 }
353})();
354</script>
355
356<style>
357.admin-site-edit-page { max-width: 760px; margin: 3rem auto; padding: 0 1rem; }
358.admin-site-edit-page h1 { font-family: var(--font-display, serif); font-size: 1.8rem; margin: 0 0 1.5rem; }
359
360.site-form { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
361/* Mobiel: een <fieldset> heeft een browser-default min-inline-size:min-content en
362 krimpt daardoor NIET mee → het hele formulier werd breder dan het scherm. min-width:0
363 forceert meekrimpen; de form-velden krijgen max-width:100% + border-box zodat ze
364 nooit buiten hun fieldset lopen. */
365.site-form fieldset { min-width: 0; }
366.site-form input, .site-form select, .site-form textarea { min-width: 0; max-width: 100%; box-sizing: border-box; }
367.site-form fieldset {
368 border: 1px solid var(--rule);
369 border-radius: 8px;
370 padding: 1rem 1.25rem;
371 background: var(--paper-2);
372 display: flex;
373 flex-direction: column;
374 gap: 0.75rem;
375}
376.site-form fieldset.palette-grid {
377 display: grid;
378 grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
379 background: var(--paper);
380 margin-top: 0.5rem;
381}
382/* Theme default radios — horizontal, sits between accent + palette */
383.site-form fieldset.theme-default {
384 display: flex; flex-direction: row; flex-wrap: wrap; gap: 1rem;
385 background: var(--paper);
386 margin-top: 0.5rem;
387}
388.site-form fieldset.theme-default label.cb { font-size: 0.9rem; color: var(--ink); }
389.site-form fieldset legend { font-family: var(--font-display, serif); font-size: 1rem; padding: 0 0.4rem; }
390.site-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--ink-muted, var(--ink-soft)); }
391.site-form label.cb { flex-direction: row; align-items: center; gap: 0.5rem; }
392.site-form input[type="text"], .site-form input[type="color"], .site-form textarea {
393 padding: 0.55rem 0.85rem;
394 border: 1px solid var(--rule);
395 border-radius: 5px;
396 background: var(--paper);
397 color: var(--ink);
398 font-family: inherit;
399 font-size: 0.95rem;
400}
401.site-form input[type="color"] { padding: 0.2rem; height: 38px; }
402.site-form textarea { resize: vertical; min-height: 60px; font-family: var(--font-mono, monospace); font-size: 0.85rem; }
403.site-form input[readonly] { opacity: 0.6; cursor: not-allowed; background: var(--paper-2); }
404
405/* Slug als URL-veld: gedimde host-prefix + de slug zelf in de accentkleur. */
406.slug-url {
407 display: flex; align-items: stretch;
408 border: 1px solid var(--rule); border-radius: 5px;
409 background: var(--paper); overflow: hidden;
410 transition: border-color 120ms;
411}
412.slug-url:focus-within { border-color: var(--accent); }
413.slug-url-host {
414 display: inline-flex; align-items: center;
415 padding-left: 0.85rem;
416 color: var(--ink-muted, var(--ink-soft));
417 white-space: nowrap; user-select: none;
418 font-size: 0.95rem;
419}
420.site-form .slug-url-input {
421 flex: 1 1 auto; min-width: 0;
422 border: none !important; border-radius: 0 !important;
423 background: transparent !important;
424 color: var(--accent) !important; font-weight: 700;
425 padding: 0.55rem 0.85rem 0.55rem 0.1rem;
426}
427.site-form .slug-url-input:focus { outline: none; }
428.site-form .slug-url-input[readonly] {
429 opacity: 1; cursor: default; background: transparent !important;
430}
431
432/* Selects: zelfde look als de inputs, met een eigen chevron i.p.v. de kale
433 native pijl. De geopende optielijst blijft door de browser gerenderd. */
434.site-form select {
435 appearance: none;
436 -webkit-appearance: none;
437 padding: 0.55rem 2.2rem 0.55rem 0.85rem;
438 border: 1px solid var(--rule);
439 border-radius: 5px;
440 background-color: var(--paper);
441 color: var(--ink);
442 font-family: inherit;
443 font-size: 0.95rem;
444 cursor: pointer;
445 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");
446 background-repeat: no-repeat;
447 background-position: right 0.7rem center;
448 transition: border-color 0.15s ease, box-shadow 0.15s ease;
449}
450.site-form select:hover { border-color: var(--ink-soft, #888); }
451.site-form select:focus,
452.site-form input[type="text"]:focus,
453.site-form textarea:focus {
454 outline: none;
455 border-color: var(--accent, #c2410c);
456 box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #c2410c) 22%, transparent);
457}
458
459/* Reuse the palette-swatch styles from account.ejs */
460.palette-swatch {
461 display: flex; flex-direction: column; gap: 0.4rem;
462 padding: 0.5rem;
463 border: 1px solid var(--rule); border-radius: 6px; background: var(--paper);
464 cursor: pointer; font-size: 0.85rem; transition: border-color 120ms;
465}
466.palette-swatch:hover { border-color: var(--accent); }
467.palette-swatch input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
468.palette-swatch:has(input[type="radio"]:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
469.palette-preview {
470 display: grid; grid-template-columns: 1fr 1fr;
471 width: 100%; height: 44px; border-radius: 4px; overflow: hidden;
472 border: 1px solid var(--rule);
473}
474.pp-half {
475 position: relative;
476 display: flex; align-items: center; justify-content: center;
477 font-family: var(--font-display, serif); font-weight: 600; font-size: 1rem;
478}
479.pp-letter { line-height: 1; }
480.pp-accent {
481 position: absolute; bottom: 4px; right: 4px;
482 width: 9px; height: 9px; border-radius: 50%;
483 border: 1px solid rgba(0,0,0,0.12);
484}
485.palette-swatch-name { font-weight: 500; color: var(--ink); text-align: center; }
486
487/* Accent picker: row of small colored swatches */
488.site-form fieldset.accent-grid {
489 display: grid;
490 grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
491 gap: 0.5rem;
492 background: var(--paper);
493 margin-top: 0.5rem;
494}
495.accent-swatch {
496 display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
497 padding: 0.55rem 0.4rem;
498 border: 1px solid var(--rule); border-radius: 6px; background: var(--paper);
499 cursor: pointer; font-size: 0.78rem;
500 transition: border-color 120ms, box-shadow 120ms;
501}
502.accent-swatch:hover { border-color: var(--accent); }
503.accent-swatch input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
504.accent-swatch:has(input[type="radio"]:checked) {
505 border-color: var(--accent);
506 box-shadow: 0 0 0 2px var(--accent);
507}
508.accent-dot {
509 width: 28px; height: 28px; border-radius: 50%;
510 border: 1px solid rgba(0,0,0,0.1);
511 box-shadow: inset 0 -2px 4px rgba(0,0,0,0.12);
512}
513.accent-swatch-name { color: var(--ink); text-align: center; font-weight: 500; }
514
515.audio-flash { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
516.audio-flash--ok { background: rgba(40, 160, 90, 0.15); color: #2a9d5e; border: 1px solid rgba(40, 160, 90, 0.3); }
517.audio-flash--err { background: rgba(200, 60, 60, 0.15); color: #c33; border: 1px solid rgba(200, 60, 60, 0.3); }
518
519.form-hint { font-size: 0.8rem; color: var(--ink-muted, var(--ink-soft)); margin: 0; }
520.form-hint-inline { font-size: 0.78rem; color: var(--ink-muted, var(--ink-soft)); font-weight: 400; margin-left: .25rem; }
521
522/* P63 — Profile photo picker
523 Mobile-first: thumb stacks above input/buttons. ≥520px the thumb floats
524 to the left and the controls fill the remaining width. */
525.photo-picker {
526 display: flex;
527 flex-direction: column;
528 gap: .65rem;
529 align-items: stretch;
530}
531.photo-thumb {
532 position: relative;
533 width: 88px; height: 88px;
534 border-radius: 50%;
535 border: 1px solid var(--rule);
536 background: var(--paper-2);
537 overflow: hidden;
538 flex-shrink: 0;
539 display: flex; align-items: center; justify-content: center;
540}
541.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
542.photo-thumb .photo-empty {
543 display: flex; color: var(--ink-muted, var(--ink-soft)); opacity: .55;
544}
545.photo-thumb .photo-empty svg { width: 36px; height: 36px; }
546.photo-thumb:not([data-empty]) .photo-empty { display: none; }
547.photo-thumb[data-empty] img { display: none; }
548
549.photo-controls {
550 display: flex;
551 flex-direction: column;
552 gap: .5rem;
553 flex: 1;
554 min-width: 0;
555}
556.photo-controls input[type="text"] { width: 100%; }
557.photo-actions {
558 display: flex; align-items: center; flex-wrap: wrap;
559 gap: .4rem;
560}
561.photo-actions .btn { padding: .45rem .75rem; font-size: .85rem; }
562.photo-status { margin-left: .25rem; }
563.photo-status.is-error { color: #c2410c; }
564
565@media (min-width: 520px) {
566 .photo-picker { flex-direction: row; align-items: flex-start; gap: 1rem; }
567 .photo-controls { gap: .55rem; }
568}
569/* Mobiel-eerst: platform-keuze op een eigen regel (volle breedte), daaronder de
570 URL-input + verwijderknop. Voorkomt horizontale overflow op telefoons (de vaste
571 160px-kolom + niet-krimpbare input liepen samen ~447px > schermbreedte). */
572.profile-link-row {
573 display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; margin-bottom: 0.5rem;
574}
575.profile-link-row select { padding: 0.45rem 0.6rem; grid-column: 1 / -1; }
576.profile-link-row input { min-width: 0; }
577@media (min-width: 520px) {
578 .profile-link-row { grid-template-columns: 160px 1fr auto; }
579 .profile-link-row select { grid-column: auto; }
580}
581.profile-links-fieldset details > label { margin-top: 0.4rem; }
582</style>
Note: See TracBrowser for help on using the repository browser.