From 8353aa24f3a365adec6d64401d7bef5f0415a63e Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 26 Jun 2023 13:00:45 +0530 Subject: [PATCH] feat: description in class card --- lms/public/css/style.css | 4 +++- lms/www/classes/index.html | 14 ++++++++++---- lms/www/classes/index.py | 10 +++++++++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/lms/public/css/style.css b/lms/public/css/style.css index fe07f084..d8afb208 100644 --- a/lms/public/css/style.css +++ b/lms/public/css/style.css @@ -378,12 +378,14 @@ input[type=checkbox] { } .short-introduction { + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; text-overflow: ellipsis; width: 100%; overflow: hidden; white-space: nowrap; margin-bottom: 1.25rem; - } .card-divider { diff --git a/lms/www/classes/index.html b/lms/www/classes/index.html index daaf6c29..fed9ac46 100644 --- a/lms/www/classes/index.html +++ b/lms/www/classes/index.html @@ -1,6 +1,6 @@ {% extends "lms/templates/lms_base.html" %} {% block title %} - {{ _("All Classes") }} + {{ _("All Classes") }} {% endblock %} {% block page_content %} @@ -93,13 +93,19 @@ {% set course_count = frappe.db.count("Class Course", {"parent": class.name}) %} {% set student_count = frappe.db.count("Class Student", {"parent": class.name}) %} -
+
-
+
{{ class.title }}
-
+ {% if class.description %} +
+ {{ class.description }} +
+ {% endif %} + +
diff --git a/lms/www/classes/index.py b/lms/www/classes/index.py index 8f44a81a..4c0c83ff 100644 --- a/lms/www/classes/index.py +++ b/lms/www/classes/index.py @@ -8,7 +8,15 @@ def get_context(context): context.is_moderator = has_course_moderator_role() classes = frappe.get_all( "LMS Class", - fields=["name", "title", "start_date", "end_date", "paid_class", "seat_count"], + fields=[ + "name", + "title", + "description", + "start_date", + "end_date", + "paid_class", + "seat_count", + ], ) past_classes, upcoming_classes = [], []