feat: learning modes

This commit is contained in:
pateljannat
2021-06-18 18:31:10 +05:30
parent dc7eabefb9
commit eb435261fe
19 changed files with 115 additions and 72 deletions

View File

@@ -11,11 +11,16 @@ def get_common_context(context):
context.template = "www/404.html"
return
batch_name = course.get_current_batch(frappe.session.user)
batch = course.get_batch(batch_name)
context.batch = batch
if batch_name:
context.members = batch.get_mentors() + batch.get_students()
membership = course.get_current_membership(frappe.session.user)
if membership:
context.membership = membership
batch = course.get_batch(membership.batch)
if batch:
context.batch = batch
context.members = course.get_mentors(membership.batch) + course.get_students(membership.batch)
context.member_count = len(context.members)