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

main
Last change on this file since dc8e9bd was 59f0170, checked in by Robin Genis <roboburr@…>, 3 months ago

refactor(comments): remove native comments — social is fediverse-only

Removes routes/comments.js + admin-comments.js (+ mounts), the comment section &
reply UI on posts, comment loading in the post route, the admin moderation page +
links, and the per-site comment-moderation settings. The 'From the fediverse'
section is now the post's comment area. The .comment CSS stays (reused there);
the comments table is left in place (dead) so old-data cascade-deletes still work.

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

  • Property mode set to 100644
File size: 24.4 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 <%# Assign (or reassign) owner — ONLY god AND only in hub mode. In hub this
27 gives each user their own self-managed Klonkt. In solo (one site,
28 one owner) this is pointless/confusing, so it's hidden. %>
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 <% if (typeof audioEnabled === 'undefined' || audioEnabled) { %>
151 <label class="cb">
152 <input type="checkbox" name="enable_audio_player" value="1" <%= site.enable_audio_player ? 'checked' : '' %>>
153 <span><%= t('asite.enable_audio') %></span>
154 </label>
155 <% } %>
156 </fieldset>
157
158 <fieldset class="profile-links-fieldset">
159 <legend><%= t('asite.links') %></legend>
160 <p class="form-hint"><%= t('asite.links_hint') %></p>
161
162 <div id="profile-links-rows">
163 <% (parsedLinks || []).forEach(function(l) { %>
164 <div class="profile-link-row">
165 <select name="profile_link_platform[]">
166 <% platforms.forEach(function(p) { %>
167 <option value="<%= p.key %>" <%= l.platform === p.key ? 'selected' : '' %>><%= p.label %></option>
168 <% }); %>
169 </select>
170 <input type="text" name="profile_link_url[]" value="<%= l.url %>" placeholder="https://…" required>
171 <button type="button" class="btn btn-danger pl-remove">×</button>
172 </div>
173 <% }); %>
174 </div>
175
176 <template id="profile-link-template">
177 <div class="profile-link-row">
178 <select name="profile_link_platform[]">
179 <% platforms.forEach(function(p) { %>
180 <option value="<%= p.key %>"><%= p.label %></option>
181 <% }); %>
182 </select>
183 <input type="text" name="profile_link_url[]" placeholder="https://…" required>
184 <button type="button" class="btn btn-danger pl-remove">×</button>
185 </div>
186 </template>
187
188 <button type="button" id="profile-link-add" class="btn"><%= t('asite.link_add') %></button>
189 </fieldset>
190
191 <fieldset>
192 <legend><%= t('asite.feed_view') %></legend>
193 <label>
194 <span><%= t('asite.feed_default') %></span>
195 <select name="feed_view_default">
196 <option value="timeline" <%= (site.feed_view_default || 'timeline') === 'timeline' ? 'selected' : '' %>><%= t('asite.feed_timeline') %></option>
197 <option value="grid" <%= site.feed_view_default === 'grid' ? 'selected' : '' %>><%= t('asite.feed_grid') %></option>
198 </select>
199 </label>
200 <label class="cb">
201 <input type="checkbox" name="feed_view_switch" value="1" <%= site.feed_view_switch ? 'checked' : '' %>>
202 <span><%= t('asite.feed_switch') %></span>
203 </label>
204 <label class="cb">
205 <input type="checkbox" name="show_search" value="1" <%= site.show_search ? 'checked' : '' %>>
206 <span><%= t('asite.show_search') %></span>
207 </label>
208 <label class="cb">
209 <input type="checkbox" name="show_archive_link" value="1" <%= site.show_archive_link ? 'checked' : '' %>>
210 <span><%= t('asite.show_archive') %></span>
211 </label>
212 </fieldset>
213
214 <fieldset class="seo-pointer">
215 <legend><%= t('asite.seo') %></legend>
216 <p><%= t('asite.seo_pointer') %> <a href="/admin/seo"><%= t('asite.seo_link') %></a>.</p>
217 </fieldset>
218
219 <fieldset>
220 <legend><%= t('asite.custom_legend') %> <em><%= t('asite.optional') %></em></legend>
221 <label>
222 <span><%= t('asite.custom_css') %></span>
223 <textarea name="custom_css" rows="3" placeholder=".foo { color: red; }"><%= site.custom_css || '' %></textarea>
224 </label>
225 <label>
226 <span><%= t('asite.custom_head') %></span>
227 <textarea name="custom_head_html" rows="3" placeholder="<meta name=&quot;...&quot;>"><%= site.custom_head_html || '' %></textarea>
228 </label>
229 <label>
230 <span><%= t('asite.custom_foot') %></span>
231 <textarea name="custom_foot_html" rows="3"><%= site.custom_foot_html || '' %></textarea>
232 </label>
233 </fieldset>
234
235 <button type="submit" class="btn btn-primary"><%= isNew ? t('asite.submit_create') : t('asite.submit_save') %></button>
236 </form>
237</div>
238
239<script>
240(function() {
241 // Slug URL field: show the real host as a dimmed prefix (the slug itself is
242 // coloured via CSS). Hub → host/user/<slug>, otherwise host/<slug>.
243 var sh = document.getElementById('slug-host');
244 if (sh) sh.textContent = location.host + (sh.dataset.prefix || '/');
245})();
246(function() {
247 // Profile-links repeater: add row from <template>, remove on click.
248 var rows = document.getElementById('profile-links-rows');
249 var tpl = document.getElementById('profile-link-template');
250 var add = document.getElementById('profile-link-add');
251 if (!rows || !tpl || !add) return;
252
253 add.addEventListener('click', function() {
254 var clone = tpl.content.cloneNode(true);
255 rows.appendChild(clone);
256 });
257 rows.addEventListener('click', function(e) {
258 if (e.target && e.target.classList.contains('pl-remove')) {
259 var row = e.target.closest('.profile-link-row');
260 if (row) row.remove();
261 }
262 });
263})();
264
265// P63 — Profile photo picker: upload via /admin/sites/upload-photo,
266// then write the returned URL into the visible input. Live thumb preview.
267(function() {
268 var picker = document.getElementById('photo-picker');
269 if (!picker) return;
270 var thumb = document.getElementById('photo-thumb');
271 var preview = document.getElementById('photo-preview');
272 var urlEl = document.getElementById('photo-url');
273 var trigger = document.getElementById('photo-upload-trigger');
274 var clear = document.getElementById('photo-clear');
275 var field = document.getElementById('photo-upload-field');
276 var status = document.getElementById('photo-status');
277
278 function showPreview(url) {
279 if (url) {
280 preview.src = url;
281 preview.hidden = false;
282 thumb.removeAttribute('data-empty');
283 clear.hidden = false;
284 } else {
285 preview.src = '';
286 preview.hidden = true;
287 thumb.setAttribute('data-empty', '');
288 clear.hidden = true;
289 }
290 }
291
292 if (urlEl) {
293 urlEl.addEventListener('input', function() {
294 showPreview(urlEl.value.trim());
295 });
296 }
297
298 if (trigger && field) {
299 trigger.addEventListener('click', function() { field.click(); });
300 field.addEventListener('change', async function() {
301 var file = field.files && field.files[0];
302 if (!file) return;
303 status.classList.remove('is-error');
304 status.textContent = 'Uploaden…';
305 try {
306 var fd = new FormData();
307 fd.append('photo', file);
308 var r = await fetch('/admin/sites/upload-photo', {
309 method: 'POST',
310 body: fd,
311 credentials: 'same-origin',
312 });
313 var j = await r.json();
314 if (!r.ok || !j.ok) throw new Error(j.error || ('Upload mislukt (' + r.status + ')'));
315 urlEl.value = j.url;
316 showPreview(j.url);
317 status.textContent = 'Geüpload ✓';
318 setTimeout(function() { status.textContent = ''; }, 2000);
319 } catch (e) {
320 status.classList.add('is-error');
321 status.textContent = 'Mislukt: ' + e.message;
322 } finally {
323 field.value = '';
324 }
325 });
326 }
327
328 if (clear) {
329 clear.addEventListener('click', function() {
330 urlEl.value = '';
331 showPreview('');
332 status.textContent = '';
333 // Note: doesn't delete the file from disk — saving the form with empty
334 // URL leaves the file orphaned on the server. Acceptable for now.
335 });
336 }
337})();
338</script>
339
340<style>
341.admin-site-edit-page { max-width: 760px; margin: 3rem auto; padding: 0 1rem; }
342.admin-site-edit-page h1 { font-family: var(--font-display, serif); font-size: 1.8rem; margin: 0 0 1.5rem; }
343
344.site-form { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
345/* Mobile: a <fieldset> has a browser-default min-inline-size:min-content and
346 therefore does NOT shrink → the entire form became wider than the screen. min-width:0
347 forces it to shrink; form fields get max-width:100% + border-box so they
348 never overflow their fieldset. */
349.site-form fieldset { min-width: 0; }
350.site-form input, .site-form select, .site-form textarea { min-width: 0; max-width: 100%; box-sizing: border-box; }
351.site-form fieldset {
352 border: 1px solid var(--rule);
353 border-radius: 8px;
354 padding: 1rem 1.25rem;
355 background: var(--paper-2);
356 display: flex;
357 flex-direction: column;
358 gap: 0.75rem;
359}
360.site-form fieldset.palette-grid {
361 display: grid;
362 grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
363 background: var(--paper);
364 margin-top: 0.5rem;
365}
366/* Theme default radios — horizontal, sits between accent + palette */
367.site-form fieldset.theme-default {
368 display: flex; flex-direction: row; flex-wrap: wrap; gap: 1rem;
369 background: var(--paper);
370 margin-top: 0.5rem;
371}
372.site-form fieldset.theme-default label.cb { font-size: 0.9rem; color: var(--ink); }
373.site-form fieldset legend { font-family: var(--font-display, serif); font-size: 1rem; padding: 0 0.4rem; }
374.site-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--ink-muted, var(--ink-soft)); }
375.site-form label.cb { flex-direction: row; align-items: center; gap: 0.5rem; }
376.site-form input[type="text"], .site-form input[type="color"], .site-form textarea {
377 padding: 0.55rem 0.85rem;
378 border: 1px solid var(--rule);
379 border-radius: 5px;
380 background: var(--paper);
381 color: var(--ink);
382 font-family: inherit;
383 font-size: 0.95rem;
384}
385.site-form input[type="color"] { padding: 0.2rem; height: 38px; }
386.site-form textarea { resize: vertical; min-height: 60px; font-family: var(--font-mono, monospace); font-size: 0.85rem; }
387.site-form input[readonly] { opacity: 0.6; cursor: not-allowed; background: var(--paper-2); }
388
389/* Slug as URL field: dimmed host prefix + the slug itself in the accent colour. */
390.slug-url {
391 display: flex; align-items: stretch;
392 border: 1px solid var(--rule); border-radius: 5px;
393 background: var(--paper); overflow: hidden;
394 transition: border-color 120ms;
395}
396.slug-url:focus-within { border-color: var(--accent); }
397.slug-url-host {
398 display: inline-flex; align-items: center;
399 padding-left: 0.85rem;
400 color: var(--ink-muted, var(--ink-soft));
401 white-space: nowrap; user-select: none;
402 font-size: 0.95rem;
403}
404.site-form .slug-url-input {
405 flex: 1 1 auto; min-width: 0;
406 border: none !important; border-radius: 0 !important;
407 background: transparent !important;
408 color: var(--accent) !important; font-weight: 700;
409 padding: 0.55rem 0.85rem 0.55rem 0.1rem;
410}
411.site-form .slug-url-input:focus { outline: none; }
412.site-form .slug-url-input[readonly] {
413 opacity: 1; cursor: default; background: transparent !important;
414}
415
416/* Selects: same look as the inputs, with a custom chevron instead of the bare
417 native arrow. The open option list is still rendered by the browser. */
418.site-form select {
419 appearance: none;
420 -webkit-appearance: none;
421 padding: 0.55rem 2.2rem 0.55rem 0.85rem;
422 border: 1px solid var(--rule);
423 border-radius: 5px;
424 background-color: var(--paper);
425 color: var(--ink);
426 font-family: inherit;
427 font-size: 0.95rem;
428 cursor: pointer;
429 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");
430 background-repeat: no-repeat;
431 background-position: right 0.7rem center;
432 transition: border-color 0.15s ease, box-shadow 0.15s ease;
433}
434.site-form select:hover { border-color: var(--ink-soft, #888); }
435.site-form select:focus,
436.site-form input[type="text"]:focus,
437.site-form textarea:focus {
438 outline: none;
439 border-color: var(--accent, #c2410c);
440 box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #c2410c) 22%, transparent);
441}
442
443/* Reuse the palette-swatch styles from account.ejs */
444.palette-swatch {
445 display: flex; flex-direction: column; gap: 0.4rem;
446 padding: 0.5rem;
447 border: 1px solid var(--rule); border-radius: 6px; background: var(--paper);
448 cursor: pointer; font-size: 0.85rem; transition: border-color 120ms;
449}
450.palette-swatch:hover { border-color: var(--accent); }
451.palette-swatch input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
452.palette-swatch:has(input[type="radio"]:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
453.palette-preview {
454 display: grid; grid-template-columns: 1fr 1fr;
455 width: 100%; height: 44px; border-radius: 4px; overflow: hidden;
456 border: 1px solid var(--rule);
457}
458.pp-half {
459 position: relative;
460 display: flex; align-items: center; justify-content: center;
461 font-family: var(--font-display, serif); font-weight: 600; font-size: 1rem;
462}
463.pp-letter { line-height: 1; }
464.pp-accent {
465 position: absolute; bottom: 4px; right: 4px;
466 width: 9px; height: 9px; border-radius: 50%;
467 border: 1px solid rgba(0,0,0,0.12);
468}
469.palette-swatch-name { font-weight: 500; color: var(--ink); text-align: center; }
470
471/* Accent picker: row of small colored swatches */
472.site-form fieldset.accent-grid {
473 display: grid;
474 grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
475 gap: 0.5rem;
476 background: var(--paper);
477 margin-top: 0.5rem;
478}
479.accent-swatch {
480 display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
481 padding: 0.55rem 0.4rem;
482 border: 1px solid var(--rule); border-radius: 6px; background: var(--paper);
483 cursor: pointer; font-size: 0.78rem;
484 transition: border-color 120ms, box-shadow 120ms;
485}
486.accent-swatch:hover { border-color: var(--accent); }
487.accent-swatch input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
488.accent-swatch:has(input[type="radio"]:checked) {
489 border-color: var(--accent);
490 box-shadow: 0 0 0 2px var(--accent);
491}
492.accent-dot {
493 width: 28px; height: 28px; border-radius: 50%;
494 border: 1px solid rgba(0,0,0,0.1);
495 box-shadow: inset 0 -2px 4px rgba(0,0,0,0.12);
496}
497.accent-swatch-name { color: var(--ink); text-align: center; font-weight: 500; }
498
499.audio-flash { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
500.audio-flash--ok { background: rgba(40, 160, 90, 0.15); color: #2a9d5e; border: 1px solid rgba(40, 160, 90, 0.3); }
501.audio-flash--err { background: rgba(200, 60, 60, 0.15); color: #c33; border: 1px solid rgba(200, 60, 60, 0.3); }
502
503.form-hint { font-size: 0.8rem; color: var(--ink-muted, var(--ink-soft)); margin: 0; }
504.form-hint-inline { font-size: 0.78rem; color: var(--ink-muted, var(--ink-soft)); font-weight: 400; margin-left: .25rem; }
505
506/* P63 — Profile photo picker
507 Mobile-first: thumb stacks above input/buttons. ≥520px the thumb floats
508 to the left and the controls fill the remaining width. */
509.photo-picker {
510 display: flex;
511 flex-direction: column;
512 gap: .65rem;
513 align-items: stretch;
514}
515.photo-thumb {
516 position: relative;
517 width: 88px; height: 88px;
518 border-radius: 50%;
519 border: 1px solid var(--rule);
520 background: var(--paper-2);
521 overflow: hidden;
522 flex-shrink: 0;
523 display: flex; align-items: center; justify-content: center;
524}
525.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
526.photo-thumb .photo-empty {
527 display: flex; color: var(--ink-muted, var(--ink-soft)); opacity: .55;
528}
529.photo-thumb .photo-empty svg { width: 36px; height: 36px; }
530.photo-thumb:not([data-empty]) .photo-empty { display: none; }
531.photo-thumb[data-empty] img { display: none; }
532
533.photo-controls {
534 display: flex;
535 flex-direction: column;
536 gap: .5rem;
537 flex: 1;
538 min-width: 0;
539}
540.photo-controls input[type="text"] { width: 100%; }
541.photo-actions {
542 display: flex; align-items: center; flex-wrap: wrap;
543 gap: .4rem;
544}
545.photo-actions .btn { padding: .45rem .75rem; font-size: .85rem; }
546.photo-status { margin-left: .25rem; }
547.photo-status.is-error { color: #c2410c; }
548
549@media (min-width: 520px) {
550 .photo-picker { flex-direction: row; align-items: flex-start; gap: 1rem; }
551 .photo-controls { gap: .55rem; }
552}
553/* Mobile-first: platform selector on its own line (full width), URL input + remove
554 button below. Prevents horizontal overflow on phones (fixed 160px column +
555 non-shrinkable input together ~447px > screen width). */
556.profile-link-row {
557 display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; margin-bottom: 0.5rem;
558}
559.profile-link-row select { padding: 0.45rem 0.6rem; grid-column: 1 / -1; }
560.profile-link-row input { min-width: 0; }
561@media (min-width: 520px) {
562 .profile-link-row { grid-template-columns: 160px 1fr auto; }
563 .profile-link-row select { grid-column: auto; }
564}
565.profile-links-fieldset details > label { margin-top: 0.4rem; }
566</style>
Note: See TracBrowser for help on using the repository browser.