brotherton-erpnext/erpnext/public/js/education/web-academy/pages/AcademyProgramPage.vue

52 lines
1.4 KiB
Vue
Raw Normal View History

2018-10-30 12:55:49 +00:00
<template>
<div>
2018-11-03 12:33:01 +00:00
<AcademyTopSection v-bind:title="program.program_name" v-bind:description="program.description">
<AcademyTopSectionButton/>
</AcademyTopSection>
2018-11-01 11:49:21 +00:00
<AcademyList :title="'Courses'" :description="''">
<AcademyCourseCard v-for="course in course_list" :course="course" :key="course.name"/>
</AcademyList>
2018-10-30 12:55:49 +00:00
</div>
</template>
<script>
2018-11-01 11:49:21 +00:00
import AcademyTopSection from "../components/AcademyTopSection.vue"
import AcademyList from "../components/AcademyList.vue"
import AcademyCourseCard from "../components/AcademyCourseCard.vue"
2018-11-03 12:33:01 +00:00
import AcademyTopSectionButton from "../components/AcademyTopSectionButton.vue"
2018-11-01 11:49:21 +00:00
2018-10-30 12:55:49 +00:00
export default {
props: ['code'],
name: "AcademyProgramPage",
2018-11-01 11:49:21 +00:00
components: {
AcademyTopSection,
AcademyList,
2018-11-03 12:33:01 +00:00
AcademyCourseCard,
AcademyTopSectionButton
2018-11-01 11:49:21 +00:00
},
data() {
return {
program: '',
course_list: []
}
},
mounted() {
2018-11-05 05:31:37 +00:00
if(this.$root.$data.isLogin) this.$root.$data.updateCompletedCourses()
2018-11-01 11:49:21 +00:00
frappe.call({
method: "erpnext.www.academy.get_program_details",
args: {
program_name: this.code
}
}).then(r => {
this.program = r.message
});
frappe.call({
method: "erpnext.www.academy.get_courses",
args: {
program_name: this.code
}
}).then(r => {
this.course_list = r.message
})
},
2018-10-30 12:55:49 +00:00
};
</script>