From c9185ae68cb2356cf96e5326501a9efd81e25bba Mon Sep 17 00:00:00 2001 From: pateljannat Date: Mon, 24 May 2021 19:24:07 +0530 Subject: [PATCH] fix: tabs and learn page --- .../lms_batch_membership.py | 4 +-- community/lms/widgets/BatchHeader.html | 4 +++ community/lms/widgets/BatchTabs.html | 34 +++++++++++------- community/www/batch/about.html | 4 +-- community/www/batch/discuss.html | 19 ++++------ community/www/batch/learn.html | 34 +++++++++--------- community/www/batch/learn.py | 13 ++++++- community/www/batch/members.html | 35 ++++++++++--------- community/www/batch/progress.html | 28 +++++++-------- community/www/batch/schedule.html | 12 +++---- community/www/macros/common_macro.html | 8 ----- community/www/macros/sidebar.html | 30 ---------------- 12 files changed, 102 insertions(+), 123 deletions(-) create mode 100644 community/lms/widgets/BatchHeader.html delete mode 100644 community/www/macros/sidebar.html diff --git a/community/lms/doctype/lms_batch_membership/lms_batch_membership.py b/community/lms/doctype/lms_batch_membership/lms_batch_membership.py index 3993eacd..5f4ac4d5 100644 --- a/community/lms/doctype/lms_batch_membership/lms_batch_membership.py +++ b/community/lms/doctype/lms_batch_membership/lms_batch_membership.py @@ -32,12 +32,12 @@ class LMSBatchMembership(Document): filters={ "member": self.member }, - fields=["batch", "member_type"] + fields=["batch", "member_type", "name"] ) for membership in previous_membership: batch_course = frappe.db.get_value("LMS Batch", membership.batch, "course") - if batch_course == course and (membership.member_type == "Student" or self.member_type == "Student"): + if self.name != membership.name and batch_course == course and (membership.member_type == "Student" or self.member_type == "Student"): member_name = frappe.db.get_value("User", self.member, "full_name") frappe.throw(_("{0} is already a {1} of {2} course through {3} batch").format(member_name, membership.member_type, course, membership.batch)) diff --git a/community/lms/widgets/BatchHeader.html b/community/lms/widgets/BatchHeader.html new file mode 100644 index 00000000..1658d327 --- /dev/null +++ b/community/lms/widgets/BatchHeader.html @@ -0,0 +1,4 @@ +
+

{{course_name}}

+
{{member_count}} members
+
diff --git a/community/lms/widgets/BatchTabs.html b/community/lms/widgets/BatchTabs.html index 00eed777..42264f55 100644 --- a/community/lms/widgets/BatchTabs.html +++ b/community/lms/widgets/BatchTabs.html @@ -1,28 +1,36 @@ -