[cleanup] remove unused LMS (#7612)

This commit is contained in:
Rushabh Mehta 2017-01-30 17:04:38 +05:30 committed by GitHub
parent 455824235a
commit 4500f7b4d6
25 changed files with 2 additions and 1017 deletions

View File

@ -159,23 +159,6 @@ def get_data():
}
]
},
{
"label": _("LMS"),
"items": [
{
"type": "doctype",
"name": "Announcement"
},
{
"type": "doctype",
"name": "Topic"
},
{
"type": "doctype",
"name": "Discussion"
}
]
},
{
"label": _("Setup"),
"items": [

View File

@ -107,7 +107,6 @@ portal_menu_items = [
{"title": _("Shipments"), "route": "/shipments", "reference_doctype": "Delivery Note", "role":"Customer"},
{"title": _("Issues"), "route": "/issues", "reference_doctype": "Issue", "role":"Customer"},
{"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"},
{"title": _("Announcements"), "route": "/announcement", "reference_doctype": "Announcement"},
{"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role":"Student"}
]
@ -122,8 +121,7 @@ has_website_permission = {
"Sales Invoice": "erpnext.controllers.website_list_for_contact.has_website_permission",
"Supplier Quotation": "erpnext.controllers.website_list_for_contact.has_website_permission",
"Delivery Note": "erpnext.controllers.website_list_for_contact.has_website_permission",
"Issue": "erpnext.support.doctype.issue.issue.has_website_permission",
"Discussion": "erpnext.schools.web_form.discussion.discussion.has_website_permission"
"Issue": "erpnext.support.doctype.issue.issue.has_website_permission"
}
dump_report_map = "erpnext.startup.report_data_map.data_map"

View File

@ -8,7 +8,7 @@ from erpnext.setup.setup_wizard import domainify
def execute():
frappe.reload_doctype('Role')
for dt in ("assessment", "announcement", "course", "fees"):
for dt in ("assessment", "course", "fees"):
frappe.reload_doc("schools", "doctype", dt)
frappe.reload_doc('website', 'doctype', 'portal_menu_item')

View File

@ -1,9 +0,0 @@
// Copyright (c) 2016, Frappe and contributors
// For license information, please see license.txt
frappe.ui.form.on('Announcement', {
onload: function(frm) {
frm.add_fetch('instructor', 'instructor_name' , 'posted_by');
}
});

View File

@ -1,315 +0,0 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "announcement.#####",
"beta": 0,
"creation": "2016-06-23 05:37:33.996289",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"default": "",
"fieldname": "receiver",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Receiver",
"length": 0,
"no_copy": 0,
"options": "Student\nStudent Group\nAll Students",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "instructor",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Instructor",
"length": 0,
"no_copy": 0,
"options": "Instructor",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval: doc.receiver == \"Student\"",
"fieldname": "student",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Student",
"length": 0,
"no_copy": 0,
"options": "Student",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval: doc.receiver == \"Student Group\"",
"fieldname": "student_group",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Student Group",
"length": 0,
"no_copy": 0,
"options": "Student Group",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "posted_by",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Posted By",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "section_break_5",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "subject",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Subject",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "description",
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
"length": 0,
"no_copy": 1,
"options": "Announcement",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-07-21 06:30:12.825629",
"modified_by": "r@r.com",
"module": "Schools",
"name": "Announcement",
"name_case": "",
"owner": "demo@erpnext.com",
"permissions": [
{
"amend": 1,
"apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Academics User",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "subject",
"track_seen": 1
}

View File

@ -1,75 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class Announcement(Document):
def validate(self):
self.validate_receiver()
self.set_posted_by()
def validate_receiver(self):
if self.receiver == "Student":
if not self.student:
frappe.throw(_("Please select a Student"))
self.student_group = None
elif self.receiver == "Student Group":
if not self.student_group:
frappe.throw(_("Please select a Student Group"))
self.student = None
else:
self.student_group = None
self.student = None
def set_posted_by(self):
if self.instructor:
self.posted_by = frappe.db.get_value("Instructor", self.instructor, "instructor_name")
else:
self.posted_by = frappe.session.user
def get_message_list(doctype, txt, filters, limit_start, limit_page_length=20):
user = frappe.session.user
student = frappe.db.sql("select name from `tabStudent` where student_email_id= %s", user)
if student:
sg_list = frappe.db.sql("""select parent from `tabStudent Group Student` as sgs
where sgs.student = %s """,(student))
data = frappe.db.sql("""select name, receiver, subject, description, posted_by, modified,
student, student_group
from `tabAnnouncement` as announce
where (announce.receiver = "Student" and announce.student = %s)
or (announce.receiver = "Student Group" and announce.student_group in %s)
or announce.receiver = "All Students"
and announce.docstatus = 1
order by announce.idx asc limit {0} , {1}"""
.format(limit_start, limit_page_length), (student,sg_list), as_dict = True)
for announcement in data:
try:
num_attachments = frappe.db.sql(""" select count(file_url) from tabFile as file
where file.attached_to_name=%s
and file.attached_to_doctype=%s""",(announcement.name,"Announcement"))
except IOError or frappe.DoesNotExistError:
pass
frappe.local.message_log.pop()
announcement.num_attachments = num_attachments[0][0]
return data
def get_list_context(context=None):
return {
"show_sidebar": True,
'no_breadcrumbs': True,
"title": _("Announcements"),
"get_list": get_message_list,
"row_template": "templates/includes/announcement/announcement_row.html"
}

View File

@ -1,12 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Announcement')
class TestAnnouncement(unittest.TestCase):
pass

View File

@ -1,8 +0,0 @@
// Copyright (c) 2016, Frappe and contributors
// For license information, please see license.txt
frappe.ui.form.on('Discussion', {
refresh: function(frm) {
}
});

View File

@ -1,175 +0,0 @@
{
"allow_copy": 0,
"allow_import": 1,
"allow_rename": 0,
"autoname": "Discussion.####",
"beta": 0,
"creation": "2016-06-13 07:57:38.326925",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 0,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "subject",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Subject",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "course",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Course",
"length": 0,
"no_copy": 0,
"options": "Course",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "description",
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Amended From",
"length": 0,
"no_copy": 1,
"options": "Discussion",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-11-07 05:28:34.032169",
"modified_by": "Administrator",
"module": "Schools",
"name": "Discussion",
"name_case": "",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Academics User",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"write": 1
}
],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "subject",
"track_seen": 1
}

View File

@ -1,37 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
class Discussion(Document):
def validate(self):
if not self.owner== frappe.session.user:
frappe.throw(_("Not Permitted"))
def get_discussions(doctype, txt, filters, limit_start, limit_page_length=20):
from frappe.www.list import get_list
if not filters:
filters = []
filters.append(("Discussion", "course", "=", frappe.form_dict.course))
return get_list(doctype, txt, filters, limit_start, limit_page_length, ignore_permissions=True)
def get_list_context(context=None):
course_name = frappe.form_dict.course
portal_items = [{'reference_doctype': u'Topic', 'route': u"/topic?course=" + str(course_name), 'show_always': 0L, 'title': u'Topics'},
{'reference_doctype': u'Discussion', 'route': u"/discussion?course=" + str(course_name), 'show_always': 0L, 'title': u'Discussions'},
]
sidebar_title = course_name
return {
"show_sidebar": True,
'no_breadcrumbs': True,
"get_list" : get_discussions,
"title": _("Discussions"),
"sidebar_items" : portal_items,
"sidebar_title" : sidebar_title,
"row_template": "templates/includes/discussion/discussion_row.html"
}

View File

@ -1,12 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Discussion')
class TestDiscussion(unittest.TestCase):
pass

View File

@ -1,12 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Topic')
class TestTopic(unittest.TestCase):
pass

View File

@ -1,8 +0,0 @@
// Copyright (c) 2016, Frappe and contributors
// For license information, please see license.txt
frappe.ui.form.on('Topic', {
refresh: function(frm) {
}
});

View File

@ -1,175 +0,0 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 1,
"autoname": "Topic.####",
"beta": 0,
"creation": "2016-06-28 07:06:38.749398",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"editable_grid": 0,
"engine": "InnoDB",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "course",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Course",
"length": 0,
"no_copy": 0,
"options": "Course",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "topic_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Topic Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "introduction",
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Introduction",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "content",
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Content",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-11-07 05:29:20.531725",
"modified_by": "Administrator",
"module": "Schools",
"name": "Topic",
"name_case": "",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Academics User",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
}
],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "course",
"track_seen": 0
}

View File

@ -1,49 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class Topic(Document):
pass
def get_topic_list(doctype, txt, filters, limit_start, limit_page_length=20):
user = frappe.session.user
student = frappe.db.sql("select name from `tabStudent` where student_email_id= %s", user)
if student:
data = frappe. db.sql('''select name, course, modified,topic_name, introduction, content from `tabTopic` as topic
where topic.course = %s
order by idx asc limit {0} , {1}'''.format(limit_start, limit_page_length),filters.course,as_dict = True)
for topic in data:
try:
num_attachments = frappe.db.sql(""" select count(file_url) from tabFile as file
where file.attached_to_name=%s
and file.attached_to_doctype=%s""",(topic.name,"Topic"))
except IOError or frappe.DoesNotExistError:
pass
frappe.local.message_log.pop()
topic.num_attachments = num_attachments[0][0]
return data
def get_list_context(context=None):
course = frappe.get_doc('Course', frappe.form_dict.course)
portal_items = [{'reference_doctype': u'Topic', 'route': u"/topic?course=" + str(course.name), 'show_always': 0L, 'title': u'Topics'},
{'reference_doctype': u'Discussion', 'route': u"/discussion?course=" + str(course.name), 'show_always': 0L, 'title': u'Discussions'},
]
return {
"show_sidebar": True,
"title": _("Topic"),
'no_breadcrumbs': True,
"sidebar_items" : portal_items,
"sidebar_title" : course.name,
"get_list": get_topic_list,
"row_template": "templates/includes/topic/topic_row.html"
}

View File

@ -1,20 +0,0 @@
{% extends "templates/web.html" %}
{% block header %}
<h1> {{doc.subject}} </h1>
{% endblock %}
{% block page_content %}
<p class="post-description"> {{doc.description}} </p>
<p class="post-by text-muted small">
{% for file in attached_files%}
<a href="{{file.file_url}}" target="_new">{{file.file_name}}</a>
<br>
{% endfor %}
<br>
<i>{{ doc.posted_by }}</i>
<i class="blog-dot"></i> {{ frappe.format_date(doc.modified) }}
</p>
{% endblock %}

View File

@ -1,18 +0,0 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def get_context(context):
announcement = frappe.get_doc('Announcement', frappe.form_dict.announcement)
context.no_cache = 1
context.show_sidebar = True
announcement.has_permission('read')
context.doc = announcement
attachments = frappe.db.sql("""select file_url, file_name from tabFile as file
where file.attached_to_name=%s """,(announcement.name), as_dict = True)
context.attached_files = attachments

View File

@ -15,14 +15,6 @@ def get_context(context):
course = frappe.get_doc('Course', frappe.form_dict.course)
course.has_permission('read')
context.doc = course
portal_items = [{'reference_doctype': u'Topic', 'route': u"/topic?course=" + str(course.name), 'show_always': 0L, 'title': u'Topics'},
{'reference_doctype': u'Discussion', 'route': u"/discussion?course=" + str(course.name), 'show_always': 0L, 'title': u'Discussions'},
]
context.sidebar_items = portal_items
context.sidebar_title = sidebar_title
context.intro = course.course_intro

View File

@ -1,15 +0,0 @@
{% extends "templates/web.html" %}
{% block header %}
<h2> {{doc.subject}} </h2>
<p> {{doc.description}} </p>
<p class="text-muted small">Started by: {{doc.owner}} </p>
{% endblock %}
{% block page_content %}
<div>
{% include 'templates/includes/comments/comments.html' %}
</div>
{% endblock %}

View File

@ -1,21 +0,0 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.utils import get_comment_list
def get_context(context):
context.doc = frappe.get_doc('Discussion', frappe.form_dict.discussion)
portal_items = [{'reference_doctype': u'Topic', 'route': u"/topic?course=" + str(context.doc.course), 'show_always': 0L, 'title': u'Topics'},
{'reference_doctype': u'Discussion', 'route': u"/discussion?course=" + str(context.doc.course), 'show_always': 0L, 'title': u'Discussions'},
]
context.show_sidebar = True
context.sidebar_items = portal_items
context.no_cache = 1
context.doc.has_permission('read')
context.sidebar_title = context.doc.course
context.reference_doctype = "Discussion"
context.reference_name = context.doc.name
context.comment_list = get_comment_list(context.doc.doctype,context.doc.name)

View File

@ -1,12 +0,0 @@
{% extends "templates/web.html" %}
{% block header %}
<h2> {{ doc.introduction }} </h1>
{% endblock %}
{% block page_content %}
<p class="post-description"> {{ doc.content }} </p>
{% endblock %}

View File

@ -1,15 +0,0 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def get_context(context):
topic = frappe.get_doc('Topic', frappe.form_dict.topic)
context.no_cache = 1
context.show_sidebar = True
context.doc = topic
attachments = frappe.db.sql("""select file_url, file_name from tabFile as file
where file.attached_to_name=%s """,(topic.name), as_dict = True)
context.attached_files = attachments