fix: abstract track selection bullets into new mako template

This commit is contained in:
Phillip Shiu
2021-08-31 16:24:38 -04:00
parent 9b204debf4
commit 2e5b922692
4 changed files with 76 additions and 63 deletions

View File

@@ -260,14 +260,16 @@ class ChooseModeView(View):
# REV-2133 TODO Value Prop: remove waffle flag after testing is completed
# and happy path version is ready to be rolled out to all users.
if VALUE_PROP_TRACK_SELECTION_FLAG.is_enabled():
# First iteration of happy path does not handle errors. If there are enrollment errors for a learner that is
# technically considered happy path, old Track Selection page will be displayed.
if not error:
# Happy path conditions.
if verified_mode and fbe_is_on and not enterprise_customer:
return render_to_response("course_modes/track_selection.html", context)
return render_to_response("course_modes/choose.html", context)
#if VALUE_PROP_TRACK_SELECTION_FLAG.is_enabled():
# First iteration of happy path does not handle errors. If there are enrollment errors for a learner that is
# technically considered happy path, old Track Selection page will be displayed.
LOG.info('verified mode: [%s], fbe_is_on: [%s], enterprise_customer: [%s]', verified_mode, fbe_is_on, enterprise_customer)
LOG.info('deadline: [%s], gated_content: [%s], duration: [%s], get_user_course_expiration_date: [%s]', deadline, gated_content, duration, get_user_course_expiration_date(request.user, course))
if not error:
# Happy path conditions.
if verified_mode and fbe_is_on and not enterprise_customer:
return render_to_response("course_modes/track_selection_types/full_fbe.html", context)
#return render_to_response("course_modes/choose.html", context)
@method_decorator(transaction.non_atomic_requests)
@method_decorator(login_required)

View File

@@ -95,43 +95,7 @@ from openedx.core.djangolib.js_utils import js_escaped_string
</span>
<p class="price-display">${currency_symbol}${min_price} ${currency}</p>
<div class="choice-title"><h4>${_("Earn a certificate")}</h4></div>
<div class="choice-bullets">
<ul>
<li>
${Text(_("Showcase a {link_start}verified certificate{link_end} of completion on your resumé to advance your career")).format(
link_start=HTML('<b><u><a class="verified" href="{track_verified_url}" target="_blank">').format(track_verified_url=track_links['verified_certificate']),
link_end=HTML('</a></u></b>')
)}
</li>
<li>${Text(_("Get {start_bold}access to all course activities{end_bold}, including both graded and non-graded assignments, while the course is running")).format(
start_bold=HTML('<b>'),
end_bold=HTML('</b>'),
)}</li>
<button class="btn btn-link collapsible">${_("Show more")}</button>
<li class="collapsible-item">
${Text(_("{start_bold}Full access{end_bold} to course content and materials, even after the course ends")).format(
start_bold=HTML('<b>'),
end_bold=HTML('</b>'),
)}
<span class="popover-icon">
<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.0212 6C12.0212 9.31444 9.33472 12 6.02124 12C2.70776 12 0.0212402 9.31444 0.0212402 6C0.0212402 2.68749 2.70776 0 6.02124 0C9.33472 0 12.0212 2.68749 12.0212 6ZM6.02124 7.20968C5.4066 7.20968 4.90834 7.70794 4.90834 8.32258C4.90834 8.93722 5.4066 9.43548 6.02124 9.43548C6.63588 9.43548 7.13414 8.93722 7.13414 8.32258C7.13414 7.70794 6.63588 7.20968 6.02124 7.20968ZM4.96464 3.20937L5.1441 6.49969C5.1525 6.65366 5.2798 6.77419 5.43399 6.77419H6.60849C6.76268 6.77419 6.88998 6.65366 6.89838 6.49969L7.07785 3.20937C7.08692 3.04306 6.95451 2.90323 6.78796 2.90323H5.2545C5.08795 2.90323 4.95556 3.04306 4.96464 3.20937Z" fill="#00262B"/>
</svg>
<span class="popover">
${Text(_("{link_start}Learn more{link_end} about course access")).format(
link_start=HTML('<u><a href="{track_comparison_url}" target="_blank">').format(track_comparison_url=track_links['learn_more']),
link_end=HTML('</a></u>')
)}
</span>
</span>
</li>
<li class="collapsible-item">${Text(_("Support our {start_bold}mission{end_bold} to increase access to high-quality education for everyone, everywhere")).format(
start_bold=HTML('<b>'),
end_bold=HTML('</b>'),
)}</li>
</ul>
</div>
<%block name="track_selection_certificate_bullets"/>
<ul class="list-actions">
<li class="action action-select track-selection-button">
<input type="hidden" name="contribution" value="${price_before_discount or min_price}" />
@@ -167,23 +131,7 @@ from openedx.core.djangolib.js_utils import js_escaped_string
<div class="track-selection-choice track-selection-audit ml-md-3">
<p class="float-right text-uppercase price-display">${_("Free")}</p>
<div class="choice-title"><h4>${_("Access this course")}</h4></div>
<div class="choice-bullets">
<ul>
<li>${Text(_("Get temporary access to {start_bold}non-graded{end_bold} activities, including discussion forums and non-graded assignments")).format(
start_bold=HTML('<b>'),
end_bold=HTML('</b>'),
)}</li>
<li>${Text(_("Get {start_bold}temporary access{end_bold} to the course material, including videos and readings")).format(
start_bold=HTML('<b>'),
end_bold=HTML('</b>'),
)}</li>
% if audit_access_deadline:
<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
</ul>
</div>
<%block name="track_selection_audit_bullets"/>
<ul class="list-actions">
<li class="action action-select track-selection-button">
<button id="track_selection_audit" type="submit" name="audit_mode">

View File

@@ -0,0 +1,63 @@
<%page expression_filter="h"/>
<%inherit file="../track_selection.html" />
<%!
from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import HTML, Text
%>
<%block name="track_selection_certificate_bullets">
<div class="choice-bullets track-selection-type-full-fbe">
<ul>
<li>${Text(_("Showcase a {link_start}verified certificate{link_end} of completion on your resumé to advance your career")).format(
link_start=HTML('<b><u><a class="verified" href="{track_verified_url}" target="_blank">').format(track_verified_url=track_links['verified_certificate']),
link_end=HTML('</a></u></b>')
)}
</li>
<li>${Text(_("Get {start_bold}access to all course activities{end_bold}, including both graded and non-graded assignments, while the course is running")).format(
start_bold=HTML('<b>'),
end_bold=HTML('</b>'),
)}</li>
<button class="btn btn-link collapsible">${_("Show more")}</button>
<li class="collapsible-item">
${Text(_("{start_bold}Full access{end_bold} to course content and materials, even after the course ends")).format(
start_bold=HTML('<b>'),
end_bold=HTML('</b>'),
)}
<span class="popover-icon">
<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.0212 6C12.0212 9.31444 9.33472 12 6.02124 12C2.70776 12 0.0212402 9.31444 0.0212402 6C0.0212402 2.68749 2.70776 0 6.02124 0C9.33472 0 12.0212 2.68749 12.0212 6ZM6.02124 7.20968C5.4066 7.20968 4.90834 7.70794 4.90834 8.32258C4.90834 8.93722 5.4066 9.43548 6.02124 9.43548C6.63588 9.43548 7.13414 8.93722 7.13414 8.32258C7.13414 7.70794 6.63588 7.20968 6.02124 7.20968ZM4.96464 3.20937L5.1441 6.49969C5.1525 6.65366 5.2798 6.77419 5.43399 6.77419H6.60849C6.76268 6.77419 6.88998 6.65366 6.89838 6.49969L7.07785 3.20937C7.08692 3.04306 6.95451 2.90323 6.78796 2.90323H5.2545C5.08795 2.90323 4.95556 3.04306 4.96464 3.20937Z" fill="#00262B"/>
</svg>
<span class="popover">
${Text(_("{link_start}Learn more{link_end} about course access")).format(
link_start=HTML('<u><a href="{track_comparison_url}" target="_blank">').format(track_comparison_url=track_links['learn_more']),
link_end=HTML('</a></u>')
)}
</span>
</span>
</li>
<li class="collapsible-item">${Text(_("Support our {start_bold}mission{end_bold} to increase access to high-quality education for everyone, everywhere")).format(
start_bold=HTML('<b>'),
end_bold=HTML('</b>'),
)}</li>
</ul>
</div>
</%block>
<%block name="track_selection_audit_bullets">
<div class="choice-bullets track-selection-type-full-fbe">
<ul>
<li>${Text(_("Get temporary access to {start_bold}non-graded{end_bold} activities, including discussion forums and non-graded assignments")).format(
start_bold=HTML('<b>'),
end_bold=HTML('</b>'),
)}</li>
<li>${Text(_("Get {start_bold}temporary access{end_bold} to the course material, including videos and readings")).format(
start_bold=HTML('<b>'),
end_bold=HTML('</b>'),
)}</li>
% if audit_access_deadline:
<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
</ul>
</div>
</%block>

View File

@@ -193,7 +193,7 @@ from common.djangoapps.pipeline_mako import render_require_js_path_overrides
<div class="marketing-hero"><%block name="marketing_hero"></%block></div>
<div class="content-wrapper main-container" id="content" dir="${static.dir_rtl()}">
${self.body()}
${next.body()}
<%block name="bodyextra"/>
</div>