Merge ERPNext Schools into ERPNext
diff --git a/erpnext/templates/includes/announcement/announcement_row.html b/erpnext/templates/includes/announcement/announcement_row.html
new file mode 100644
index 0000000..d807bfc
--- /dev/null
+++ b/erpnext/templates/includes/announcement/announcement_row.html
@@ -0,0 +1,34 @@
+<div class="web-list-item blog-list-item">
+	<a href="/announcements?announcement={{doc.name}}">
+		<div class="row">
+			<a href="/announcements?announcement={{doc.name}}">
+				<div class="col-xs-12">
+					<h1 class="blog-header">{{ doc.subject }}</h1>
+					<p class="post-description more">{{ doc.description }}</p>
+					<p class="post-by text-muted small">
+						<i>{{ doc.posted_by }}</i>
+						<i class="blog-dot"></i> {{ frappe.format_date(doc.modified) }}
+						<i class="blog-dot"></i> {{ doc.num_attachments }} attachments
+					</p>
+				</div>
+			</a>
+		</div>
+	</a>
+</div>
+
+<script type="text/javascript">
+	frappe.ready(function() {
+		var show_char = 150;
+		$('.more').each(function() {
+			var content = $(this).text();
+			if(content.length > show_char) {
+
+				var c = content.substr(0, show_char)
+				var h = content.substr(show_char, content.length - show_char);
+
+				html = c + '&nbsp;&nbsp;...'
+				$(this).html(html);
+			}
+		});
+	});
+</script>
diff --git a/erpnext/templates/includes/course/course_row.html b/erpnext/templates/includes/course/course_row.html
new file mode 100644
index 0000000..9b9317b
--- /dev/null
+++ b/erpnext/templates/includes/course/course_row.html
@@ -0,0 +1,18 @@
+<div class="web-list-item">
+	<a href="/courses?course={{ doc.course }}">
+		<div class="row">
+			<div class="col-xs-5">
+				{{ doc.course }}
+			</div>
+			<div class="col-xs-3">
+				{{ doc.group_name }}
+			</div>
+			<div class="col-xs-2">
+				{{doc.academic_term }}
+			</div>
+			<div class="col-xs-2">
+				{{ doc.academic_year }}
+			</div>
+		</div>
+	</a>
+</div>
diff --git a/erpnext/templates/includes/course/macros.html b/erpnext/templates/includes/course/macros.html
new file mode 100644
index 0000000..c80dca4
--- /dev/null
+++ b/erpnext/templates/includes/course/macros.html
@@ -0,0 +1 @@
+{% macro back_link(doc) %}&back-to=/courses?course={{ doc.name }}&back-to-title={{ doc.course_name }}{% endmacro %}
\ No newline at end of file
diff --git a/erpnext/templates/includes/discussion/discussion_row.html b/erpnext/templates/includes/discussion/discussion_row.html
new file mode 100644
index 0000000..7bec3cc
--- /dev/null
+++ b/erpnext/templates/includes/discussion/discussion_row.html
@@ -0,0 +1,9 @@
+<div class="web-list-item">
+	<div class="row">
+		<a href="/discussions?discussion={{doc.name}}">
+			<div class="col-xs-12">
+				{{ doc.subject }}
+			</div>
+		</a>
+	</div>
+</div>
diff --git a/erpnext/templates/includes/examination/examination_row.html b/erpnext/templates/includes/examination/examination_row.html
new file mode 100644
index 0000000..a33ccff
--- /dev/null
+++ b/erpnext/templates/includes/examination/examination_row.html
@@ -0,0 +1,19 @@
+<div class="web-list-item">
+	<div class="row">
+		<div class="col-xs-4">
+			{{ doc.course }}
+		</div>
+		<div class="col-xs-2">
+			{{ doc.room }}
+		</div>
+		<div class="col-xs-2">
+			{{doc.schedule_date }}
+		</div>
+		<div class="col-xs-2">
+			{{ doc.from_time }}
+		</div>
+		<div class="col-xs-2">
+			{{ doc.to_time }}
+		</div>
+	</div>
+</div>
diff --git a/erpnext/templates/includes/fee/fee_row.html b/erpnext/templates/includes/fee/fee_row.html
new file mode 100644
index 0000000..ac2b100
--- /dev/null
+++ b/erpnext/templates/includes/fee/fee_row.html
@@ -0,0 +1,18 @@
+<div class="web-list-item">
+	<a href = "/fees/{{doc.name}}/">
+		<div class="row">
+			<div class="col-xs-6">
+				{{ doc.program }}
+			</div>
+			<div class="col-xs-2">
+				{{ doc.get_formatted("total_amount") }}
+			</div>
+			<div class="col-xs-2">
+				{{ doc.get_formatted("paid_amount") }}
+			</div>
+			<div class="col-xs-2">
+				{{ doc.get_formatted("outstanding_amount") }}
+			</div>
+		</div>
+	</a>
+</div>
diff --git a/erpnext/templates/includes/topic/topic_row.html b/erpnext/templates/includes/topic/topic_row.html
new file mode 100644
index 0000000..3401bd3
--- /dev/null
+++ b/erpnext/templates/includes/topic/topic_row.html
@@ -0,0 +1,9 @@
+<div class="web-list-item">	
+	<div class="row">
+		<a href = "/topics?topic={{ doc.name }}">
+			<div class="col-xs-12">
+				{{ doc.topic_name }}
+			</div>
+		</a>
+	</div>
+</div>
\ No newline at end of file
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