diff --git a/erpnext/www/lms/course.html b/erpnext/www/lms/course.html new file mode 100644 index 00000000000..2e414a03695 --- /dev/null +++ b/erpnext/www/lms/course.html @@ -0,0 +1,77 @@ +{% extends "templates/base.html" %} +{% block title %}{{ course.course_name }}{% endblock %} + +{% block head_include %} + +{% endblock %} + + +{% macro card(topic, index, length) %} +
+
+ + {% if topic.hero_image %} +
+ {% else %} +
+
{{ topic.topic_name }}
+
+ {% endif %} +
+ +
+
+{% endmacro %} + +{% block content %} +
+
+

{{ course.course_name }}

+

{{ course.course_intro }}

+

+ Sign Up +

+
+
+
+ {% for topic in topics %} + {{ card(topic.as_dict(), loop.index, topics|length) }} + {% endfor %} +
+
+
+{% endblock %} \ No newline at end of file diff --git a/erpnext/www/lms/course.py b/erpnext/www/lms/course.py new file mode 100644 index 00000000000..d8670e69776 --- /dev/null +++ b/erpnext/www/lms/course.py @@ -0,0 +1,11 @@ +from __future__ import unicode_literals +import erpnext.education.utils as utils +import frappe + +no_cache = 1 + +def get_context(context): + context.education_settings = frappe.get_single("Education Settings") + course = frappe.get_doc('Course', frappe.form_dict['name']) + context.course = course + context.topics = course.get_topics() \ No newline at end of file diff --git a/erpnext/www/lms/program.html b/erpnext/www/lms/program.html index 60104e72d1f..35f7f8a69c0 100644 --- a/erpnext/www/lms/program.html +++ b/erpnext/www/lms/program.html @@ -31,23 +31,20 @@ {% endblock %} -{% macro card(program, is_enrolled) %} -
-
- - {% if program.hero_image %} -
+{% macro card(course, index, length) %} +
- {% for program in all_programs %} - {{ card(program.program, program.is_enrolled) }} + {% for course in program.courses %} + {{ card(frappe.get_doc("Course", course.course), loop.index, program.courses|length) }} {% endfor %}