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

47 lines
1.1 KiB
Vue
Raw Normal View History

2018-12-17 08:26:27 +00:00
<template>
<div>
2019-02-26 11:19:38 +00:00
<TopSection v-bind:title="course.course_name" v-bind:description="course.description">
2018-12-17 08:26:27 +00:00
</TopSection>
<CardList :title="'Courses'" :description="''" :sectionType="'section-padding section-bg'">
2019-02-26 11:19:38 +00:00
<TopicCard slot="card-list-slot" v-for="topic in topicData" :topic="topic" :course="course.course_name" :program_name="program_name" :key="topic.name"/>
2018-12-17 08:26:27 +00:00
</CardList>
</div>
</template>
<script>
import TopSection from "../components/TopSection.vue"
import CardList from "../components/CardList.vue"
2019-02-26 11:19:38 +00:00
import TopicCard from "../components/TopicCard.vue"
2018-12-17 08:26:27 +00:00
export default {
2019-02-26 11:19:38 +00:00
props: ['program_name','course_name'],
2018-12-17 08:26:27 +00:00
name: "CoursePage",
components: {
TopSection,
CardList,
2019-02-26 11:19:38 +00:00
TopicCard
2018-12-17 08:26:27 +00:00
},
data() {
return {
2019-02-26 11:19:38 +00:00
course: {},
topicData: [],
2018-12-17 08:26:27 +00:00
}
},
mounted() {
2019-02-26 11:19:38 +00:00
this.getCourseDetails().then(data => this.course = data);
this.getTopics().then(data => this.topicData = data);
2018-12-17 08:26:27 +00:00
},
methods: {
2019-02-26 11:19:38 +00:00
getCourseDetails() {
return lms.call('get_course_details', {
course_name: this.course_name
2018-12-17 08:26:27 +00:00
});
},
2019-02-26 11:19:38 +00:00
getTopics() {
return lms.call('get_topics', {
course_name: this.course_name
2018-12-17 08:26:27 +00:00
})
}
}
};
</script>