From 67e9ae55817dee5d8b04f132515cd2bc55daaf42 Mon Sep 17 00:00:00 2001 From: Matthew Piatetsky Date: Mon, 3 Dec 2018 12:49:10 -0500 Subject: [PATCH] Fix content gating a11y issues --- lms/djangoapps/courseware/tests/helpers.py | 3 +- lms/static/sass/bootstrap/_components.scss | 14 +++++ lms/static/sass/elements/_banners.scss | 7 +++ .../sass/features/_content-type-gating.scss | 58 +++++++++++-------- .../fields/message_banner.underscore | 2 +- lms/templates/page_banner.html | 18 +++--- .../access_denied_message.html | 8 +-- .../features/course_duration_limits/access.py | 15 +++-- .../tests/views/test_course_home.py | 4 +- 9 files changed, 86 insertions(+), 43 deletions(-) diff --git a/lms/djangoapps/courseware/tests/helpers.py b/lms/djangoapps/courseware/tests/helpers.py index 92ec3090a1..5bc45686ac 100644 --- a/lms/djangoapps/courseware/tests/helpers.py +++ b/lms/djangoapps/courseware/tests/helpers.py @@ -361,7 +361,8 @@ def get_expiration_banner_text(user, course): expiration_date = (now() + timedelta(weeks=4)).strftime('%b %-d') upgrade_link = verified_upgrade_deadline_link(user=user, course=course) bannerText = 'Your access to this course expires on {expiration_date}. \ - Upgrade now for unlimited access.'.format( + Upgrade now to retain access past {expiration_date}.\ + '.format( expiration_date=expiration_date, upgrade_link=upgrade_link ) diff --git a/lms/static/sass/bootstrap/_components.scss b/lms/static/sass/bootstrap/_components.scss index 4004ba94de..740bea92a3 100644 --- a/lms/static/sass/bootstrap/_components.scss +++ b/lms/static/sass/bootstrap/_components.scss @@ -9,6 +9,13 @@ .user-messages { margin-top: $baseline; } + + .user-messages-ul { + list-style: none; + padding: 0; + margin: 0; + } + } // Alerts @@ -23,3 +30,10 @@ margin-left: $baseline; } } + +.alert.alert-info a { + // Need to have sufficient contrast for blue links on blue background + // Based this on some existing css for this use case + color: #245269; + font-weight: bold; +} diff --git a/lms/static/sass/elements/_banners.scss b/lms/static/sass/elements/_banners.scss index 9765a978cb..8a998285eb 100644 --- a/lms/static/sass/elements/_banners.scss +++ b/lms/static/sass/elements/_banners.scss @@ -58,6 +58,13 @@ $full-width-banner-margin: 20px; color: $link-color; text-decoration: underline !important; } + + .user-messages-ul { + list-style: none; + padding: 0; + margin: 0; + } + } .alert { diff --git a/lms/static/sass/features/_content-type-gating.scss b/lms/static/sass/features/_content-type-gating.scss index 9b8d8add8c..5ac07efd43 100644 --- a/lms/static/sass/features/_content-type-gating.scss +++ b/lms/static/sass/features/_content-type-gating.scss @@ -5,28 +5,38 @@ justify-content: space-between; border: lightgrey 1px solid; padding: 15px 20px; -} -.content-paywall h3 { - font-weight: 600; - margin-bottom: 10px; -} -.content-paywall .fa-lock { - color: black; - margin-right: 10px; - font-size: 24px; - margin-left: 5px; -} -.content-paywall .certDIV_1 { - color: rgb(25, 125, 29); - height: 20px; - width: 300px; - font: normal normal 600 normal 14px / 20px 'Helvetica Neue', Helvetica, Arial, sans-serif; -} -.content-paywall .certA_2 { - text-decoration: underline !important; - color: rgb(0, 117, 180); - font: normal normal 400 normal 16px / 25.6px 'Open Sans'; -} -.content-paywall img { - height: 60px; + + h3 { + font-weight: 600; + margin-bottom: 10px; + } + + .fa-lock { + color: black; + margin-right: 10px; + font-size: 24px; + margin-left: 5px; + } + + .certDIV_1 { + color: rgb(25, 125, 29); + height: 20px; + width: 300px; + font: normal normal 600 normal 14px / 20px 'Helvetica Neue', Helvetica, Arial, sans-serif; + } + + .certA_1 { + text-decoration: underline !important; + color: rgb(0, 117, 180); + font: normal normal 400 normal 16px / 25.6px 'Open Sans'; + } + + .certSPAN_1 { + padding: 10px 0; + } + + img { + height: 60px; + } + } diff --git a/lms/templates/fields/message_banner.underscore b/lms/templates/fields/message_banner.underscore index cf6c22e65d..5ea1f1221e 100644 --- a/lms/templates/fields/message_banner.underscore +++ b/lms/templates/fields/message_banner.underscore @@ -1,4 +1,4 @@ -
+