From 211ca3111f659d8443241787434f2125cdb02387 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Fri, 21 Oct 2022 11:00:37 +0530 Subject: [PATCH] fix: stats template --- .../lms_statistics/lms_statistics.html | 16 ++++++++++++++- .../lms_statistics/lms_statistics.json | 20 +++++++++++++++++-- lms/templates/statistics.html | 6 +++--- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/lms/lms/web_template/lms_statistics/lms_statistics.html b/lms/lms/web_template/lms_statistics/lms_statistics.html index c4d7f36b..3c8f50f2 100644 --- a/lms/lms/web_template/lms_statistics/lms_statistics.html +++ b/lms/lms/web_template/lms_statistics/lms_statistics.html @@ -1 +1,15 @@ -{% include "lms/templates/statistics.html" %} +{% if title %} +

+ {{ _(title) }} +

+{% endif %} + +{% if subtitle %} +

+ {{ _(subtitle) }} +

+{%- endif -%} + +
+ {% include "lms/templates/statistics.html" %} +
diff --git a/lms/lms/web_template/lms_statistics/lms_statistics.json b/lms/lms/web_template/lms_statistics/lms_statistics.json index 825ee411..7ef14a88 100644 --- a/lms/lms/web_template/lms_statistics/lms_statistics.json +++ b/lms/lms/web_template/lms_statistics/lms_statistics.json @@ -4,6 +4,22 @@ "docstatus": 0, "doctype": "Web Template", "fields": [ + { + "__islocal": 1, + "__unsaved": 1, + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "reqd": 0 + }, + { + "__islocal": 1, + "__unsaved": 1, + "fieldname": "subtitle", + "fieldtype": "Text", + "label": "Subtitle", + "reqd": 0 + }, { "fieldname": "published_courses", "fieldtype": "Check", @@ -24,10 +40,10 @@ } ], "idx": 0, - "modified": "2022-09-28 17:44:37.982923", + "modified": "2022-10-20 20:10:48.490785", "modified_by": "Administrator", "module": "LMS", - "name": "Dashboard Stats", + "name": "LMS Statistics", "owner": "Administrator", "standard": 1, "template": "", diff --git a/lms/templates/statistics.html b/lms/templates/statistics.html index 252d3ac3..6324cf39 100644 --- a/lms/templates/statistics.html +++ b/lms/templates/statistics.html @@ -6,7 +6,7 @@ {{ _("Published Courses") }}
- {{ format_number(frappe.db.count("LMS Course", { "published": 1, "upcoming": 0 })) }} + {{ frappe.db.count("LMS Course", { "published": 1, "upcoming": 0 }) }}
{% endif %} @@ -17,7 +17,7 @@ {{ _("Total Signups") }}
- {{ format_number(frappe.db.count("User", { "enabled": 1 })) }} + {{ frappe.db.count("User", { "enabled": 1 }) }}
{% endif %} @@ -28,7 +28,7 @@ {{ _("Enrollment Count") }}
- {{ format_number(frappe.db.count("LMS Batch Membership")) }} + {{ frappe.db.count("LMS Batch Membership") }}
{% endif %}