misc: add a11y status role to error notices (#40889)

This commit is contained in:
Frédéric Péters 2020-03-23 19:55:19 +01:00
parent 5ec5b21072
commit 6e63bef64a
2 changed files with 2 additions and 2 deletions

View File

@ -574,7 +574,7 @@ class FormPage(Directory, FormTemplateMixin):
r = TemplateIO(html=True)
r += self.form_side(step_no=0, page=self.pages[0])
auth_contexts = get_publisher().get_supported_authentication_contexts()
r += htmltext('<div class="errornotice">')
r += htmltext('<div class="errornotice" role="status">')
r += htmltext('<p>%s</p>') % _('You need a stronger authentication level to fill this form.')
r += htmltext('</div>')
root_url = get_publisher().get_root_url()

View File

@ -372,7 +372,7 @@ class Form(QuixoteForm):
errors.extend(self.global_error_messages)
classnames.append('global-errors')
t = TemplateIO(html=True)
t += htmltext('<div class="%s">' % ' '.join(classnames))
t += htmltext('<div class="%s" role="status">' % ' '.join(classnames))
for error in errors:
t += htmltext('<p>%s</p>') % error
t += htmltext('</div>')