diff --git a/erpnext/public/build.json b/erpnext/public/build.json index c9b107c5dd6..1abb2fe4562 100644 --- a/erpnext/public/build.json +++ b/erpnext/public/build.json @@ -55,7 +55,7 @@ "stock/dashboard/item_dashboard_list.html", "stock/dashboard/item_dashboard.js" ], - "js/academy.min.js": [ + "js/lms.min.js": [ "public/js/education/lms/lms.js" ] } diff --git a/erpnext/public/js/education/lms/components/Article.vue b/erpnext/public/js/education/lms/components/Article.vue index 7fc1173bc9c..397b22e6db0 100644 --- a/erpnext/public/js/education/lms/components/Article.vue +++ b/erpnext/public/js/education/lms/components/Article.vue @@ -1,8 +1,8 @@ diff --git a/erpnext/public/js/education/lms/components/CardList.vue b/erpnext/public/js/education/lms/components/CardList.vue index 0c03cf6265a..8f6f7c79aea 100644 --- a/erpnext/public/js/education/lms/components/CardList.vue +++ b/erpnext/public/js/education/lms/components/CardList.vue @@ -3,9 +3,9 @@

- +
- View All +
diff --git a/erpnext/public/js/education/lms/components/ProgramCard.vue b/erpnext/public/js/education/lms/components/ProgramCard.vue index 23e7a963816..6bd8532b524 100644 --- a/erpnext/public/js/education/lms/components/ProgramCard.vue +++ b/erpnext/public/js/education/lms/components/ProgramCard.vue @@ -57,7 +57,7 @@ export default { } }, programPageRoute() { - return `Program/${this.program.name}` + return { name: 'program', params: { program_name: this.program.name }} }, isEnrolled() { return lms.store.enrolledPrograms.has(this.program.name) diff --git a/erpnext/public/js/education/lms/components/Video.vue b/erpnext/public/js/education/lms/components/Video.vue index 26d3bf698c6..c13d0dbfd28 100644 --- a/erpnext/public/js/education/lms/components/Video.vue +++ b/erpnext/public/js/education/lms/components/Video.vue @@ -46,15 +46,12 @@ export default { } }, mounted() { - frappe.call({ - method: "erpnext.www.lms.get_content", - args: { - content_name: this.content, - content_type: this.type - } - }).then(r => { - this.contentData = r.message - }); + this.getContent().then(data => this.contentData = data); }, + methods: { + getContent() { + return frappe.db.get_doc(this.type, this.content) + } + } }; diff --git a/erpnext/public/js/education/lms/pages/CoursePage.vue b/erpnext/public/js/education/lms/pages/CoursePage.vue index 477de4696b5..f83857532a4 100644 --- a/erpnext/public/js/education/lms/pages/CoursePage.vue +++ b/erpnext/public/js/education/lms/pages/CoursePage.vue @@ -1,7 +1,7 @@ @@ -9,7 +9,7 @@ import Article from "../components/Article.vue" import Quiz from "../components/Quiz.vue" import Video from "../components/Video.vue" -import Navigation from "../components/Navigation.vue" +import ContentNavigation from "../components/ContentNavigation.vue" export default { props:['program_name', 'course', 'type', 'content'], @@ -50,7 +50,7 @@ export default { Article, Video, Quiz, - Navigation + ContentNavigation } }; diff --git a/erpnext/public/js/education/lms/pages/Home.vue b/erpnext/public/js/education/lms/pages/Home.vue index f823d380e82..b3120845ced 100644 --- a/erpnext/public/js/education/lms/pages/Home.vue +++ b/erpnext/public/js/education/lms/pages/Home.vue @@ -4,11 +4,13 @@ - + + View All \ No newline at end of file diff --git a/erpnext/public/js/education/lms/pages/ProgramPage.vue b/erpnext/public/js/education/lms/pages/ProgramPage.vue index c0d4f155721..bc0f2670c10 100644 --- a/erpnext/public/js/education/lms/pages/ProgramPage.vue +++ b/erpnext/public/js/education/lms/pages/ProgramPage.vue @@ -1,16 +1,13 @@ + {% endblock %} \ No newline at end of file diff --git a/erpnext/www/lms.py b/erpnext/www/lms.py index ab01aed9d9c..bb5daaf02a9 100644 --- a/erpnext/www/lms.py +++ b/erpnext/www/lms.py @@ -28,6 +28,15 @@ def get_featured_programs(): else: return None +@frappe.whitelist(allow_guest=True) +def get_all_programs(): + program_names = frappe.get_all("Program", filters={"is_published": True}) + if program_names: + featured_list = [get_program(program['name']) for program in program_names] + return featured_list + else: + return None + def get_program(program_name): program = frappe.get_doc('Program', program_name) is_enrolled = check_program_enrollment(program_name)