From b623eb2263a182e99fecd4efd521526dd6dc6681 Mon Sep 17 00:00:00 2001 From: kujiu Date: Fri, 22 Jun 2018 21:27:40 +0200 Subject: [PATCH] [IMP] Improve compatibility with screen readers (accessibility) (#2146) Today, Odoo is really tricky to use without seeing the screen, it must be improved to be usable. This PR forbid to use labels without a "for" attribute, add some title, rule and aria attributes in HTML. With that, Odoo will be fully usable with a screen reader. * [IMP] Labels must have a for attribute. Improve accessibility. * [FIX] Update some title attributes for a11y. * [IMP] Add aria-labels * [IMP] aria-hidden means hidden. Fix all bad aria-hidden and hide aria-hidden for all. * [IMP] Color names on kanban views * [IMP] Add 'alt' attribute on 'img' tags * [IMP] Add aria-label and title on icons. * [IMP] Add dialog role on modals. * [IMP] Remove wrong aria-labelledby * [IMP] Add menu role on dropdowns * [IMP] Buttons must be focusable * [IMP] Change main layout to more semantic tags * [IMP] Add menuitem role when missing * [IMP] Remove wrong role='presentation' * [IMP] Improve accessibility of tab panels * [IMP] Add role on alerts * [IMP] Add role="button" on simili buttons * [IMP] Use dialog role, header, main and footer tags for modals * [FIX] Set all tabs aria-selected since we don't have proper script to set the attribute correctly. * [IMP] Add widget, navigation or img role to aria-labelled items --- static/src/js/website_form_editor_tour.js | 24 ++++++++++----------- static/src/xml/website_form_editor.xml | 18 ++++++++-------- views/snippets.xml | 26 +++++++++++------------ 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/static/src/js/website_form_editor_tour.js b/static/src/js/website_form_editor_tour.js index 380d3a6a866..22463579d93 100644 --- a/static/src/js/website_form_editor_tour.js +++ b/static/src/js/website_form_editor_tour.js @@ -23,30 +23,30 @@ odoo.define('website_form_editor.tour', function(require) { { content: "Check if the snippet is dropped and if the modal is opened", trigger: "body:has(form[action*='/website_form/'])" + - ":has(.modal-body:has(select[name='model_selection'])" + - ":has(input[name='success_page']))", + " main.modal-body:has(select[name='model_selection'])" + + ":has(input[name='success_page'])", run: function () {}, in_modal: false, }, { content: "Change the action to create issues", - trigger: ".modal-body select", + trigger: "main.modal-body select", run: "text project.issue" }, { content: "Change the action to Send an E-mail", - trigger: ".modal-body select", + trigger: "main.modal-body select", run: "text mail.mail" }, { content: "Complete Recipient E-mail", - extra_trigger: ".modal-body input[name='email_to']", - trigger: ".modal-body input[name='email_to']", + extra_trigger: "main.modal-body input[name='email_to']", + trigger: "main.modal-body input[name='email_to']", run: "text test@test.test" }, { content: "Click on Save", - trigger: ".modal-footer #modal-save" + trigger: "footer.modal-footer #modal-save" }, // Add the subject field { @@ -68,7 +68,7 @@ odoo.define('website_form_editor.tour', function(require) { }, { content: "Click on Save", - trigger: ".modal-footer #modal-save" + trigger: "footer.modal-footer #modal-save" }, // Customize subject field @@ -113,7 +113,7 @@ odoo.define('website_form_editor.tour', function(require) { }, { content: "Click on Save", - trigger: ".modal-footer #modal-save" + trigger: "footer.modal-footer #modal-save" }, // Customize record_name field @@ -159,7 +159,7 @@ odoo.define('website_form_editor.tour', function(require) { }, { content: "Click on Save", - trigger: ".modal-footer #modal-save" + trigger: "footer.modal-footer #modal-save" }, // Customize subject field @@ -204,7 +204,7 @@ odoo.define('website_form_editor.tour', function(require) { }, { content: "Click on Save", - trigger: ".modal-footer #modal-save" + trigger: "footer.modal-footer #modal-save" }, { content: "Check the resulting field", @@ -472,7 +472,7 @@ odoo.define('website_form_editor.tour', function(require) { }, { content: "Click on Save", - trigger: ".modal-footer #modal-save" + trigger: "footer.modal-footer #modal-save" }, // Customize attachment_ids field diff --git a/static/src/xml/website_form_editor.xml b/static/src/xml/website_form_editor.xml index dcb4db4ee58..af8053c62ad 100644 --- a/static/src/xml/website_form_editor.xml +++ b/static/src/xml/website_form_editor.xml @@ -3,24 +3,24 @@ -