blob: 22a1bef079612d7d8f1373c0b7b0be83992e05f8 [file] [log] [blame]
Neil Trini Lasrado3f0a5812016-07-19 14:17:33 +05301# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
2# License: GNU General Public License v3. See license.txt
3
4from __future__ import unicode_literals
5import frappe
6from frappe.website.utils import get_comment_list
7
8def 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)