From 3a2ebd42a74a532b30f1c52c2c6c0f11a4c90874 Mon Sep 17 00:00:00 2001 From: pateljannat Date: Thu, 2 Sep 2021 13:26:45 +0530 Subject: [PATCH] fix: progress pill and certificate secondary cta --- .../course_cards/course_cards.html | 2 +- community/lms/widgets/CourseCard.html | 33 +++++++------- community/public/css/style.css | 10 ++--- community/www/courses/index.html | 2 +- community/www/profiles/profile.html | 45 ++++++++++--------- 5 files changed, 45 insertions(+), 47 deletions(-) diff --git a/community/lms/web_template/course_cards/course_cards.html b/community/lms/web_template/course_cards/course_cards.html index 693223e5..437ab432 100644 --- a/community/lms/web_template/course_cards/course_cards.html +++ b/community/lms/web_template/course_cards/course_cards.html @@ -3,7 +3,7 @@
{% for course_row in courses %} {% set course = frappe.get_doc("LMS Course", course_row.course) %} - {{ widgets.CourseCard(course=course, show_progress_indicators=True) }} + {{ widgets.CourseCard(course=course, read_only=False) }} {% endfor %}
diff --git a/community/lms/widgets/CourseCard.html b/community/lms/widgets/CourseCard.html index 38a51591..e73a46f2 100644 --- a/community/lms/widgets/CourseCard.html +++ b/community/lms/widgets/CourseCard.html @@ -7,6 +7,10 @@ {% for tag in course.get_tags() %}
{{ tag }}
{% endfor %} + {% set progress = course.get_course_progress() %} + {% if membership and not read_only %} +
{{ frappe.utils.rounded(progress) }}%
+ {% endif %} {% if not course.image %}
{{ course.title[0] }}
@@ -29,25 +33,11 @@ {{ course.get_upcoming_batches() | length }} Open Batches {% endif %} - {% set certificate = course.is_certified() %} - {% if certificate and show_progress_indicators %} - Get - Certificate - {% endif %}
{{ course.title }}
- {% if membership and show_progress_indicators %} - {% set progress = course.get_course_progress() %} -
-
-
- {% else %} -
- {% endif %} -
+
{{ widgets.Avatar(member=course.get_instructor(), avatar_class="avatar-small") }} @@ -73,13 +63,22 @@
+ {% if not read_only %} + {% set lesson_index = course.get_lesson_index(membership.current_lesson) if membership and membership.current_lesson else '1.1' %} {% set query_parameter = "?batch=" + membership.batch if membership and membership.batch else "" %} - {% if course.upcoming %} + {% set certificate = course.is_certified() %} + {% if certificate and not read_only %} + + + + {% elif course.upcoming %} @@ -96,8 +95,10 @@ View Course
+ {% endif %} {% endif %} +