fix: format audit deadline in Track Selection (#28558)

REV-2133
This commit is contained in:
julianajlk
2021-08-27 13:45:03 -04:00
committed by GitHub
parent 15438cab49
commit 646245508a
3 changed files with 7 additions and 3 deletions

View File

@@ -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

View File

@@ -85,6 +85,7 @@
background: white;
position: relative;
margin-bottom: 1.5rem;
margin-top: 80px !important;
}
#track_selection_audit:hover {

View File

@@ -151,7 +151,7 @@ from openedx.core.djangolib.js_utils import js_escaped_string
</div>
% endif
<div class="track-selection-choice track-selection-audit col-6">
<p class="float-right m-3"><b>${_("FREE")}</b></p>
<p class="float-right m-3 text-uppercase"><b>${_("Free")}</b></p>
<div class="choice-title"><h4>${_("Access this course")}</h4></div>
<div class="choice-bullets">
<ul>
@@ -164,7 +164,7 @@ from openedx.core.djangolib.js_utils import js_escaped_string
end_bold=HTML('</b>'),
)}</li>
% if audit_access_deadline:
<li>${_("Access expires and all progress will be lost on")} ${_(audit_access_deadline)}</li>
<li>${_("Access expires and all progress will be lost on")} ${audit_access_deadline}</li>
% else:
<li>${_("Access expires and all progress will be lost")}</li>
% endif