From 646245508a7d89dfacfee6a52334e6243d845014 Mon Sep 17 00:00:00 2001 From: julianajlk Date: Fri, 27 Aug 2021 13:45:03 -0400 Subject: [PATCH] fix: format audit deadline in Track Selection (#28558) REV-2133 --- common/djangoapps/course_modes/views.py | 5 ++++- lms/static/sass/views/_track_selection.scss | 1 + lms/templates/course_modes/track_selection.html | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/djangoapps/course_modes/views.py b/common/djangoapps/course_modes/views.py index c60fecf741..725da47633 100644 --- a/common/djangoapps/course_modes/views.py +++ b/common/djangoapps/course_modes/views.py @@ -27,6 +27,7 @@ from opaque_keys.edx.keys import CourseKey from common.djangoapps.course_modes.models import CourseMode from common.djangoapps.course_modes.helpers import get_course_final_price from common.djangoapps.edxmako.shortcuts import render_to_response +from common.djangoapps.util.date_utils import strftime_localized_html from edx_toggles.toggles import WaffleFlag from lms.djangoapps.commerce.utils import EcommerceService from lms.djangoapps.experiments.utils import get_experiment_user_metadata_context @@ -249,7 +250,9 @@ class ChooseModeView(View): duration = get_user_course_duration(request.user, course) deadline = duration and get_user_course_expiration_date(request.user, course) - context['audit_access_deadline'] = deadline + if deadline: + formatted_audit_access_date = strftime_localized_html(deadline, 'SHORT_DATE') + context['audit_access_deadline'] = formatted_audit_access_date fbe_is_on = deadline and gated_content # REV-2133 TODO Value Prop: remove waffle flag after testing is completed diff --git a/lms/static/sass/views/_track_selection.scss b/lms/static/sass/views/_track_selection.scss index 3654a5116e..03f6e2400b 100644 --- a/lms/static/sass/views/_track_selection.scss +++ b/lms/static/sass/views/_track_selection.scss @@ -85,6 +85,7 @@ background: white; position: relative; margin-bottom: 1.5rem; + margin-top: 80px !important; } #track_selection_audit:hover { diff --git a/lms/templates/course_modes/track_selection.html b/lms/templates/course_modes/track_selection.html index 9708ccddfc..b2ba7e5d81 100644 --- a/lms/templates/course_modes/track_selection.html +++ b/lms/templates/course_modes/track_selection.html @@ -151,7 +151,7 @@ from openedx.core.djangolib.js_utils import js_escaped_string % endif
-

${_("FREE")}

+

${_("Free")}

${_("Access this course")}

    @@ -164,7 +164,7 @@ from openedx.core.djangolib.js_utils import js_escaped_string end_bold=HTML(''), )} % if audit_access_deadline: -
  • ${_("Access expires and all progress will be lost on")} ${_(audit_access_deadline)}
  • +
  • ${_("Access expires and all progress will be lost on")} ${audit_access_deadline}
  • % else:
  • ${_("Access expires and all progress will be lost")}
  • % endif