Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAE-845 Add custom prerequisites functionality to improve learner experience #189

Open
wants to merge 3 commits into
base: open-release/juniper.stage
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,21 +217,44 @@ <h1>
</li>
%endif

% if pre_requisite_courses:
<% prc_target = reverse('about_course', args=[text_type(pre_requisite_courses[0]['key'])]) %>
<li class="prerequisite-course important-dates-item">
<span class="icon fa fa-list-ul" aria-hidden="true"></span>
<p class="important-dates-item-title">${_("Prerequisites")}</p>
## Multiple pre-requisite courses are not supported on frontend that's why we are pulling first element
<span class="important-dates-item-text pre-requisite"><a href="${prc_target}">${pre_requisite_courses[0]['display']}</a></span>
<p class="tip">
${Text(_("You must successfully complete {link_start}{prc_display}{link_end} before you begin this course.")).format(
link_start=HTML('<a href="{}">').format(prc_target),
link_end=HTML('</a>'),
prc_display=pre_requisite_courses[0]['display'],
)}
</p>
</li>
% if course_requirements:
% if student_not_enrollment_in_requirement:
<li class="prerequisite-course important-dates-item">
<span class="icon fa fa-list-ul" aria-hidden="true"></span>
<p class="important-dates-item-title">${_("Prerequisites")}</p>
## Multiple pre-requisite courses are not supported on frontend that's why we are pulling first element
<span class="important-dates-item-text pre-requisite">
<a href="${ecommerce_payment_page}?sku=${student_not_enrollment_in_requirement}">
${course_requirements['display']}
</a>
</span>
<p class="tip">
${Text(_("You must successfully complete {link_start}{prc_display}{link_end} before you begin this course.")).format(
link_start=HTML('<a href="{ecommerce_payment_page}?sku={student_not_enrollment_in_requirement}">').format(
ecommerce_payment_page=ecommerce_payment_page,
student_not_enrollment_in_requirement=student_not_enrollment_in_requirement,
),
link_end=HTML('</a>'),
prc_display=course_requirements['display'],
)}
</p>
</li>
%else:
<% prc_target = reverse('about_course', args=[text_type(course_requirements['key'])]) %>
<li class="prerequisite-course important-dates-item">
<span class="icon fa fa-list-ul" aria-hidden="true"></span>
<p class="important-dates-item-title">${_("Prerequisites")}</p>
## Multiple pre-requisite courses are not supported on frontend that's why we are pulling first element
<span class="important-dates-item-text pre-requisite"><a href="${prc_target}">${course_requirements['display']}</a></span>
<p class="tip">
${Text(_("You must successfully complete {link_start}{prc_display}{link_end} before you begin this course.")).format(
link_start=HTML('<a href="{}">').format(prc_target),
link_end=HTML('</a>'),
prc_display=course_requirements['display'],
)}
</p>
</li>
%endif
% endif

% if get_course_about_section(request, course, "prerequisites"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ <h1>${_("My Courses")}</h1>
is_course_blocked = (session_id in block_courses)
course_verification_status = verification_status_by_course.get(session_id, {})
course_requirements = courses_requirements_not_met.get(session_id)
student_not_enrollment_in_requirement = sku_not_enrollment_in_requirement
student_not_enrollment_in_requirement = sku_not_enrollment_in_requirement.get(session_id)
related_programs = inverted_programs.get(six.text_type(entitlement.course_uuid if is_unfulfilled_entitlement else session_id))
show_consent_link = (session_id in consent_required_courses)
course_overview = enrollment.course_overview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,16 @@ <h4 class="message-title">${_('Your current verification will expire soon.')}</h
% if student_not_enrollment_in_requirement:
## Multiple pre-requisite courses are not supported on frontend that's why we are pulling first element
<div class="prerequisites">
You must successfully complete <a href="${ecommerce_payment_page}?sku=${student_not_enrollment_in_requirement}">${Text(_("{prc_display}")).format(
prc_display=course_requirements['courses'][0]['display'])}</a> before you begin this course.
<p class="tip">
${Text(_("You must successfully complete {link_start}{prc_display}{link_end} before you begin this course.")).format(
link_start=HTML('<a href="{ecommerce_payment_page}?sku={student_not_enrollment_in_requirement}">').format(
ecommerce_payment_page=ecommerce_payment_page,
student_not_enrollment_in_requirement=student_not_enrollment_in_requirement,
),
link_end=HTML('</a>'),
prc_display=course_requirements['courses'][0]['display'],
)}
</p>
Comment on lines +503 to +512
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the same syntax as the existing code. @anfbermudezme

</div>
%else:
## Multiple pre-requisite courses are not supported on frontend that's why we are pulling first element
Expand Down