diff --git a/edx-platform/pearson-pathways-theme/lms/templates/courseware/course_about.html b/edx-platform/pearson-pathways-theme/lms/templates/courseware/course_about.html new file mode 100644 index 00000000..a919377f --- /dev/null +++ b/edx-platform/pearson-pathways-theme/lms/templates/courseware/course_about.html @@ -0,0 +1,323 @@ +<%page expression_filter="h"/> +<%namespace name='static' file='../static_content.html'/> +<%! +from django.utils.translation import ugettext as _ +from django.utils.translation import pgettext +from django.urls import reverse +from lms.djangoapps.courseware.courses import get_course_about_section +from django.conf import settings +from six import text_type +from edxmako.shortcuts import marketing_link +from openedx.core.djangolib.js_utils import js_escaped_string +from openedx.core.djangolib.markup import clean_dangerous_html, HTML, Text +from openedx.core.lib.courses import course_image_url + +from six import string_types +%> + +<%inherit file="../main.html" /> +<%block name="headextra"> + ## OG (Open Graph) title and description added below to give social media info to display + ## (https://developers.facebook.com/docs/opengraph/howtos/maximizing-distribution-media-content#tags) + + + + +<%block name="js_extra"> + + + + + +<%block name="pagetitle">${course.display_name_with_default} + +
+ + <%block name="course_about_header"> +
+
+
+
+
+

+ ${course.display_name_with_default} +

+
+ ${course.display_org_with_default} +
+ +
+ %if user.is_authenticated and registered: + %if show_courseware_link: + + %endif + + ${_("You are enrolled in this course")} + + %if show_courseware_link: + ${_("View Course")} + + %endif + + % elif is_course_full: + + ${_("Course is full")} + + % elif invitation_only and not can_enroll: + ${_("Enrollment in this course is by invitation only")} + ## Shib courses need the enrollment button to be displayed even when can_enroll is False, + ## because AnonymousUsers cause can_enroll for shib courses to be False, but we need them to be able to click + ## so that they can register and become a real user that can enroll. + % elif not is_shib_course and not can_enroll: + ${_("Enrollment is Closed")} + %elif allow_anonymous: + %if show_courseware_link: + + ${_("View Course")} + + %endif + %else: + <% + if ecommerce_checkout: + reg_href = ecommerce_checkout_link + else: + reg_href="#" + if single_paid_mode: + href_class = "add-to-cart" + else: + href_class = "register" + %> + + ${_("Enroll Now")} + +
+ %endif +
+ +
+ % if get_course_about_section(request, course, "video"): + +
+ +
+
+
+ %else: +
+
+ +
+
+ % endif +
+
+
+ + +
+ + <%block name="course_about_details"> +
+ % if staff_access and studio_url is not None: + + % endif + +
+ ${clean_dangerous_html(get_course_about_section(request, course, "overview"))} +
+
+ + +
+
+ + <%include file="course_about_sidebar_header.html" /> + + <%block name="course_about_important_dates"> +
    +
  1. ${_("Course Number")}

    ${course.display_number_with_default}
  2. + % if not course.start_date_is_still_default: + <% + course_start_date = course.advertised_start or course.start + %> +
  3. + +

    ${_("Classes Start")}

    + % if isinstance(course_start_date, string_types): + ${course_start_date} + % else: + <% + course_date_string = course_start_date.strftime('%Y-%m-%dT%H:%M:%S%z') + %> + + % endif +
  4. + % endif + ## We plan to ditch end_date (which is not stored in course metadata), + ## but for backwards compatibility, show about/end_date blob if it exists. + % if course.end: + <% + course_end_date = course.end + %> + +
  5. + +

    ${_("Classes End")}

    + % if isinstance(course_end_date, string_types): + ${course_end_date} + % else: + <% + course_date_string = course_end_date.strftime('%Y-%m-%dT%H:%M:%S%z') + %> + + % endif +
  6. + % endif + + % if get_course_about_section(request, course, "effort"): +
  7. ${_("Estimated Effort")}

    ${get_course_about_section(request, course, "effort")}
  8. + % endif + + ##
  9. ${_('Course Length')}

    ${_('{number} weeks').format(number=15)}
  10. + + %if course_price and (is_cosmetic_price_enabled): +
  11. + +

    ${_("Price")}

    + ${course_price} +
  12. + %endif + + % if course_requirements: + % if student_not_enrollment_in_requirement: +
  13. + +

    ${_("Prerequisites")}

    + ## Multiple pre-requisite courses are not supported on frontend that's why we are pulling first element + + + ${course_requirements['display']} + + +

    + ${Text(_("You must successfully complete {link_start}{prc_display}{link_end} before you begin this course.")).format( + link_start=HTML('').format( + ecommerce_payment_page=ecommerce_payment_page, + student_not_enrollment_in_requirement=student_not_enrollment_in_requirement, + ), + link_end=HTML(''), + prc_display=course_requirements['display'], + )} +

    +
  14. + %else: + <% prc_target = reverse('about_course', args=[text_type(course_requirements['key'])]) %> +
  15. + +

    ${_("Prerequisites")}

    + ## Multiple pre-requisite courses are not supported on frontend that's why we are pulling first element + ${course_requirements['display']} +

    + ${Text(_("You must successfully complete {link_start}{prc_display}{link_end} before you begin this course.")).format( + link_start=HTML('').format(prc_target), + link_end=HTML(''), + prc_display=course_requirements['display'], + )} +

    +
  16. + %endif + % endif + + % if get_course_about_section(request, course, "prerequisites"): +
  17. ${_("Requirements")}

    ${get_course_about_section(request, course, "prerequisites")}
  18. + % endif +
+ +
+ + <%block name="course_about_reviews_tool"> + ## Course reviews tool + % if reviews_fragment_view: + ${HTML(reviews_fragment_view.body_html())} + % endif + + + ## For now, ocw links are the only thing that goes in additional resources + % if get_course_about_section(request, course, "ocw_links"): +
+
+

${_("Additional Resources")}

+
+ +
+ ## "MITOpenCourseware" should *not* be translated +

MITOpenCourseware

+ ${get_course_about_section(request, course, "ocw_links")} +
+
+ %endif + + % if sidebar_html_enabled: + % if get_course_about_section(request, course, "about_sidebar_html"): +
+ ${get_course_about_section(request, course, "about_sidebar_html")} +
+ % endif + %endif +
+ + + + +## Need to put this hidden form on the page so that the registration button works. +## Since it's no harm to display a hidden form, we display it with the most permissive conditional +## which is when the student is not registered. +%if active_reg_button or is_shib_course: +
+
+
+ ${pgettext("self","Enroll")} + + +
+
+ +
+
+
+%endif + +<%include file="../video_modal.html" /> + +<%static:require_module_async module_name="js/dateutil_factory" class_name="DateUtilFactory"> + DateUtilFactory.transform(iterationKey=".localized_datetime"); + diff --git a/edx-platform/pearson-pathways-theme/lms/templates/dashboard.html b/edx-platform/pearson-pathways-theme/lms/templates/dashboard.html index 288f8c54..29edaf39 100644 --- a/edx-platform/pearson-pathways-theme/lms/templates/dashboard.html +++ b/edx-platform/pearson-pathways-theme/lms/templates/dashboard.html @@ -237,12 +237,13 @@

${_("My Courses")}

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.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 resume_button_url = resume_button_urls[dashboard_index] %> - <%include file='dashboard/_dashboard_course_listing.html' args='course_overview=course_overview, course_card_index=dashboard_index, enrollment=enrollment, is_unfulfilled_entitlement=is_unfulfilled_entitlement, is_fulfilled_entitlement=is_fulfilled_entitlement, entitlement=entitlement, entitlement_session=entitlement_session, entitlement_available_sessions=entitlement_available_sessions, entitlement_expiration_date=entitlement_expiration_date, entitlement_expired_at=entitlement_expired_at, show_courseware_link=show_courseware_link, cert_status=cert_status, can_refund_entitlement=can_refund_entitlement, can_unenroll=can_unenroll, credit_status=credit_status, show_email_settings=show_email_settings, course_mode_info=course_mode_info, is_paid_course=is_paid_course, is_course_blocked=is_course_blocked, verification_status=course_verification_status, course_requirements=course_requirements, dashboard_index=dashboard_index, share_settings=share_settings, user=user, related_programs=related_programs, display_course_modes_on_dashboard=display_course_modes_on_dashboard, show_consent_link=show_consent_link, enterprise_customer_name=enterprise_customer_name, resume_button_url=resume_button_url, mit_subscription=mit_subscription' /> + <%include file='dashboard/_dashboard_course_listing.html' args='course_overview=course_overview, course_card_index=dashboard_index, enrollment=enrollment, is_unfulfilled_entitlement=is_unfulfilled_entitlement, is_fulfilled_entitlement=is_fulfilled_entitlement, entitlement=entitlement, entitlement_session=entitlement_session, entitlement_available_sessions=entitlement_available_sessions, entitlement_expiration_date=entitlement_expiration_date, entitlement_expired_at=entitlement_expired_at, show_courseware_link=show_courseware_link, cert_status=cert_status, can_refund_entitlement=can_refund_entitlement, can_unenroll=can_unenroll, credit_status=credit_status, show_email_settings=show_email_settings, course_mode_info=course_mode_info, is_paid_course=is_paid_course, is_course_blocked=is_course_blocked, verification_status=course_verification_status, course_requirements=course_requirements, student_not_enrollment_in_requirement = student_not_enrollment_in_requirement, dashboard_index=dashboard_index, share_settings=share_settings, user=user, related_programs=related_programs, display_course_modes_on_dashboard=display_course_modes_on_dashboard, show_consent_link=show_consent_link, enterprise_customer_name=enterprise_customer_name, resume_button_url=resume_button_url, mit_subscription=mit_subscription' /> % endfor diff --git a/edx-platform/pearson-pathways-theme/lms/templates/dashboard/_dashboard_course_listing.html b/edx-platform/pearson-pathways-theme/lms/templates/dashboard/_dashboard_course_listing.html index 6040b092..54e25c51 100644 --- a/edx-platform/pearson-pathways-theme/lms/templates/dashboard/_dashboard_course_listing.html +++ b/edx-platform/pearson-pathways-theme/lms/templates/dashboard/_dashboard_course_listing.html @@ -1,4 +1,4 @@ -<%page args="course_overview, enrollment, entitlement, entitlement_session, course_card_index, is_unfulfilled_entitlement, is_fulfilled_entitlement, entitlement_available_sessions, entitlement_expiration_date, entitlement_expired_at, show_courseware_link, cert_status, can_refund_entitlement, can_unenroll, credit_status, show_email_settings, course_mode_info, is_paid_course, is_course_blocked, verification_status, course_requirements, dashboard_index, share_settings, related_programs, display_course_modes_on_dashboard, show_consent_link, enterprise_customer_name, resume_button_url, mit_subscription" expression_filter="h"/> +<%page args="course_overview, enrollment, entitlement, entitlement_session, course_card_index, is_unfulfilled_entitlement, is_fulfilled_entitlement, entitlement_available_sessions, entitlement_expiration_date, entitlement_expired_at, show_courseware_link, cert_status, can_refund_entitlement, can_unenroll, credit_status, show_email_settings, course_mode_info, is_paid_course, is_course_blocked, verification_status, course_requirements, student_not_enrollment_in_requirement, dashboard_index, share_settings, related_programs, display_course_modes_on_dashboard, show_consent_link, enterprise_customer_name, resume_button_url, mit_subscription" expression_filter="h"/> <%! import six @@ -496,18 +496,34 @@

${_('Your current verification will expire soon.')} -
-

- ${Text(_("You must successfully complete {link_start}{prc_display}{link_end} before you begin this course.")).format( - link_start=HTML('').format(prc_target), - link_end=HTML(''), - prc_display=course_requirements['courses'][0]['display'], - )} -

-
+ % if course_requirements: + % if student_not_enrollment_in_requirement: + ## Multiple pre-requisite courses are not supported on frontend that's why we are pulling first element +
+

+ ${Text(_("You must successfully complete {link_start}{prc_display}{link_end} before you begin this course.")).format( + link_start=HTML('').format( + ecommerce_payment_page=ecommerce_payment_page, + student_not_enrollment_in_requirement=student_not_enrollment_in_requirement, + ), + link_end=HTML(''), + prc_display=course_requirements['courses'][0]['display'], + )} +

+
+ %else: + ## Multiple pre-requisite courses are not supported on frontend that's why we are pulling first element + <% prc_target = reverse('about_course', args=[six.text_type(course_requirements['courses'][0]['key'])]) %> +
+

+ ${Text(_("You must successfully complete {link_start}{prc_display}{link_end} before you begin this course.")).format( + link_start=HTML('').format(prc_target), + link_end=HTML(''), + prc_display=course_requirements['courses'][0]['display'], + )} +

+
+ %endif % endif