From a23a356bf6b884d0fcee7cbe45e2e50285e781d4 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 16 Feb 2022 19:12:25 +0530 Subject: [PATCH 1/2] style: course home --- .../multiple_testimonials.html | 3 + .../exhibitor_section/exhibitor_section.html | 4 +- .../speaker_section/speaker_section.html | 4 +- .../talk_section/talk_section.html | 2 +- school/hooks.py | 2 + .../lms_certification/lms_certification.py | 4 +- school/lms/doctype/lms_course/lms_course.js | 8 + school/lms/doctype/lms_course/lms_course.json | 13 +- .../lms/doctype/related_courses/__init__.py | 0 .../related_courses/related_courses.js | 8 + .../related_courses/related_courses.json | 32 ++ .../related_courses/related_courses.py | 8 + .../related_courses/test_related_courses.py | 8 + school/lms/md.py | 2 +- school/lms/utils.py | 35 +- .../course_cards/course_cards.html | 8 +- school/lms/widgets/ChapterTeaser.html | 123 ------ school/lms/widgets/CourseCard.html | 37 +- school/lms/widgets/CourseOutline.html | 131 +++++- school/lms/widgets/MemberCard.html | 4 +- school/lms/widgets/Reviews.html | 77 +++- school/public/css/style.css | 366 +++++++++++------ school/public/icons/book.svg | 7 + school/public/icons/user.svg | 4 +- school/www/batch/learn.js | 14 +- school/www/courses/course.html | 386 +++++++++--------- school/www/courses/course.py | 12 +- school/www/profiles/profile.html | 2 +- 28 files changed, 789 insertions(+), 515 deletions(-) create mode 100644 school/lms/doctype/related_courses/__init__.py create mode 100644 school/lms/doctype/related_courses/related_courses.js create mode 100644 school/lms/doctype/related_courses/related_courses.json create mode 100644 school/lms/doctype/related_courses/related_courses.py create mode 100644 school/lms/doctype/related_courses/test_related_courses.py delete mode 100644 school/lms/widgets/ChapterTeaser.html create mode 100644 school/public/icons/book.svg diff --git a/school/community/web_template/multiple_testimonials/multiple_testimonials.html b/school/community/web_template/multiple_testimonials/multiple_testimonials.html index ff7e150b..c51e0a9c 100644 --- a/school/community/web_template/multiple_testimonials/multiple_testimonials.html +++ b/school/community/web_template/multiple_testimonials/multiple_testimonials.html @@ -26,6 +26,7 @@ {% endfor %} + {% if testimonials_table | length > 3 %}
@@ -44,4 +45,6 @@ Next
+ {% endif %} + diff --git a/school/event_management/web_template/exhibitor_section/exhibitor_section.html b/school/event_management/web_template/exhibitor_section/exhibitor_section.html index 94fc3684..5ac8ba8a 100644 --- a/school/event_management/web_template/exhibitor_section/exhibitor_section.html +++ b/school/event_management/web_template/exhibitor_section/exhibitor_section.html @@ -12,10 +12,10 @@
{{ widgets.Avatar(member=member, avatar_class="avatar-large")}} -
+
{{ member.full_name }}
-
+
{{exhibitor_doc.company}}
diff --git a/school/event_management/web_template/speaker_section/speaker_section.html b/school/event_management/web_template/speaker_section/speaker_section.html index ed35418a..c4f32962 100644 --- a/school/event_management/web_template/speaker_section/speaker_section.html +++ b/school/event_management/web_template/speaker_section/speaker_section.html @@ -12,10 +12,10 @@
{{ widgets.Avatar(member=member, avatar_class="avatar-large") }} -
+
{{ member.full_name }}
-
+
{{speaker_doc.company}}
diff --git a/school/event_management/web_template/talk_section/talk_section.html b/school/event_management/web_template/talk_section/talk_section.html index f6ababe3..bb8c10ef 100644 --- a/school/event_management/web_template/talk_section/talk_section.html +++ b/school/event_management/web_template/talk_section/talk_section.html @@ -60,7 +60,7 @@
{{ widgets.Avatar(member=member, avatar_class="avatar-small")}} {{ member.full_name }} - +
- -
- Explore More -
- +
+ {{ _("Explore More") }} +
diff --git a/school/lms/widgets/ChapterTeaser.html b/school/lms/widgets/ChapterTeaser.html deleted file mode 100644 index 7376acfd..00000000 --- a/school/lms/widgets/ChapterTeaser.html +++ /dev/null @@ -1,123 +0,0 @@ -
- - - - -
- -{% if index != get_chapters(course.name) | length %} -
-{% endif %} - - diff --git a/school/lms/widgets/CourseCard.html b/school/lms/widgets/CourseCard.html index 8e089921..52f613ed 100644 --- a/school/lms/widgets/CourseCard.html +++ b/school/lms/widgets/CourseCard.html @@ -58,11 +58,11 @@ {% endif %} - + {% set student_count = get_students(course.name) | length %} {% if student_count %} - + {{ student_count }} @@ -85,15 +85,8 @@ membership.current_lesson else '1.1' %} {% set query_parameter = "?batch=" + membership.batch if membership and membership.batch else "" %} - {% set certificate = is_certified(course.name) %} - {% if certificate %} - - - {% elif course.enable_certification and progress == 100 %} - - - {% elif progress == 100 %} + {% if progress == 100 %} {% elif course.upcoming %} @@ -109,27 +102,3 @@ {% endif %}
- - diff --git a/school/lms/widgets/CourseOutline.html b/school/lms/widgets/CourseOutline.html index 5c1e47db..ab44b730 100644 --- a/school/lms/widgets/CourseOutline.html +++ b/school/lms/widgets/CourseOutline.html @@ -1,12 +1,131 @@ {% if get_chapters(course.name) | length %} -
+
- Course Outline + {{ _("Course Content") }}
-
- {% for chapter in get_chapters(course.name) %} - {{ widgets.ChapterTeaser(index=loop.index, chapter=chapter, course=course, batch=batch, membership=membership) }} - {% endfor %} + {% for chapter in get_chapters(course.name) %} +
+ + +
+ {% endfor %}
{% endif %} + + diff --git a/school/lms/widgets/MemberCard.html b/school/lms/widgets/MemberCard.html index 6205e0e7..7169ce2c 100644 --- a/school/lms/widgets/MemberCard.html +++ b/school/lms/widgets/MemberCard.html @@ -1,12 +1,12 @@
{{ widgets.Avatar(member=member, avatar_class=avatar_class) }} -
+
{{ member.full_name }}
{% set course_count = get_authored_courses(member.name) | length %} {% if show_course_count and course_count > 0 %} {% set suffix = "Courses" if course_count > 1 else "Course" %} -
+
Created {{ course_count }} {{ suffix }}
{% endif %} diff --git a/school/lms/widgets/Reviews.html b/school/lms/widgets/Reviews.html index 250d63f2..bd1670c1 100644 --- a/school/lms/widgets/Reviews.html +++ b/school/lms/widgets/Reviews.html @@ -10,29 +10,76 @@ {% endif %}
- {% if reviews | length %} -
- {% for review in reviews %} -
-
{{ review.review }}
-