diff --git a/school/lms/md.py b/school/lms/md.py index 5acb6322..b072af2a 100644 --- a/school/lms/md.py +++ b/school/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="lxml") + soup = BeautifulSoup(html, features="html5lib") nodes = soup.body.children classname = "" if macro == "YouTubeVideo": diff --git a/school/www/courses/course.html b/school/www/courses/course.html index 17159034..469dd262 100644 --- a/school/www/courses/course.html +++ b/school/www/courses/course.html @@ -10,9 +10,8 @@
{{ widgets.BreadCrumb(course=course) }} {{ CourseCardWide(course) }} - {{ CourseOutlineAndCreator(course) }} + {{ CourseSections(course) }} {{ Mentors(course) }} - {{ CourseDescriptionAndOverview(course) }} {{ widgets.Reviews(course=course, membership=membership) }}
@@ -111,56 +110,102 @@ -{% macro CourseOutlineAndCreator(course) %} -{% set certificate = course.is_certified() %} +{% macro CourseSections(course) %}
{{ widgets.CourseOutline(course=course, membership=membership) }} + {{ Description(course) }}
-
-
- Creator -
- {{ widgets.MemberCard(member=course.get_instructor(), show_course_count=True, dimension_class="member-card-large") }} + {{ CreatorSection(course) }} + {{ Progress(course) }} + {{ Overview(course) }} +
+
+{% endmacro %} + +{% macro CreatorSection(course) %} +
+
+ Creator +
+ {{ widgets.MemberCard(member=course.get_instructor(), show_course_count=True, dimension_class="member-card-large") }} +
+{% endmacro %} + +{% macro Progress(course) %} +{% set certificate = course.is_certified() %} +{% set progress = frappe.utils.cint(membership.progress) %} +{% if progress %} +
+
+ Your Progress +
+
+

+ {% if progress != 100 %} + Great work so far! + {% else %} + Excellent work on completing this course 👏 + {% endif %} +

+

+ {% if progress != 100 %} + Challenge yourself to complete the lessons and grow professionally. + {% else %} + You have reached a new level in your journey to success! + {% endif %} +

+
+ {{ frappe.utils.rounded(progress) }}%
- {% set progress = frappe.utils.cint(membership.progress) %} - {% if progress %} -
-
- Your Progress -
-
-

- {% if progress != 100 %} - Great work so far! - {% else %} - Excellent work on completing this course 👏 - {% endif %} -

-

- {% if progress != 100 %} - Challenge yourself to complete the lessons and grow professionally. - {% else %} - You have reached a new level in your journey to success! - {% endif %} -

-
- {{ frappe.utils.rounded(progress) }}% -
-
-
-
- {% if certificate %} - Get - Certificate - {% endif %} -
+
+
+
+ {% if certificate %} + Get + Certificate + {% endif %} +
+
+{% endif %} +{% endmacro %} + +{% macro Description(course) %} +
+
+ Course Description +
+
+ {{ frappe.utils.md_to_html(course.description) }} +
+
+{% endmacro %} + +{% macro Overview(course) %} +{% set avg_rating = course.get_average_rating() %} +{% if course.get_students() | length or avg_rating %} +
+
+ Overview +
+
+ {% if course.get_students() | length %} +
+ + {{ course.get_students() | length }} Enrolled +
+ {% endif %} + {% if avg_rating %} +
+ + {{ frappe.utils.flt(avg_rating, frappe.get_system_settings("float_precision") or 3) }} Rating
{% endif %}
+{% endif %} {% endmacro %} @@ -185,40 +230,3 @@
{% endif %} {% endmacro %} - - - -{% macro CourseDescriptionAndOverview(course) %} -
-
-
- Course Description -
-
- {{ frappe.utils.md_to_html(course.description) }} -
-
- {% set avg_rating = course.get_average_rating() %} - {% if course.get_students() | length or avg_rating %} -
-
- Overview -
-
- {% if course.get_students() | length %} -
- - {{ course.get_students() | length }} Enrolled -
- {% endif %} - {% if avg_rating %} -
- - {{ frappe.utils.flt(avg_rating, frappe.get_system_settings("float_precision") or 3) }} Rating -
- {% endif %} -
-
- {% endif %} -
-{% endmacro %}