brotherton-erpnext/erpnext/public/js/education/lms/pages/ProgramPage.vue

49 lines
1.2 KiB
Vue
Raw Normal View History

2018-11-09 06:17:09 +00:00
<template>
<div>
2019-04-08 14:26:21 +00:00
<breadcrumb></breadcrumb>
2018-11-13 11:54:07 +00:00
<TopSection v-bind:title="program.program_name" v-bind:description="program.description">
</TopSection>
2019-03-31 14:16:39 +00:00
<CardList :title="'Courses'" :description="''" :sectionType="'section-padding'">
2018-11-22 10:03:30 +00:00
<CourseCard slot="card-list-slot" v-for="course in courseData" :course="course" :program_name="program_name" :key="course.name"/>
2018-11-13 11:54:07 +00:00
</CardList>
2018-11-09 06:17:09 +00:00
</div>
</template>
<script>
2018-11-13 11:54:07 +00:00
import TopSection from "../components/TopSection.vue"
import CardList from "../components/CardList.vue"
import CourseCard from "../components/CourseCard.vue"
2019-04-08 14:26:21 +00:00
import Breadcrumb from "../components/Breadcrumb.vue"
2018-11-09 06:17:09 +00:00
export default {
props: ['program_name'],
2018-11-13 11:33:18 +00:00
name: "ProgramPage",
2018-11-09 06:17:09 +00:00
components: {
2018-11-13 11:54:07 +00:00
TopSection,
CardList,
2019-04-08 14:26:21 +00:00
CourseCard,
Breadcrumb
2018-11-09 06:17:09 +00:00
},
data() {
return {
program: {},
2018-11-22 10:03:30 +00:00
courseData: [],
2018-11-09 06:17:09 +00:00
}
},
mounted() {
this.getProgramDetails().then(data => this.program = data);
2018-11-22 10:03:30 +00:00
this.getCourses().then(data => this.courseData = data);
2018-11-09 06:17:09 +00:00
},
methods: {
getProgramDetails() {
return lms.call('get_program', {
2018-11-09 06:17:09 +00:00
program_name: this.program_name
});
},
getCourses() {
2018-11-13 11:17:46 +00:00
return lms.call('get_courses', {
2018-11-09 06:17:09 +00:00
program_name: this.program_name
})
}
}
};
</script>