55 lines
1.7 KiB
Vue
Raw Normal View History

2018-10-30 18:25:49 +05:30
<template>
<div>
2018-11-09 18:25:19 +05:30
<AcademyTopSection :title="portal.title" :description="portal.description">
2018-11-03 18:03:01 +05:30
<AcademyTopSectionButton/>
</AcademyTopSection>
2018-11-01 17:17:30 +05:30
<AcademyList :title="'Featured Programs'" :description="'Master ERPNext'">
2018-11-09 18:25:19 +05:30
<AcademyProgramCard v-for="item in featuredPrograms" :key="item.program.name" :program="item.program" :enrolled="item.is_enrolled"/>
2018-11-01 17:17:30 +05:30
</AcademyList>
2018-10-30 18:25:49 +05:30
</div>
</template>
<script>
import AcademyTopSection from "../components/AcademyTopSection.vue"
2018-11-01 17:17:30 +05:30
import AcademyList from "../components/AcademyList.vue"
import AcademyProgramCard from "../components/AcademyProgramCard.vue"
2018-11-03 18:03:01 +05:30
import AcademyTopSectionButton from "../components/AcademyTopSectionButton.vue"
2018-10-30 18:25:49 +05:30
export default {
2018-11-13 17:03:18 +05:30
name: "Home",
2018-11-01 17:17:30 +05:30
data() {
return{
2018-11-09 18:25:19 +05:30
portal: {},
featuredPrograms: [],
// enrolledPrograms: new Set()
2018-11-01 17:17:30 +05:30
}
},
2018-10-30 18:25:49 +05:30
components: {
2018-11-03 18:03:01 +05:30
AcademyTopSection,
AcademyList,
AcademyProgramCard,
AcademyTopSectionButton
2018-11-09 18:25:19 +05:30
},
beforeMount() {
// this.updateEnrolledPrograms().then(data => {
// data.forEach(element => {
// this.enrolledPrograms.add(element)
// })
// });
},
2018-11-01 17:17:30 +05:30
mounted() {
2018-11-09 18:25:19 +05:30
this.getPortalDetails().then(data => this.portal = data);
this.getFeaturedPrograms().then(data => this.featuredPrograms = data);
2018-11-01 17:17:30 +05:30
},
2018-11-09 18:25:19 +05:30
methods: {
// updateEnrolledPrograms(){
2018-11-13 16:47:46 +05:30
// return lms.call("get_program_enrollments")
2018-11-09 18:25:19 +05:30
// },
getPortalDetails() {
2018-11-13 16:47:46 +05:30
return lms.call("get_portal_details")
2018-11-09 18:25:19 +05:30
},
getFeaturedPrograms() {
2018-11-13 16:47:46 +05:30
return lms.call("get_featured_programs")
2018-11-09 18:25:19 +05:30
}
}
2018-10-30 18:25:49 +05:30
};
</script>