diff --git a/community/lms/doctype/lesson/lesson.py b/community/lms/doctype/lesson/lesson.py
index d90fa2c1..3b66ac0c 100644
--- a/community/lms/doctype/lesson/lesson.py
+++ b/community/lms/doctype/lesson/lesson.py
@@ -63,32 +63,35 @@ class Lesson(Document):
return
@frappe.whitelist()
-def save_progress(lesson, course):
+def save_progress(lesson, course, status):
if not frappe.db.exists("LMS Batch Membership",
{
"member": frappe.session.user,
"course": course
}):
return
+
if frappe.db.exists("LMS Course Progress",
{
"lesson": lesson,
- "owner": frappe.session.user
+ "owner": frappe.session.user,
+ "course": course
}):
- return
-
- lesson_details = frappe.get_doc("Lesson", lesson)
- dynamic_content = find_macros(lesson_details.body)
-
- status = "Complete"
- if dynamic_content:
- status = "Partially Complete"
-
- frappe.get_doc({
- "doctype": "LMS Course Progress",
- "lesson": lesson_details.name,
- "status": status
- }).save(ignore_permissions=True)
+ doc = frappe.get_doc("LMS Course Progress",
+ {
+ "lesson": lesson,
+ "owner": frappe.session.user,
+ "course": course
+ })
+ doc.status = status
+ doc.save(ignore_permissions=True)
+ else:
+ frappe.get_doc({
+ "doctype": "LMS Course Progress",
+ "lesson": lesson,
+ "status": status,
+ }).save(ignore_permissions=True)
+ return "OK"
def update_progress(lesson):
user = frappe.session.user
diff --git a/community/lms/doctype/lms_course/lms_course.py b/community/lms/doctype/lms_course/lms_course.py
index 29b6bb8d..db38d76a 100644
--- a/community/lms/doctype/lms_course/lms_course.py
+++ b/community/lms/doctype/lms_course/lms_course.py
@@ -283,6 +283,15 @@ class LMSCourse(Document):
def get_outline(self):
return CourseOutline(self)
+ def get_progress(self, lesson):
+ return frappe.db.get_value("LMS Course Progress",
+ {
+ "course": self.name,
+ "owner": frappe.session.user,
+ "lesson": lesson
+ },
+ ["status"])
+
class CourseOutline:
def __init__(self, course):
self.course = course
diff --git a/community/lms/widgets/ChapterTeaser.html b/community/lms/widgets/ChapterTeaser.html
index e813f03e..a7b89ac7 100644
--- a/community/lms/widgets/ChapterTeaser.html
+++ b/community/lms/widgets/ChapterTeaser.html
@@ -1,21 +1,34 @@
+

{{ index }}. {{ chapter.title }}
+
+
{{ chapter.description }}
+
+
{% for lesson in chapter.get_lessons() %}
+
+
{% if show_link or lesson.include_in_preview %}
{{ lesson.title }}
+
+ {% if show_link %}
+

+ {% endif %}
+
{% else %}
@@ -24,11 +37,14 @@
{% endif %}
+
{% endfor %}
+
+
{% if index != course.get_chapters() | length %}
{% endif %}
@@ -36,16 +52,28 @@
diff --git a/community/lms/widgets/MemberCard.html b/community/lms/widgets/MemberCard.html
index 87cb60b8..6889b5d4 100644
--- a/community/lms/widgets/MemberCard.html
+++ b/community/lms/widgets/MemberCard.html
@@ -11,4 +11,5 @@
Created {{ course_count }} {{ suffix }}
{% endif %}
+
diff --git a/community/lms/widgets/Reviews.html b/community/lms/widgets/Reviews.html
index 2d64ae20..0b365ef0 100644
--- a/community/lms/widgets/Reviews.html
+++ b/community/lms/widgets/Reviews.html
@@ -77,7 +77,7 @@
diff --git a/community/public/css/style.css b/community/public/css/style.css
index 13e22076..b5455fa8 100644
--- a/community/public/css/style.css
+++ b/community/public/css/style.css
@@ -489,6 +489,7 @@ div.custom-checkbox>label>input:checked+img {
padding: 24px;
background: #E2E6E9;
border-radius: 12px;
+ margin-top: 16px;
}
@media (max-width: 768px) {
@@ -543,8 +544,8 @@ div.custom-checkbox>label>input:checked+img {
@media (max-width: 768px) {
.course-home-page {
- padding: 0px;
- width: 688px;
+ padding: 0px 0px 30px;
+ width: 90%;
}
}
@@ -605,17 +606,26 @@ div.custom-checkbox>label>input:checked+img {
}
}
-.wide-button {
+.button {
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.13), 0px 0px 0.5px rgba(0, 0, 0, 0.5);
border-radius: 6px;
- padding: 12px 24px 12px;
- margin-right: 16px;
- height: 48px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
width: fit-content;
+ padding: 8px 12px 8px;
+ font-size: 12px;
+ line-height: 135%;
+ letter-spacing: -0.011em;
+}
+
+.wide-button {
+ padding: 12px 24px 12px;
+ height: 48px;
+ margin-right: 16px;
+ font-size: 16px;
+ line-height: 150%;
}
@media (max-width: 375px) {
@@ -634,7 +644,7 @@ div.custom-checkbox>label>input:checked+img {
}
@media (max-width: 375px) {
- .is-secondary {
+ .video-preview {
margin-top: 16px;
}
}
@@ -712,6 +722,7 @@ div.custom-checkbox>label>input:checked+img {
line-height: 250%;
letter-spacing: -0.011em;
margin-bottom: 2px;
+ padding-left: 10px;
}
.chapter-content {
@@ -910,11 +921,24 @@ div.custom-checkbox>label>input:checked+img {
}
.breadcrumb {
- margin: 16px 10px 16px;
+ margin: 16px 10px 0px;
}
.course-details-outline {
width: 352px;
+ margin-top: 16px;
+}
+
+@media (max-width: 768px) {
+ .course-details-outline {
+ width: 688px;
+ }
+}
+
+@media (max-width: 375px) {
+ .course-details-outline {
+ width: 312px;
+ }
}
.lesson-content-card {
@@ -922,13 +946,20 @@ div.custom-checkbox>label>input:checked+img {
flex-direction: column;
}
-.lesson-content {
- width: 736px;
-}
-
.course-content-parent {
display: flex;
justify-content: space-between;
+ flex-wrap: wrap-reverse;
+}
+
+@media (max-width: 375px) {
+ .course-content-parent {
+ justify-content: center;
+ }
+}
+
+.course-content-parent .course-home-headings {
+ margin: 0px 0px 16px;
}
.lesson-pagination {
@@ -936,3 +967,65 @@ div.custom-checkbox>label>input:checked+img {
justify-content: space-between;
margin: 24px 0px 0px;
}
+
+.lesson-pagination-parent {
+ width: 736px;
+ margin-top: 16px;
+}
+
+@media (max-width: 768px) {
+ .lesson-pagination-parent {
+ width: 690px;
+ }
+}
+
+@media (max-width: 375px) {
+ .lesson-pagination-parent {
+ width: 312px;
+ }
+}
+
+.course-details-page {
+ padding: 0px 0px 80px;
+ display: flex;
+ flex-direction: column;
+ width: 1120px;
+ margin: 0 auto;
+}
+
+@media (max-width: 768px) {
+ .course-details-page {
+ padding: 24px 0px 24px;
+ width: 90%;
+ }
+}
+
+@media (max-width: 375px) {
+ .course-details-page {
+ width: 100%;
+ }
+}
+
+.active-lesson {
+ background-color: #EBF5FF;
+ border-radius: 4px;
+}
+
+.lesson-progress {
+ background: #BFDDF7;
+ padding: 4px 8px 4px;
+ font-size: 10px;
+ line-height: 120%;
+ margin: 0px 10px 20px;
+ border-radius: 4px;
+ font-weight: bold;
+}
+
+.lesson-progress-tick {
+ width: 16px;
+ height: 16px;
+ background: #4C5A67;
+ border-radius: 2px;
+ padding: 2px;
+ margin: 0px 4px 4px;
+}
diff --git a/community/public/icons/white-tick.svg b/community/public/icons/white-tick.svg
new file mode 100644
index 00000000..91da7b6d
--- /dev/null
+++ b/community/public/icons/white-tick.svg
@@ -0,0 +1,3 @@
+
diff --git a/community/www/batch/learn.html b/community/www/batch/learn.html
index 945f7f7e..b9fa6506 100644
--- a/community/www/batch/learn.html
+++ b/community/www/batch/learn.html
@@ -21,7 +21,7 @@
{% block content %}
-
+
{{ widgets.Breadcrumb(course=course, lesson=lesson) }}
@@ -40,9 +40,10 @@
{% macro LessonContent(lesson) %}
-
{{ lesson.title }}
+
+ {{ lesson.title }}
+ COMPLETED
+
{% if membership or lesson.include_in_preview %}
{{ lesson.render_html() }}
@@ -52,6 +53,7 @@
Checkout Course Details.
{% endif %}
+
{% endmacro %}
@@ -59,22 +61,33 @@
{% endmacro %}