2018-10-30 12:55:49 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
2018-11-13 11:54:07 +00:00
|
|
|
<TopSection :title="portal.title" :description="portal.description">
|
|
|
|
<TopSectionButton/>
|
|
|
|
</TopSection>
|
2018-11-30 07:16:53 +00:00
|
|
|
<CardList :title="'Featured Programs'" :description="'Master ERPNext'" :sectionType="'section-padding section-bg'">
|
2018-11-14 08:53:06 +00:00
|
|
|
<ProgramCard slot="card-list-slot" v-for="item in featuredPrograms" :key="item.program.name" :program="item.program" :enrolled="item.is_enrolled"/>
|
2019-02-19 12:55:07 +00:00
|
|
|
<AButton slot="list-bottom" :type="'primary'" :size="'md'" :route="'List/Program'">View All</AButton>
|
2018-11-13 11:54:07 +00:00
|
|
|
</CardList>
|
2018-10-30 12:55:49 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
2018-11-14 08:53:06 +00:00
|
|
|
import Button from '../components/Button.vue';
|
2018-11-13 11:54:07 +00:00
|
|
|
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 12:55:49 +00:00
|
|
|
|
|
|
|
export default {
|
2018-11-13 11:33:18 +00:00
|
|
|
name: "Home",
|
2018-11-01 11:47:30 +00:00
|
|
|
data() {
|
|
|
|
return{
|
2018-11-09 12:55:19 +00:00
|
|
|
portal: {},
|
2018-11-14 08:53:06 +00:00
|
|
|
featuredPrograms: {},
|
2018-11-09 12:55:19 +00:00
|
|
|
// enrolledPrograms: new Set()
|
2018-11-01 11:47:30 +00:00
|
|
|
}
|
|
|
|
},
|
2018-10-30 12:55:49 +00:00
|
|
|
components: {
|
2018-11-14 08:53:06 +00:00
|
|
|
AButton: Button,
|
2018-11-13 11:54:07 +00:00
|
|
|
TopSection,
|
|
|
|
CardList,
|
|
|
|
ProgramCard,
|
|
|
|
TopSectionButton
|
2018-11-09 12:55:19 +00:00
|
|
|
},
|
2018-11-01 11:47:30 +00:00
|
|
|
mounted() {
|
2018-11-09 12:55:19 +00:00
|
|
|
this.getPortalDetails().then(data => this.portal = data);
|
|
|
|
this.getFeaturedPrograms().then(data => this.featuredPrograms = data);
|
2018-11-01 11:47:30 +00:00
|
|
|
},
|
2018-11-09 12:55:19 +00:00
|
|
|
methods: {
|
|
|
|
getPortalDetails() {
|
2018-11-13 11:17:46 +00:00
|
|
|
return lms.call("get_portal_details")
|
2018-11-09 12:55:19 +00:00
|
|
|
},
|
|
|
|
getFeaturedPrograms() {
|
2018-11-13 11:17:46 +00:00
|
|
|
return lms.call("get_featured_programs")
|
2018-11-09 12:55:19 +00:00
|
|
|
}
|
|
|
|
}
|
2018-10-30 12:55:49 +00:00
|
|
|
};
|
|
|
|
</script>
|