From 8e750f282a5eb05a7ff68670f9177d24ff9f584f Mon Sep 17 00:00:00 2001 From: Roger Rehnelt Date: Thu, 1 Oct 2026 21:41:29 +0200 Subject: Widerruf: Fehlermeldungen als Text mit Ansage Co-Authored-By: Claude Opus 5.5 --- views/mods/mod_revocation/page_form.phtml | 11 +++++++---- 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 = ''; - 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 += ''; - - el_dialog_content.querySelector('#msg_target').innerHTML = html; + el_dialog_content.querySelector('#msg_target').replaceChildren(error_list(res.arError)); el_dialog.classList.remove('loading'); -- cgit v1.2.3