58 lines
1.7 KiB
Vue
Raw Normal View History

2018-10-30 18:25:49 +05:30
<template>
<div>
2018-11-13 17:24:07 +05:30
<TopSection :title="portal.title" :description="portal.description">
<TopSectionButton/>
</TopSection>
<CardList :title="'Featured Programs'" :description="'Master ERPNext'">
<ProgramCard slot="card-list-slot" v-for="item in featuredPrograms" :key="item.program.name" :program="item.program" :enrolled="item.is_enrolled"/>
<AButton slot="list-bottom" :type="'primary'" :size="'lg'" :route="'List/Program'">View All</AButton>
2018-11-13 17:24:07 +05:30
</CardList>
2018-10-30 18:25:49 +05:30
</div>
</template>
<script>
import Button from '../components/Button.vue';
2018-11-13 17:24:07 +05:30
import TopSection from "../components/TopSection.vue"
import CardList from "../components/CardList.vue"
import ProgramCard from "../components/ProgramCard.vue"
import TopSectionButton from "../components/TopSectionButton.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: {},
2018-11-09 18:25:19 +05:30
// enrolledPrograms: new Set()
2018-11-01 17:17:30 +05:30
}
},
2018-10-30 18:25:49 +05:30
components: {
AButton: Button,
2018-11-13 17:24:07 +05:30
TopSection,
CardList,
ProgramCard,
TopSectionButton
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>