48 lines
1.5 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>
2018-11-30 12:46:53 +05:30
<CardList :title="'Featured Programs'" :description="'Master ERPNext'" :sectionType="'section-padding section-bg'">
2019-03-28 15:32:54 +05:30
<ProgramCard slot="card-list-slot" v-for="item in featuredPrograms" :key="item.program.name" :program="item.program" :enrolled="item.is_enrolled"/>
2019-02-19 18:25:07 +05:30
<AButton slot="list-bottom" :type="'primary'" :size="'md'" :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
},
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: {
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>