Projet

Général

Profil

0001-misc-add-a11y-status-role-to-error-notices-40889.patch

Frédéric Péters, 23 mars 2020 19:56

Télécharger (1,6 ko)

Voir les différences:

Subject: [PATCH] misc: add a11y status role to error notices (#40889)

 wcs/forms/root.py  | 2 +-
 wcs/qommon/form.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
wcs/forms/root.py
574 574
        r = TemplateIO(html=True)
575 575
        r += self.form_side(step_no=0, page=self.pages[0])
576 576
        auth_contexts = get_publisher().get_supported_authentication_contexts()
577
        r += htmltext('<div class="errornotice">')
577
        r += htmltext('<div class="errornotice" role="status">')
578 578
        r += htmltext('<p>%s</p>') % _('You need a stronger authentication level to fill this form.')
579 579
        r += htmltext('</div>')
580 580
        root_url = get_publisher().get_root_url()
wcs/qommon/form.py
372 372
            errors.extend(self.global_error_messages)
373 373
            classnames.append('global-errors')
374 374
        t = TemplateIO(html=True)
375
        t += htmltext('<div class="%s">' % ' '.join(classnames))
375
        t += htmltext('<div class="%s" role="status">' % ' '.join(classnames))
376 376
        for error in errors:
377 377
            t += htmltext('<p>%s</p>') % error
378 378
        t += htmltext('</div>')
379
-