diff --git a/erpnext/education/doctype/education_settings/education_settings.json b/erpnext/education/doctype/education_settings/education_settings.json index dd5376fe74..83cc0b0b87 100644 --- a/erpnext/education/doctype/education_settings/education_settings.json +++ b/erpnext/education/doctype/education_settings/education_settings.json @@ -414,7 +414,7 @@ "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2018-10-25 18:55:25.257146", + "modified": "2018-10-30 17:33:56.143330", "modified_by": "Administrator", "module": "Education", "name": "Education Settings", @@ -458,6 +458,25 @@ "share": 1, "submit": 0, "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Guest", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 0 } ], "quick_entry": 1, diff --git a/erpnext/education/doctype/program/program.json b/erpnext/education/doctype/program/program.json index 5dd364700a..6339d6e007 100644 --- a/erpnext/education/doctype/program/program.json +++ b/erpnext/education/doctype/program/program.json @@ -476,7 +476,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-10-16 13:03:22.002322", + "modified": "2018-10-30 17:30:55.381657", "modified_by": "Administrator", "module": "Education", "name": "Program", @@ -501,6 +501,25 @@ "share": 1, "submit": 0, "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Guest", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 0 } ], "quick_entry": 0, diff --git a/erpnext/public/build.json b/erpnext/public/build.json index c34eef2508..824b9b8283 100644 --- a/erpnext/public/build.json +++ b/erpnext/public/build.json @@ -54,5 +54,8 @@ "stock/dashboard/item_dashboard.html", "stock/dashboard/item_dashboard_list.html", "stock/dashboard/item_dashboard.js" + ], + "js/web-academy.min.js": [ + "public/js/education/web-academy.js" ] } diff --git a/erpnext/public/js/education/web-academy.js b/erpnext/public/js/education/web-academy.js new file mode 100644 index 0000000000..1bf325b7e9 --- /dev/null +++ b/erpnext/public/js/education/web-academy.js @@ -0,0 +1,27 @@ +import Vue from 'vue/dist/vue.js'; +import VueRouter from 'vue-router/dist/vue-router.js' +import AcademyRoot from "./web-academy/AcademyRoot.vue"; +import AcademyHome from "./web-academy/pages/AcademyHome.vue"; +import AcademyProgramPage from "./web-academy/pages/AcademyProgramPage.vue"; +import AcademyCoursePage from "./web-academy/pages/AcademyCoursePage.vue"; + +Vue.use(VueRouter) + +const routes = [ + {path: '', component: AcademyHome}, + {path: '/Program/:code', component: AcademyProgramPage, props: true}, + {path: '/Course', component: AcademyCoursePage}, +]; + +const router = new VueRouter({ + routes: routes, +}); + +frappe.ready(() => { + new Vue({ + el: "#web-academy", + router: router, + template: "", + components: { AcademyRoot } + }); +}) \ No newline at end of file diff --git a/erpnext/public/js/education/web-academy/AcademyRoot.vue b/erpnext/public/js/education/web-academy/AcademyRoot.vue new file mode 100644 index 0000000000..e5edfb6a5f --- /dev/null +++ b/erpnext/public/js/education/web-academy/AcademyRoot.vue @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git a/erpnext/public/js/education/web-academy/components/AcademyCardList.vue b/erpnext/public/js/education/web-academy/components/AcademyCardList.vue new file mode 100644 index 0000000000..16e1924727 --- /dev/null +++ b/erpnext/public/js/education/web-academy/components/AcademyCardList.vue @@ -0,0 +1,31 @@ + + \ No newline at end of file diff --git a/erpnext/public/js/education/web-academy/components/AcademyProgramCard.vue b/erpnext/public/js/education/web-academy/components/AcademyProgramCard.vue new file mode 100644 index 0000000000..3228421025 --- /dev/null +++ b/erpnext/public/js/education/web-academy/components/AcademyProgramCard.vue @@ -0,0 +1,38 @@ + + \ No newline at end of file diff --git a/erpnext/public/js/education/web-academy/components/AcademyTopSection.vue b/erpnext/public/js/education/web-academy/components/AcademyTopSection.vue new file mode 100644 index 0000000000..0c1f5a602d --- /dev/null +++ b/erpnext/public/js/education/web-academy/components/AcademyTopSection.vue @@ -0,0 +1,34 @@ + + \ No newline at end of file diff --git a/erpnext/public/js/education/web-academy/pages/AcademyCoursePage.vue b/erpnext/public/js/education/web-academy/pages/AcademyCoursePage.vue new file mode 100644 index 0000000000..c57076b599 --- /dev/null +++ b/erpnext/public/js/education/web-academy/pages/AcademyCoursePage.vue @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git a/erpnext/public/js/education/web-academy/pages/AcademyHome.vue b/erpnext/public/js/education/web-academy/pages/AcademyHome.vue new file mode 100644 index 0000000000..0a57ef2c3d --- /dev/null +++ b/erpnext/public/js/education/web-academy/pages/AcademyHome.vue @@ -0,0 +1,17 @@ + + \ No newline at end of file diff --git a/erpnext/public/js/education/web-academy/pages/AcademyProgramPage.vue b/erpnext/public/js/education/web-academy/pages/AcademyProgramPage.vue new file mode 100644 index 0000000000..813e012ae2 --- /dev/null +++ b/erpnext/public/js/education/web-academy/pages/AcademyProgramPage.vue @@ -0,0 +1,14 @@ + + \ No newline at end of file diff --git a/erpnext/www/academy.html b/erpnext/www/academy.html new file mode 100644 index 0000000000..cba19640b1 --- /dev/null +++ b/erpnext/www/academy.html @@ -0,0 +1,8 @@ +{% extends "frappe_theme/templates/web.html" %} + +{% block title %}{{ heading or "Academy"}}{% endblock %} + +{% block page_content %} +
+ +{% endblock %} \ No newline at end of file diff --git a/erpnext/www/academy.py b/erpnext/www/academy.py new file mode 100644 index 0000000000..43ed2592a0 --- /dev/null +++ b/erpnext/www/academy.py @@ -0,0 +1,27 @@ +from __future__ import unicode_literals +import frappe +import erpnext.education.utils as utils + +@frappe.whitelist() +def get_portal_details(): + settings = frappe.get_doc("Education Settings") + title = settings.portal_title + description = settings.description + return dict(title=title, description=description) + +@frappe.whitelist() +def get_featured_programs(): + featured_program_names = frappe.get_list("Program", filters={"is_published": True, "is_featured": True}) + featured_list = [program["name"] for program in featured_program_names] + if featured_list: + return featured_list + else: + return None + +@frappe.whitelist() +def get_program_details(program_name): + try: + program = frappe.get_doc('Program', program_name) + return program + except: + return None diff --git a/erpnext/www/web-academy.html b/erpnext/www/web-academy.html deleted file mode 100644 index 9fa5a25bf3..0000000000 --- a/erpnext/www/web-academy.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "templates/web.html" %} - -{% block title %}{{ heading or "Web Academy"}}{% endblock %} - -{% block page_content %} - -
- - -{% endblock %} \ No newline at end of file