Merge ERPNext Schools into ERPNext
diff --git a/erpnext/templates/pages/announcements.html b/erpnext/templates/pages/announcements.html
new file mode 100644
index 0000000..d6e0d73
--- /dev/null
+++ b/erpnext/templates/pages/announcements.html
@@ -0,0 +1,20 @@
+{% 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 %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/announcements.py b/erpnext/templates/pages/announcements.py
new file mode 100644
index 0000000..4a61fc8
--- /dev/null
+++ b/erpnext/templates/pages/announcements.py
@@ -0,0 +1,18 @@
+# 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
+
+
diff --git a/erpnext/templates/pages/courses.html b/erpnext/templates/pages/courses.html
new file mode 100644
index 0000000..42e7f3e
--- /dev/null
+++ b/erpnext/templates/pages/courses.html
@@ -0,0 +1,11 @@
+{% extends "templates/web.html" %}
+
+{% block header %}
+	<h1> About </h1>
+{% endblock %}
+
+{% block page_content %}
+
+<p class="post-description"> {{ intro }} </p>
+
+{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/courses.py b/erpnext/templates/pages/courses.py
new file mode 100644
index 0000000..5b1410e
--- /dev/null
+++ b/erpnext/templates/pages/courses.py
@@ -0,0 +1,28 @@
+# 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):
+	course = frappe.get_doc('Course', frappe.form_dict.course)
+	sidebar_title = course.name
+
+	context.no_cache = 1
+	context.show_sidebar = True
+	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
+
diff --git a/erpnext/templates/pages/discussions.html b/erpnext/templates/pages/discussions.html
new file mode 100644
index 0000000..28eb01f
--- /dev/null
+++ b/erpnext/templates/pages/discussions.html
@@ -0,0 +1,15 @@
+{% 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 %}
diff --git a/erpnext/templates/pages/discussions.py b/erpnext/templates/pages/discussions.py
new file mode 100644
index 0000000..22a1bef
--- /dev/null
+++ b/erpnext/templates/pages/discussions.py
@@ -0,0 +1,21 @@
+# 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)
\ No newline at end of file
diff --git a/erpnext/templates/pages/topics.html b/erpnext/templates/pages/topics.html
new file mode 100644
index 0000000..94d7a17
--- /dev/null
+++ b/erpnext/templates/pages/topics.html
@@ -0,0 +1,12 @@
+{% extends "templates/web.html" %}
+
+
+{% block header %}
+	<h2> {{ doc.introduction }} </h1>
+{% endblock %}
+
+{% block page_content %}
+
+<p class="post-description"> {{ doc.content }} </p>
+
+{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/topics.py b/erpnext/templates/pages/topics.py
new file mode 100644
index 0000000..8a55b64
--- /dev/null
+++ b/erpnext/templates/pages/topics.py
@@ -0,0 +1,15 @@
+# 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