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

52 lines
1.2 KiB
Vue
Raw Normal View History

2018-10-30 12:55:49 +00:00
<template>
<div>
2018-11-01 11:49:21 +00:00
<AcademyTopSection v-bind:title="program.program_name" v-bind:description="program.description"/>
<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-10-30 12:55:49 +00:00
export default {
props: ['code'],
name: "AcademyProgramPage",
2018-11-01 11:49:21 +00:00
components: {
AcademyTopSection,
AcademyList,
AcademyCourseCard
},
data() {
return {
program: '',
course_list: []
}
},
mounted() {
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
})
},
watch: {
'$route' (to, from) {
// react to route changes...
}
}
2018-10-30 12:55:49 +00:00
};
</script>