Minor Improvements
diff --git a/erpnext/public/js/education/lms/components/CourseCard.vue b/erpnext/public/js/education/lms/components/CourseCard.vue
index 2c589ac..7839aa6 100644
--- a/erpnext/public/js/education/lms/components/CourseCard.vue
+++ b/erpnext/public/js/education/lms/components/CourseCard.vue
@@ -67,7 +67,7 @@
},
isLogin() {
return lms.store.checkLogin()
- },
+ }
},
methods: {
iconClass(content_type) {
diff --git a/erpnext/public/js/education/lms/components/TopSection.vue b/erpnext/public/js/education/lms/components/TopSection.vue
index 03b5f99..107bef0 100644
--- a/erpnext/public/js/education/lms/components/TopSection.vue
+++ b/erpnext/public/js/education/lms/components/TopSection.vue
@@ -1,10 +1,6 @@
<template>
<section class='top-section'>
<div class='container'>
- <div class='text-center'>
- <!-- <img class="main-illustration" src='/assets/erpnext_com/img/erpnext_com_illustration.png'
- style='width: 700px;'> -->
- </div>
<h1 v-html="title"></h1>
<ul class="list-group">
</ul>
diff --git a/erpnext/public/js/education/lms/pages/Home.vue b/erpnext/public/js/education/lms/pages/Home.vue
index b312084..a554312 100644
--- a/erpnext/public/js/education/lms/pages/Home.vue
+++ b/erpnext/public/js/education/lms/pages/Home.vue
@@ -32,21 +32,11 @@
ProgramCard,
TopSectionButton
},
- beforeMount() {
- // this.updateEnrolledPrograms().then(data => {
- // data.forEach(element => {
- // this.enrolledPrograms.add(element)
- // })
- // });
- },
mounted() {
this.getPortalDetails().then(data => this.portal = data);
this.getFeaturedPrograms().then(data => this.featuredPrograms = data);
},
methods: {
- // updateEnrolledPrograms(){
- // return lms.call("get_program_enrollments")
- // },
getPortalDetails() {
return lms.call("get_portal_details")
},
diff --git a/erpnext/public/js/education/lms/pages/ListPage.vue b/erpnext/public/js/education/lms/pages/ListPage.vue
index 3b48a6b..8227383 100644
--- a/erpnext/public/js/education/lms/pages/ListPage.vue
+++ b/erpnext/public/js/education/lms/pages/ListPage.vue
@@ -1,7 +1,7 @@
<template>
<div>
<TopSection :title="portal.title" :description="portal.description">
- <AButton :type="'primary'" :size="'lg'" :route="{ name: 'signup'}">Sign Up</AButton>
+ <AButton v-if="isLogin" :type="'primary'" :size="'lg'" :route="{ name: 'signup'}">Sign Up</AButton>
</TopSection>
<CardList :title="'All Programs'" :description="''">
<ProgramCard slot="card-list-slot" v-for="item in masterData" :key="item.program.name" :program="item.program" :enrolled="item.is_enrolled"/>
@@ -37,15 +37,17 @@
this.getMaster().then(data => this.masterData = data);
},
methods: {
- // updateEnrolledPrograms(){
- // return lms.call("get_program_enrollments")
- // },
getPortalDetails() {
return lms.call("get_portal_details")
},
getMaster() {
return lms.call("get_all_programs")
}
- }
+ },
+ computed: {
+ isLogin() {
+ return !lms.store.checkLogin()
+ }
+ }
};
</script>
\ No newline at end of file
diff --git a/erpnext/www/lms.py b/erpnext/www/lms.py
index 0033557..17afbae 100644
--- a/erpnext/www/lms.py
+++ b/erpnext/www/lms.py
@@ -214,13 +214,21 @@
return {'flag':'Continue', 'content_type': next_item['content_type'], 'content': next_item['content']}
@frappe.whitelist()
-def get_program_meta(program_name):
+def get_program_progress(program_name):
program = frappe.get_doc("Program", program_name)
program_enrollment = frappe.get_list("Program Enrollment", filters={'student': utils.get_current_student(), 'program': program_name })[0].name
+ program_meta = {}
if not program_enrollment:
return None
else:
- program_meta = {}
+ progress = []
for course in program.get_all_children():
- program_meta[course.course] = get_course_meta(course.course, program_name)
+ meta = get_course_meta(course.course, program_name)
+ is_complete = False
+ if meta['flag'] == "Complete":
+ is_complete = True
+ progress.append({'course_name': course.course_name, 'name': course.course, 'is_complete': is_complete})
+ program_meta['progress'] = progress
+ program_meta['name'] = program_name
+ program_meta['program'] = program.program_name
return program_meta
\ No newline at end of file