Changeset 742ba7e in Klonkt for src/assets
- Timestamp:
- 07/28/2026 07:58:26 PM (6 weeks ago)
- Branches:
- main
- Children:
- 6c152a5
- Parents:
- 70677e96
- Location:
- src/assets
- Files:
-
- 2 edited
-
css/guardian.css (modified) (2 diffs)
-
js/guardian.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/assets/css/guardian.css
r70677e96 r742ba7e 9 9 --accent: #ff6b35; 10 10 --ok: #4caf7d; 11 --danger: #e05a5a; /* alleen voor onomkeerbare stappen, zoals een ward loslaten */ 11 12 } 12 13 * { box-sizing: border-box; } … … 134 135 .g-empty.small { margin: 0; font-size: .85rem; } 135 136 .tag.help { color: var(--accent); border-color: var(--accent); } 137 138 /* Loslaten van een ward: geen browser-confirm maar een stap in het paneel, met 139 de gevolgen erbij. Rustig van kleur; het is een besluit, geen alarm. */ 140 .g-warn { margin-top: 10px; padding: 12px 14px; border-radius: 10px; 141 border: 1px solid var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); } 142 .g-warn strong { display: block; margin-bottom: 6px; } 143 .g-warn p { margin: 0 0 8px; font-size: .88rem; line-height: 1.45; color: var(--sub); } 144 .g-warn p.grave { color: var(--ink); font-weight: 500; } 145 .g-warn .row { margin-top: 10px; gap: 8px; } 146 button.danger { background: var(--danger); color: #fff; border-color: var(--danger); } -
src/assets/js/guardian.js
r70677e96 r742ba7e 184 184 } 185 185 186 /** 187 * The second step of releasing a ward: what it does, then yes or no. 188 * 189 * The warning is assembled from what the server found, not from a fixed 190 * sentence, because releasing means two different things (FEP-633c): stepping 191 * down while other guardians remain (§3.3), or being the last one, which is 192 * emancipation and explicitly not one guardian's call (§3.4). And as long as 193 * the Undo does not federate, the ward's server keeps listing you either way 194 * — a guardian has to know that before pressing, not after. 195 */ 196 function releaseStep(w, check, host, relBtn) { 197 var uri = w.other_uri; 198 var who = handleOf(uri, w.other_handle); 199 var box = el('div', 'g-warn'); 200 box.appendChild(el('strong', null, (T.release_title || 'Release {who}?').replace('{who}', who))); 201 box.appendChild(el('p', null, T.release_effect || '')); 202 if (check.last === true) box.appendChild(el('p', 'grave', T.release_last || '')); 203 else if (check.last === false) box.appendChild(el('p', null, T.release_step_down || '')); 204 else box.appendChild(el('p', 'grave', T.release_unknown || '')); 205 if (check.federates === false) box.appendChild(el('p', null, T.release_local || '')); 206 207 var row = el('div', 'row'); 208 var yes = el('button', 'danger small', T.release_yes || 'Yes'); 209 yes.addEventListener('click', function () { yes.disabled = true; remove(uri, yes); }); 210 var no = el('button', 'small', T.release_no || 'No'); 211 no.addEventListener('click', function () { 212 host.removeChild(box); 213 relBtn.hidden = false; relBtn.disabled = false; 214 }); 215 // No first: the way out should be the easy one to hit. 216 row.appendChild(no); row.appendChild(yes); 217 box.appendChild(row); 218 return box; 219 } 220 186 221 function wardPanel(w) { 187 222 var uri = w.other_uri; … … 215 250 actRow.appendChild(wave); 216 251 var rel = el('button', 'quiet small', T.release); 217 // Releasing a ward is heavy and hard to undo (coming back needs a fresh 218 // offer the ward accepts), so it asks first and spells out what changes. 252 // Letting a child go is a decision, not a click. It opens a step that first 253 // asks the server what releasing this particular ward actually does, then 254 // says it plainly and asks yes or no. Never window.confirm: that hides a 255 // long explanation behind an OK button people press to make it go away. 219 256 rel.addEventListener('click', function () { 220 var who = handleOf(uri, w.other_handle); 221 var msg = (T.release_confirm || 'Release {who}?').replace('{who}', who); 222 if (window.confirm(msg)) remove(uri, rel); 257 rel.disabled = true; 258 // site matters: with several of your own sites the server would otherwise 259 // check this ward against the wrong one and answer "not my ward". 260 fetch('/guardian/wards/release-check?site=' + encodeURIComponent(S.site) + '&uri=' + encodeURIComponent(uri)) 261 .then(function (r) { return r.json(); }) 262 .then(function (c) { 263 rel.hidden = true; 264 act.appendChild(releaseStep(w, c || {}, act, rel)); 265 }) 266 .catch(function () { rel.disabled = false; }); 223 267 }); 224 268 actRow.appendChild(rel);
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)