feat: added a page to list cohorts of a course
- added a page /courses/<course>/manage that lists the active cohorts - only accessible to mentors and staff - also added a "manage the course" button on course page for mentors/staff Issue #271
This commit is contained in:
17
school/www/cohorts/utils.py
Normal file
17
school/www/cohorts/utils.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import frappe
|
||||
|
||||
def get_course(course_name=None):
|
||||
course_name = course_name or frappe.form_dict["course"]
|
||||
return course_name and get_doc("LMS Course", course_name)
|
||||
|
||||
def get_doc(doctype, name):
|
||||
try:
|
||||
return frappe.get_doc(doctype, name)
|
||||
except frappe.exceptions.DoesNotExistError:
|
||||
return
|
||||
|
||||
def add_nav(context, title, href):
|
||||
"""Adds a breadcrumb to the navigation.
|
||||
"""
|
||||
nav = context.setdefault("nav", [])
|
||||
nav.append({"title": title, "href": href})
|
||||
Reference in New Issue
Block a user