From 295585186760925a136b77fc51c428dc4f66136a Mon Sep 17 00:00:00 2001 From: scmmishra Date: Mon, 26 Nov 2018 19:16:54 +0530 Subject: [PATCH] Built Student Profile Page --- .../education/lms/components/ProfileInfo.vue | 89 +++++++++++++++++++ .../education/lms/components/ProgressCard.vue | 31 ++++++- erpnext/public/js/education/lms/lms.js | 3 + .../js/education/lms/pages/ProfilePage.vue | 61 +------------ erpnext/www/lms.py | 9 +- 5 files changed, 131 insertions(+), 62 deletions(-) create mode 100644 erpnext/public/js/education/lms/components/ProfileInfo.vue diff --git a/erpnext/public/js/education/lms/components/ProfileInfo.vue b/erpnext/public/js/education/lms/components/ProfileInfo.vue new file mode 100644 index 00000000000..a6118a0ccc5 --- /dev/null +++ b/erpnext/public/js/education/lms/components/ProfileInfo.vue @@ -0,0 +1,89 @@ + + + \ No newline at end of file diff --git a/erpnext/public/js/education/lms/components/ProgressCard.vue b/erpnext/public/js/education/lms/components/ProgressCard.vue index 9666ab4ea5b..ad38de9a4be 100644 --- a/erpnext/public/js/education/lms/components/ProgressCard.vue +++ b/erpnext/public/js/education/lms/components/ProgressCard.vue @@ -20,12 +20,11 @@
- Download Certificate + {{ buttonName }}
@@ -53,6 +52,30 @@ export default { }) }, }, + computed: { + programRoute() { + return {name: 'program', params: {program_name: this.program}} + }, + buttonType() { + if (this.programData.percentage == 100 ){ + return "success" + } + else if (this.programData.percentage == "0" ) { + return "secondary" + } + else { + return "info" + } + }, + buttonName() { + if (this.programData.percentage == 100 ){ + return "Program Complete" + } + else { + return `${this.programData.percentage}% Completed` + } + } + }, components: { AButton }, diff --git a/erpnext/public/js/education/lms/lms.js b/erpnext/public/js/education/lms/lms.js index d45b4effb18..3d2bd50dcd7 100644 --- a/erpnext/public/js/education/lms/lms.js +++ b/erpnext/public/js/education/lms/lms.js @@ -1,5 +1,6 @@ import Vue from 'vue/dist/vue.js'; import VueRouter from 'vue-router/dist/vue-router.js' +import moment from 'moment/min/moment.min.js' import lmsRoot from "./lmsRoot.vue"; import routes from './routes'; @@ -17,6 +18,8 @@ frappe.ready(() => { frappe.provide('lms') // frappe.utils.make_event_emitter(lms); + lms.moment = moment + lms.store = new Vue({ data: store, methods: { diff --git a/erpnext/public/js/education/lms/pages/ProfilePage.vue b/erpnext/public/js/education/lms/pages/ProfilePage.vue index 59d5aaa465e..6d303c78377 100644 --- a/erpnext/public/js/education/lms/pages/ProfilePage.vue +++ b/erpnext/public/js/education/lms/pages/ProfilePage.vue @@ -1,45 +1,6 @@