diff --git a/lms/lms/md.py b/lms/lms/md.py index 8105c72f..b02ed68f 100644 --- a/lms/lms/md.py +++ b/lms/lms/md.py @@ -105,7 +105,7 @@ def sanitize_html(html, macro): any broken tags. This makes sures that all those things are fixed before passing to the etree parser. """ - soup = BeautifulSoup(html, features="html5lib") + soup = BeautifulSoup(html, features="lxml") nodes = soup.body.children classname = "" if macro == "YouTubeVideo": diff --git a/lms/public/css/style.css b/lms/public/css/style.css index f92558eb..13d6229e 100644 --- a/lms/public/css/style.css +++ b/lms/public/css/style.css @@ -389,7 +389,7 @@ input[type=checkbox] { } .course-content-parent .chapter-description { - font-size: 0.7rem; + font-size: 0.75rem; } .chapter-icon { @@ -1114,7 +1114,7 @@ pre { .job-card { display: flex; - position: relative; + align-items: center; } .company-logo { diff --git a/lms/www/courses/course.html b/lms/www/courses/course.html index b37663f1..25d48373 100644 --- a/lms/www/courses/course.html +++ b/lms/www/courses/course.html @@ -1 +1,320 @@ -` +{% extends "templates/base.html" %} +{% block title %}{{ course.title }} +{% endblock %} + +{% block head_include %} +{% include "public/icons/symbol-defs.svg" %} + +{% endblock %} + +{% block content %} +
+
+ {{ CourseHomeHeader(course) }} +
+
+
+ {{ CourseHeaderOverlay(course) }} + {{ Description(course) }} + {{ widgets.CourseOutline(course=course, membership=membership, is_user_interested=is_user_interested) }} + {{ widgets.Reviews(course=course, membership=membership) }} +
+
+
+
+ {{ RelatedCourses(course) }} +
+{% endblock %} + +{% macro CourseHomeHeader(course) %} +
+
+
+ {{ BreadCrumb(course) }} + {{ CourseCardWide(course) }} +
+
+
+{% endmacro %} + + +{% macro BreadCrumb(course) %} + +{% endmacro %} + + +{% macro CourseCardWide(course) %} +
+
+ {% for tag in get_tags(course.name) %} +
{{ tag }}
+ {% endfor %} +
+
+ {{ course.title }} +
+
+ {{ course.short_introduction }} +
+ + {% if membership %} + {% set progress = frappe.utils.cint(membership.progress) %} +
+
+
+
+ {% endif %} + +
+
Instructors:
+ {% for instructor in get_instructors(course.name) %} +
+ {{ widgets.Avatar(member=instructor, avatar_class="avatar-small") }} + + {{ instructor.full_name }} + +
+ {% endfor %} +
+ +
+ +{% endmacro%} + +{% macro CourseHeaderOverlay(course) %} +
+ + {% if course.video_link %} + + {% endif %} + +
+
{{ course.title }}
+ +
+ {{ _("You have opted to be notified for this course. You will receive an email when the course becomes available.") }} +
+ + {% if certificate_request and not certificate %} +

{{ _("Evaluation On: ") }} + {{ _("{0} at {1}").format(frappe.utils.format_date(certificate_request.date, "medium"), + frappe.utils.format_time(certificate_request.start_time, "short")) }}

+ {% endif %} + + {% if course.status == "Under Review" %} +
+ {{ _("Your course is currently under review. Once the review is complete, the System Admins will publish it on the website.") }} +
+ {% endif %} + + {% if no_of_attempts >= course.max_attempts %} +

{{ _("You have exceeded the maximum number of attempts allowed to appear for evaluations of this course.") }}

+ {% endif %} + + {% if is_instructor(course.name) %} + + {% endif %} + +
+
+ + + + {{ get_students(course.name) | length }} {{ _("Enrolled") }} +
+ + + + {% if get_lessons(course.name) | length %} +
+ + + + {{ get_lessons(course.name) | length }} {{ _("Lessons") }} +
+ {% endif %} +
+ + {% if course.paid_certificate %} +
+ {{ _("Certificate Price:") }} {{ frappe.utils.fmt_money(course.price_certificate, 2, course.currency) }} +
+ {% endif %} + + {% set lesson_index = get_lesson_index(membership.current_lesson) if membership and + membership.current_lesson + else '1.1' %} + + {% if show_start_learing_cta %} +
+ {{ _("Start Learning") }} + +
+ + {% elif is_instructor(course.name) and not course.published and course.status == "Under Review" %} +
+ {{ _("Submit for Review") }} + +
+ + {% elif is_instructor(course.name) %} + + {{ _("Checkout Course") }} + + + {% elif course.upcoming and not is_user_interested %} +
+ {{ _("Notify me when available") }} +
+ + {% elif is_cohort_staff(course.name, frappe.session.user) %} + + {{ _("Manage the course") }} + + + {% elif membership %} + + {{ _("Continue Learning") }} + + {% endif %} + {% set progress = frappe.utils.cint(membership.progress) %} + {% if membership and course.enable_certification %} + {% if certificate %} + + {{ _("Get Certificate") }} + + {% elif eligible_for_evaluation %} + + {{ _("Apply for Certificate") }} + + {% elif course.grant_certificate_after == "Completion" and progress == 100 %} +
+ {{ _("Get Certificate") }} +
+ {% endif %} + {% endif %} + +
+
+ + +{% endmacro %} + +{% macro Description(course) %} +
+ {{ frappe.utils.md_to_html(course.description) }} +
+{% endmacro %} + +{% macro CourseCreator(course) %} +
{{ _("Course Creators") }}
+ +
+ {% set instructors = get_instructors(course.name) %} + {% for instructor in instructors %} +
+ {{ widgets.Avatar(member=instructor, avatar_class="avatar-medium") }} +
+
{{ instructor.full_name }}
+
{{ get_authored_courses(instructor.name) | length }} {{ _("Courses Created") }}
+
+
+ {% endfor %} +
+{% endmacro %} + +{% macro RelatedCourses(course) %} +{% if course.related_courses | length %} + +{% endif%} +{% endmacro %}