Neil Trini Lasrado | 3f0a581 | 2016-07-19 14:17:33 +0530 | [diff] [blame] | 1 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors |
| 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | from __future__ import unicode_literals |
| 5 | import frappe |
| 6 | |
| 7 | |
| 8 | |
| 9 | def get_context(context): |
| 10 | course = frappe.get_doc('Course', frappe.form_dict.course) |
| 11 | sidebar_title = course.name |
| 12 | |
| 13 | context.no_cache = 1 |
| 14 | context.show_sidebar = True |
| 15 | course = frappe.get_doc('Course', frappe.form_dict.course) |
| 16 | course.has_permission('read') |
| 17 | context.doc = course |
| 18 | portal_items = [{'reference_doctype': u'Topic', 'route': u"/topic?course=" + str(course.name), 'show_always': 0L, 'title': u'Topics'}, |
| 19 | {'reference_doctype': u'Discussion', 'route': u"/discussion?course=" + str(course.name), 'show_always': 0L, 'title': u'Discussions'}, |
| 20 | |
| 21 | ] |
| 22 | |
| 23 | context.sidebar_items = portal_items |
| 24 | |
| 25 | context.sidebar_title = sidebar_title |
| 26 | |
| 27 | context.intro = course.course_intro |
| 28 | |