feat: description in class card

This commit is contained in:
Jannat Patel
2023-06-26 13:00:45 +05:30
parent 99f1a8dfc3
commit 8353aa24f3
3 changed files with 22 additions and 6 deletions

View File

@@ -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 {

View File

@@ -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}) %}
<div class="common-card-style column-card">
<div class="common-card-style column-card" style="min-height: 150px;">
<div class="bold-heading mb-2">
<div class="bold-heading">
{{ class.title }}
</div>
<div class="mb-1">
{% if class.description %}
<div class="short-introduction">
{{ class.description }}
</div>
{% endif %}
<div class="mt-auto mb-1">
<svg class="icon icon-sm">
<use href="#icon-calendar"></use>
</svg>

View File

@@ -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 = [], []