diff --git a/lms/public/css/style.css b/lms/public/css/style.css
index acc05bee..c6c9e99d 100644
--- a/lms/public/css/style.css
+++ b/lms/public/css/style.css
@@ -2478,4 +2478,8 @@ select {
.questions-table .row-index {
display: none;
+}
+
+.text-color {
+ color: var(--text-color);
}
\ No newline at end of file
diff --git a/lms/www/batches/batch.html b/lms/www/batches/batch.html
index 86cb1202..cda89302 100644
--- a/lms/www/batches/batch.html
+++ b/lms/www/batches/batch.html
@@ -75,14 +75,6 @@
- {% if is_moderator %}
-
{{ batch_info.custom_component }}
@@ -140,6 +132,15 @@
+
+
+
+ {{ _("Emails") }}
+
+ {{ batch_emails | length }}
+
+
+
{% endif %}
{% if batch_students | length and (is_moderator or is_student) %}
@@ -192,6 +193,10 @@
{{ AssessmentsSection(batch_info) }}
+
+
+ {{ EmailsSection() }}
+
{% endif %}
{% if batch_students | length and (is_moderator or is_student or is_evaluator) %}
@@ -376,6 +381,41 @@
{% endmacro %}
+
+{% macro EmailsSection() %}
+
+
+
+
+ {% for email in batch_emails %}
+
+
+
+
+ {% set member = frappe.db.get_value("User", email.sender, ["full_name", "username", "name", "user_image"], as_dict=1) %}
+ {{ widgets.Avatar(member=member, avatar_class="avatar-small") }}
+
+
+ {{ member.full_name }}
+
+
+ {{ frappe.utils.pretty_date(email.communication_date) }}
+
+
+
+
+
+
+ {{ email.content }}
+
+
+ {% endfor %}
+
+{% endmacro %}
+
+
{% macro AssessmentList(assessments) %}
{% if assessments | length %}
diff --git a/lms/www/batches/batch.js b/lms/www/batches/batch.js
index 5a1407ef..be3ea75d 100644
--- a/lms/www/batches/batch.js
+++ b/lms/www/batches/batch.js
@@ -843,6 +843,9 @@ const send_email_to_students = (students, values) => {
message: __("Email sent successfully"),
indicator: "green",
});
+ setTimeout(() => {
+ window.location.reload();
+ }, 2000);
},
});
};
diff --git a/lms/www/batches/batch.py b/lms/www/batches/batch.py
index bb3ad307..3f45ef8d 100644
--- a/lms/www/batches/batch.py
+++ b/lms/www/batches/batch.py
@@ -71,6 +71,13 @@ def get_context(context):
)
context.course_name_list = [course.course for course in context.batch_courses]
context.assessments = get_assessments(batch_name)
+ context.batch_emails = frappe.get_all(
+ "Communication",
+ filters={"reference_doctype": "LMS Batch", "reference_name": batch_name},
+ fields=["subject", "content", "recipients", "cc", "communication_date", "sender"],
+ order_by="communication_date desc",
+ )
+
context.batch_students = get_class_student_details(
batch_students, batch_courses, context.assessments
)