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 | from frappe.website.utils import get_comment_list |
| 7 | |
| 8 | def get_context(context): |
| 9 | context.doc = frappe.get_doc('Discussion', frappe.form_dict.discussion) |
| 10 | portal_items = [{'reference_doctype': u'Topic', 'route': u"/topic?course=" + str(context.doc.course), 'show_always': 0L, 'title': u'Topics'}, |
| 11 | {'reference_doctype': u'Discussion', 'route': u"/discussion?course=" + str(context.doc.course), 'show_always': 0L, 'title': u'Discussions'}, |
| 12 | |
| 13 | ] |
| 14 | context.show_sidebar = True |
| 15 | context.sidebar_items = portal_items |
| 16 | context.no_cache = 1 |
| 17 | context.doc.has_permission('read') |
| 18 | context.sidebar_title = context.doc.course |
| 19 | context.reference_doctype = "Discussion" |
| 20 | context.reference_name = context.doc.name |
| 21 | context.comment_list = get_comment_list(context.doc.doctype,context.doc.name) |