From 687f7f7f7b7716572d5277110794d1c374e659c2 Mon Sep 17 00:00:00 2001 From: pateljannat Date: Thu, 27 May 2021 11:25:05 +0530 Subject: [PATCH] fix: minor home page issues --- community/lms/widgets/RenderBatch.html | 29 ++++++++++++++++++++++ community/www/batch/home.html | 27 +++----------------- community/www/courses/course.html | 34 ++------------------------ 3 files changed, 35 insertions(+), 55 deletions(-) create mode 100644 community/lms/widgets/RenderBatch.html diff --git a/community/lms/widgets/RenderBatch.html b/community/lms/widgets/RenderBatch.html new file mode 100644 index 00000000..60e77784 --- /dev/null +++ b/community/lms/widgets/RenderBatch.html @@ -0,0 +1,29 @@ +
+
+
Session every {{batch.sessions_on}}
+
{{frappe.utils.format_time(batch.start_time, "short")}} - + {{frappe.utils.format_time(batch.end_time, "short")}} +
+
Starting {{frappe.utils.format_date(batch.start_date, "medium")}}
+
mentors
+ + {% for m in batch.get_mentors() %} +
+ {{ widgets.Avatar(member=m, avatar_class="avatar-medium" ) }} + {{m.full_name}} +
+ {% endfor %} +
+ {% if can_manage or can_join %} +
+
+ {% if can_manage %} + Manage + {% elif can_join %} + + {% endif %} +
+
+ {% endif %} +
diff --git a/community/www/batch/home.html b/community/www/batch/home.html index 3b98e3fb..4198f691 100644 --- a/community/www/batch/home.html +++ b/community/www/batch/home.html @@ -14,33 +14,14 @@
{{ widgets.CourseOutline(course=course, batch=batch, show_link=True) }}
-
+

Batch Schedule

- {{ BatchDetails(batch) }} + {{ widgets.RenderBatch(batch=batch) }}
+ {% if batch.description %}

Batch Details

{{ frappe.utils.md_to_html(batch.description) }} - + {% endif %}
{% endblock %} - -{% macro BatchDetails(batch) %} -
-
-
Session every {{batch.sessions_on}}
-
{{frappe.utils.format_time(batch.start_time, "short")}} - - {{frappe.utils.format_time(batch.end_time, "short")}} -
-
Starting {{frappe.utils.format_date(batch.start_date, "medium")}}
-
mentors
- - {% for m in batch.get_mentors() %} -
- {{ widgets.Avatar(member=m, avatar_class="avatar-medium" ) }} - {{m.full_name}} -
- {% endfor %} -
-
-{% endmacro %} diff --git a/community/www/courses/course.html b/community/www/courses/course.html index 21c12831..ce8d3c90 100644 --- a/community/www/courses/course.html +++ b/community/www/courses/course.html @@ -64,36 +64,6 @@ {% endif %} {% endmacro %} -{% macro RenderBatch(batch, can_manage=False) %} -
-
-
Session every {{batch.sessions_on}}
-
{{frappe.utils.format_time(batch.start_time, "short")}} - - {{frappe.utils.format_time(batch.end_time, "short")}} -
-
Starting {{frappe.utils.format_date(batch.start_date, "medium")}}
-
mentors
- - {% for m in batch.get_mentors() %} -
- {{ widgets.Avatar(member=m, avatar_class="avatar-medium" ) }} - {{m.full_name}} -
- {% endfor %} -
-
-
- {% if can_manage %} - Manage - {% else %} - - {% endif %} -
-
-
-{% endmacro %} - {% macro BatchSectionForMentors(course, mentor_batches) %}

Your Batches

@@ -105,7 +75,7 @@
{% for batch in mentor_batches %}
- {{ RenderBatch(batch, can_manage=True) }} + {{ widgets.RenderBatch(batch=batch, can_manage=True) }}
{% endfor %}
@@ -127,7 +97,7 @@
{% for batch in upcoming_batches %}
- {{ RenderBatch(batch, can_manage=False) }} + {{ widgets.RenderBatch(batch=batch, can_join=True) }}
{% endfor %}