diff options
| author | Roger Rehnelt <noreply@maennchen1.de> | 2026-10-01 21:41:29 +0200 |
|---|---|---|
| committer | Roger Rehnelt <noreply@maennchen1.de> | 2026-10-01 21:41:29 +0200 |
| commit | 8e750f282a5eb05a7ff68670f9177d24ff9f584f (patch) | |
| tree | a0b6899735e4d3a37145c67f1c7d5c27070f49cd /views | |
| parent | ebd9a2944c1a1c1f3cb73c0ff7ea293f93b9b36a (diff) | |
Widerruf: Fehlermeldungen als Text mit Ansage
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'views')
| -rw-r--r-- | views/mods/mod_revocation/page_form.phtml | 11 | ||||
| -rw-r--r-- | views/mods/mod_revocation/wp_footer.phtml | 21 |
2 files changed, 21 insertions, 11 deletions
diff --git a/views/mods/mod_revocation/page_form.phtml b/views/mods/mod_revocation/page_form.phtml index f7849ff..f33695c 100644 --- a/views/mods/mod_revocation/page_form.phtml +++ b/views/mods/mod_revocation/page_form.phtml @@ -182,10 +182,13 @@ if ((res.success ?? false) === false) { - let html = '<ul id="wpsg_error" class="wpsg_error">'; - (res.arError ?? []).forEach(error => { html += `<li>${error}</li>`; }); - html += '</ul>'; - msg.innerHTML = html; + // Meldungen des Servers als Text, Screenreader sagen sie an + const list = document.createElement('ul'); + list.id = 'wpsg_error'; + list.className = 'wpsg_error'; + list.setAttribute('role', 'alert'); + (res.arError ?? []).forEach(error => { const li = document.createElement('li'); li.textContent = error; list.appendChild(li); }); + msg.replaceChildren(list); msg.scrollIntoView({ behavior: 'smooth', block: 'center' }); } else { diff --git a/views/mods/mod_revocation/wp_footer.phtml b/views/mods/mod_revocation/wp_footer.phtml index bec1b82..891c959 100644 --- a/views/mods/mod_revocation/wp_footer.phtml +++ b/views/mods/mod_revocation/wp_footer.phtml @@ -85,6 +85,19 @@ }); + // Meldungen des Servers als Text, Screenreader sagen sie an + const error_list = (arError) => { + + const list = document.createElement('ul'); + list.id = 'wpsg_error'; + list.className = 'wpsg_error'; + list.setAttribute('role', 'alert'); + (arError??[]).forEach(error => { const li = document.createElement('li'); li.textContent = error; list.appendChild(li); }); + + return list; + + }; + const show_error = () => { const target = el_dialog_content.querySelector('#msg_target') || el_dialog_content; @@ -151,15 +164,9 @@ }) } ]).then(res => { if (!res.ok) throw new Error(res.status); return res.json(); }).then(res => { - let html = ''; - if ((res.success??false) === false) { - html += '<ul id="wpsg_error" class="wpsg_error">'; - (res.arError??[]).forEach(error => { html += `<li>${error}</li>`; }); - html += '</ul>'; - - el_dialog_content.querySelector('#msg_target').innerHTML = html; + el_dialog_content.querySelector('#msg_target').replaceChildren(error_list(res.arError)); el_dialog.classList.remove('loading'); |
