UI: Components rendered based on student progress

This commit is contained in:
scmmishra 2018-11-03 19:33:51 +05:30 committed by Aditya Hase
parent a054655442
commit ed5892c7a5
2 changed files with 5 additions and 4 deletions

View File

@ -10,7 +10,8 @@
</div>
<div class='card-footer text-right'>
<!-- <a class='video-btn btn btn-secondary btn-sm' data-toggle="modal" data-src=" insert jinja stuff here " data-target="#myModal">Watch Intro</a>&nbsp;&nbsp; -->
<a class='btn btn-secondary btn-sm' @click="enroll()">Enroll Now</a>
<a v-if="this.$root.$data.checkProgramEnrollment(program_code)" class='btn btn-secondary btn-sm' @click="$router.push('/Program/' + program.name)">Start Course</a>
<a v-else class='btn btn-secondary btn-sm' @click="enroll()">Enroll Now</a>
</div>
</div>
</div>
@ -37,10 +38,9 @@ export default {
methods: {
enroll() {
frappe.call({
method: "erpnext.www.academy.enroll",
method: "erpnext.www.academy.enroll_in_program",
args:{
type: "Program",
name: this.program_code,
program_name: this.program_code,
student_email_id: frappe.session.user
}
})

View File

@ -30,6 +30,7 @@ export default {
}
},
mounted() {
this.$root.$data.updateCompletedCourses()
frappe.call({
method: "erpnext.www.academy.get_program_details",
args: {