From 07307cb471d4a8dc31d41eb84f069be9556d98b2 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Thu, 4 Jun 2015 16:19:58 -0400 Subject: [PATCH] Certificates: addressing a11y feedback * removing visual-based heading styles from 'sr-only' DOM elements * revising default certificate view h1/heading copy * revising DOM elements to use main/aside semantics * revised edX/platform logo link alt text * removed extra share/take home header text * synced up add to LinkedIn profile copy --- lms/djangoapps/certificates/models.py | 6 ++---- lms/djangoapps/certificates/tests/test_models.py | 12 ++++-------- lms/djangoapps/certificates/views.py | 1 - .../certificates/_accomplishment-banner.html | 13 +++++++------ .../certificates/_accomplishment-header.html | 6 ++++-- .../certificates/_accomplishment-rendering.html | 8 ++++---- lms/templates/certificates/valid.html | 4 ++-- 7 files changed, 23 insertions(+), 27 deletions(-) diff --git a/lms/djangoapps/certificates/models.py b/lms/djangoapps/certificates/models.py index e7ed44964f..1e83418fa7 100644 --- a/lms/djangoapps/certificates/models.py +++ b/lms/djangoapps/certificates/models.py @@ -558,12 +558,10 @@ class CertificateHtmlViewConfiguration(ConfigurationModel): { "default": { "url": "http://www.edx.org", - "logo_src": "http://www.edx.org/static/images/logo.png", - "logo_alt": "Valid Certificate" + "logo_src": "http://www.edx.org/static/images/logo.png" }, "honor": { - "logo_src": "http://www.edx.org/static/images/honor-logo.png", - "logo_alt": "Honor Certificate" + "logo_src": "http://www.edx.org/static/images/honor-logo.png" } } """ diff --git a/lms/djangoapps/certificates/tests/test_models.py b/lms/djangoapps/certificates/tests/test_models.py index 755f2b233c..0935c3df8e 100644 --- a/lms/djangoapps/certificates/tests/test_models.py +++ b/lms/djangoapps/certificates/tests/test_models.py @@ -101,12 +101,10 @@ class CertificateHtmlViewConfigurationTest(TestCase): self.configuration_string = """{ "default": { "url": "http://www.edx.org", - "logo_src": "http://www.edx.org/static/images/logo.png", - "logo_alt": "Valid Certificate" + "logo_src": "http://www.edx.org/static/images/logo.png" }, "honor": { - "logo_src": "http://www.edx.org/static/images/honor-logo.png", - "logo_alt": "Honor Certificate" + "logo_src": "http://www.edx.org/static/images/honor-logo.png" } }""" self.config = CertificateHtmlViewConfiguration(configuration=self.configuration_string) @@ -134,12 +132,10 @@ class CertificateHtmlViewConfigurationTest(TestCase): expected_config = { "default": { "url": "http://www.edx.org", - "logo_src": "http://www.edx.org/static/images/logo.png", - "logo_alt": "Valid Certificate" + "logo_src": "http://www.edx.org/static/images/logo.png" }, "honor": { - "logo_src": "http://www.edx.org/static/images/honor-logo.png", - "logo_alt": "Honor Certificate" + "logo_src": "http://www.edx.org/static/images/honor-logo.png" } } self.assertEquals(self.config.get_config(), expected_config) diff --git a/lms/djangoapps/certificates/views.py b/lms/djangoapps/certificates/views.py index 343b8572e6..963ce40304 100644 --- a/lms/djangoapps/certificates/views.py +++ b/lms/djangoapps/certificates/views.py @@ -500,7 +500,6 @@ def render_html_view(request, user_id, course_id): # Translators: This line appears as a byline to a header image and describes the purpose of the page context['logo_subtitle'] = _("Certificate Validation") - context['logo_alt'] = context.get('platform_name') invalid_template_path = 'certificates/invalid.html' # Kick the user back to the "Invalid" screen if the feature is disabled diff --git a/lms/templates/certificates/_accomplishment-banner.html b/lms/templates/certificates/_accomplishment-banner.html index d835caad1c..f8f8d81d02 100644 --- a/lms/templates/certificates/_accomplishment-banner.html +++ b/lms/templates/certificates/_accomplishment-banner.html @@ -32,26 +32,27 @@

${accomplishment_banner_congrats}

- %if badge: -

${_("Share on:")}

+

${_("Take this with you:")}

+ + %if badge: - %endif -

Take this with you:

+ %endif + %if linked_in_url: ${_('Share on LinkedIn')} + alt="${_('Add to LinkedIn Profile')}" /> %endif
diff --git a/lms/templates/certificates/_accomplishment-header.html b/lms/templates/certificates/_accomplishment-header.html index 5a0ce0933d..9102d970c2 100644 --- a/lms/templates/certificates/_accomplishment-header.html +++ b/lms/templates/certificates/_accomplishment-header.html @@ -1,11 +1,13 @@ +<%! from django.utils.translation import ugettext as _ %> +
diff --git a/lms/templates/certificates/_accomplishment-rendering.html b/lms/templates/certificates/_accomplishment-rendering.html index 43cb82afa8..d9e65c018e 100644 --- a/lms/templates/certificates/_accomplishment-rendering.html +++ b/lms/templates/certificates/_accomplishment-rendering.html @@ -7,7 +7,7 @@ if certificate_data and certificate_data.get('course_title', ''): course_mode_class = course_mode if course_mode else '' %> -
+
@@ -42,7 +42,7 @@ course_mode_class = course_mode if course_mode else '' % if mode != 'base':
-

${_("Noted by")}

+

${_("Noted by")}

@@ -66,7 +66,7 @@ course_mode_class = course_mode if course_mode else ''
-

${_("Supported by the following organizations")}

+

${_("Supported by the following organizations")}

  • @@ -116,4 +116,4 @@ course_mode_class = course_mode if course_mode else ''
-
+ diff --git a/lms/templates/certificates/valid.html b/lms/templates/certificates/valid.html index f287a3e1ab..31e3902a6b 100644 --- a/lms/templates/certificates/valid.html +++ b/lms/templates/certificates/valid.html @@ -8,8 +8,8 @@ <%include file="_accomplishment-rendering.html" />
-
+
+