From fcff6bc248d21f3acb7a0c8dcb5b1ef09c18cdbb Mon Sep 17 00:00:00 2001 From: Emmanuel Pelletier Date: Wed, 23 Mar 2022 10:46:05 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BF=EF=B8=8F(templates)=20improve=20templ?= =?UTF-8?q?ate=20rendering?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add titles to all `svg` files with roles as `img`. Remove duplicated information from blocks to avoid SR repetition. Co-authored-by: Sandro Costa Co-authored-by: Emmanuel Pelletier --- CHANGELOG.md | 1 + .../js/components/CourseGlimpse/index.tsx | 8 ++------ src/richie/apps/core/templates/richie/base.html | 2 +- .../social-networks/blogpost-badges.html | 16 ++++++++-------- .../templates/social-networks/course-badges.html | 16 ++++++++-------- .../templates/social-networks/footer-badges.html | 12 +++++------- .../courses/cms/fragment_category_glimpse.html | 2 +- .../courses/cms/fragment_course_glimpse.html | 4 ++-- .../fragment_error_detail_template_banner.html | 2 +- .../templates/richie/glimpse/glimpse_quote.html | 2 +- tests/apps/courses/test_cms_plugins_course.py | 8 ++++---- .../courses/test_templates_category_detail.py | 6 +++--- .../test_templates_course_detail_rendering.py | 2 +- .../test_templates_organization_detail.py | 6 +++--- .../apps/courses/test_templates_person_detail.py | 4 ++-- .../courses/test_templates_program_detail.py | 6 +++--- 16 files changed, 46 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84aa844ae0..e4a2b7be92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Changed +- Improve overall accessibility in Richie templates - Update frontend overriding system to allow to override any frontend module. - Improve React search suggestion field labels for screen readers. - Removed usage of deprecated Sass division '/' operator in favor of diff --git a/src/frontend/js/components/CourseGlimpse/index.tsx b/src/frontend/js/components/CourseGlimpse/index.tsx index 73c1670b22..0fcb46f782 100644 --- a/src/frontend/js/components/CourseGlimpse/index.tsx +++ b/src/frontend/js/components/CourseGlimpse/index.tsx @@ -52,9 +52,7 @@ const CourseGlimpseBase = ({ context, course }: CourseGlimpseProps & CommonDataP ) : null}
-

- {course.title} -

+

{course.title}

{course.organization_highlighted_cover_image ? (
{/* alt forced to empty string because it's a decorative image */} @@ -68,9 +66,7 @@ const CourseGlimpseBase = ({ context, course }: CourseGlimpseProps & CommonDataP ) : null}
- - {course.organization_highlighted} - + {course.organization_highlighted}
diff --git a/src/richie/apps/core/templates/richie/base.html b/src/richie/apps/core/templates/richie/base.html index ab00b63cfc..6baa2d7f38 100644 --- a/src/richie/apps/core/templates/richie/base.html +++ b/src/richie/apps/core/templates/richie/base.html @@ -152,7 +152,7 @@ diff --git a/src/richie/apps/core/templates/social-networks/blogpost-badges.html b/src/richie/apps/core/templates/social-networks/blogpost-badges.html index a7b00ebd84..9ef1e5c3c9 100644 --- a/src/richie/apps/core/templates/social-networks/blogpost-badges.html +++ b/src/richie/apps/core/templates/social-networks/blogpost-badges.html @@ -7,9 +7,9 @@ href="https://www.facebook.com/share.php?u={{ full_page_url }}" class="social-network-badges__item" target="_blank" rel="noopener noreferrer" - title="{% trans "Share on Facebook" %}" > - + + {% trans "Share on Facebook" %} @@ -17,9 +17,9 @@ href="https://twitter.com/intent/tweet?text={{ shared_sentence|urlencode }}" class="social-network-badges__item" target="_blank" rel="noopener noreferrer" - title="{% trans "Share on Twitter" %}" > - + + {% trans "Share on Twitter" %} @@ -27,9 +27,9 @@ href="https://www.linkedin.com/sharing/share-offsite/?url={{ full_page_url }}" class="social-network-badges__item" target="_blank" rel="noopener noreferrer" - title="{% trans "Share on Linkedin" %}" > - + + {% trans "Share on Linkedin" %} @@ -37,9 +37,9 @@ href="mailto:?subject={{ mailto_subject|urlencode }}&body={{ full_page_url|urlencode }}" class="social-network-badges__item" target="_blank" rel="noopener noreferrer" - title="{% trans "Share by Email" %}" > - + + {% trans "Share by Email" %} diff --git a/src/richie/apps/core/templates/social-networks/course-badges.html b/src/richie/apps/core/templates/social-networks/course-badges.html index 922e12f5d9..1a4c0b3e5f 100644 --- a/src/richie/apps/core/templates/social-networks/course-badges.html +++ b/src/richie/apps/core/templates/social-networks/course-badges.html @@ -7,9 +7,9 @@ href="https://www.facebook.com/share.php?u={{ full_page_url }}" class="social-network-badges__item" target="_blank" rel="noopener noreferrer" - title="{% trans "Share on Facebook" %}" > - + + {% trans "Share on Facebook" %} @@ -17,9 +17,9 @@ href="https://twitter.com/intent/tweet?text={{ shared_sentence|urlencode }}" class="social-network-badges__item" target="_blank" rel="noopener noreferrer" - title="{% trans "Share on Twitter" %}" > - + + {% trans "Share on Twitter" %} @@ -27,9 +27,9 @@ href="https://www.linkedin.com/sharing/share-offsite/?url={{ full_page_url }}" class="social-network-badges__item" target="_blank" rel="noopener noreferrer" - title="{% trans "Share on Linkedin" %}" > - + + {% trans "Share on Linkedin" %} @@ -37,9 +37,9 @@ href="mailto:?subject={{ shared_subject|urlencode }}&body={{ shared_sentence|urlencode }}" class="social-network-badges__item" target="_blank" rel="noopener noreferrer" - title="{% trans "Share by Email" %}" > - + + {% trans "Share by Email" %} diff --git a/src/richie/apps/core/templates/social-networks/footer-badges.html b/src/richie/apps/core/templates/social-networks/footer-badges.html index 5e96a772a1..4907e04bff 100644 --- a/src/richie/apps/core/templates/social-networks/footer-badges.html +++ b/src/richie/apps/core/templates/social-networks/footer-badges.html @@ -4,7 +4,7 @@ class="body-footer__badge" target="_blank" rel="noopener noreferrer" > - + {% trans "Facebook" %} @@ -13,10 +13,9 @@ href="https://twitter.com/@funmooc" class="body-footer__badge" target="_blank" rel="noopener noreferrer" - title="{% trans "Twitter page" %}" > - - {% trans "Twitter" %} + + {% trans "Twitter page" %} @@ -24,10 +23,9 @@ href="https://www.linkedin.com/school/franceuniversitenumerique/" class="body-footer__badge" target="_blank" rel="noopener noreferrer" - title="{% trans "Linkedin" %}" > - - {% trans "Linkedin" %} + + {% trans "Linkedin page" %} diff --git a/src/richie/apps/courses/templates/courses/cms/fragment_category_glimpse.html b/src/richie/apps/courses/templates/courses/cms/fragment_category_glimpse.html index 2c92a61bff..ebb2e34d1b 100644 --- a/src/richie/apps/courses/templates/courses/cms/fragment_category_glimpse.html +++ b/src/richie/apps/courses/templates/courses/cms/fragment_category_glimpse.html @@ -43,7 +43,7 @@ {% if instance.picture.width >= 600 %},{% thumbnail instance.picture 600x600 replace_alpha='#FFFFFF' crop upscale subject_location=instance.picture.subject_location %} 600w{% endif %} " sizes="200px" - alt="{{ category_page.get_title }}"> + alt=""> {% endblockplugin %}
diff --git a/src/richie/apps/courses/templates/courses/cms/fragment_course_glimpse.html b/src/richie/apps/courses/templates/courses/cms/fragment_course_glimpse.html index 9822a06e65..a217b5c133 100644 --- a/src/richie/apps/courses/templates/courses/cms/fragment_course_glimpse.html +++ b/src/richie/apps/courses/templates/courses/cms/fragment_course_glimpse.html @@ -30,7 +30,7 @@
{% endif %}
- {{ course_page.get_title }} + {{ course_page.get_title }} {% if main_organization %} {% with organization_page=main_organization.extended_object %} {% get_placeholder_plugins "logo" organization_page as plugins or %} @@ -56,7 +56,7 @@ - {{ main_organization_title }} + {{ main_organization_title }}
{% endif %}