From 87fe3e72a2fdde292ad9d522b52e850575c941b7 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Tue, 24 May 2022 16:51:55 +0530 Subject: [PATCH] fix: course certificate price display --- lms/lms/utils.py | 2 +- lms/lms/widgets/CourseCard.html | 18 ++++-- lms/lms/widgets/CourseOutline.html | 92 +++++++++++++++--------------- lms/public/css/style.css | 20 ++++--- lms/public/icons/symbol-defs.svg | 19 ++++++ lms/www/courses/course.html | 85 +++++++++++++-------------- lms/www/courses/index.html | 3 +- 7 files changed, 136 insertions(+), 103 deletions(-) diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 7b550d51..129737fc 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -372,4 +372,4 @@ def format_amount(amount, currency): if amount_reduced < 1: return amount precision = 0 if amount % 1000 == 0 else 1 - return _("{0}K").format(fmt_money(amount_reduced, precision, currency)) + return _("{0}k").format(fmt_money(amount_reduced, precision, currency)) diff --git a/lms/lms/widgets/CourseCard.html b/lms/lms/widgets/CourseCard.html index 05908ca7..d8a11583 100644 --- a/lms/lms/widgets/CourseCard.html +++ b/lms/lms/widgets/CourseCard.html @@ -51,6 +51,18 @@ {{ frappe.utils.flt(avg_rating, frappe.get_system_settings("float_precision") or 3) }} {% endif %} + + {% if course.paid_certificate %} +
+ + + + + {{ format_amount(course.price_certificate, course.currency) }} + +
+ {% endif %} + {% endif %} @@ -66,12 +78,6 @@
{{ progress }}% {{ _("Completed") }}
{% endif %} - {% if course.paid_certificate %} -
- {{ _("Certificate Price: {0}").format(format_amount(course.price_certificate, course.currency)) }} -
- {% endif %} -