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

50 lines
1.4 KiB
Vue
Raw Normal View History

2018-11-26 11:23:51 +00:00
<template>
<div>
2018-11-26 13:46:54 +00:00
<ProfileInfo :enrolledPrograms="enrolledPrograms"></ProfileInfo>
2019-03-28 09:04:23 +00:00
<div v-if="enrolledPrograms">
<CardList :title="'Your Progress'" :description="''" :sectionType="'section-padding section-bg'">
<ProgressCard slot="card-list-slot" v-for="program in enrolledPrograms" :program="program" :key="program"/>
</CardList>
<CardList :title="'Quiz Attempts'" :description="''" :sectionType="'section-padding section'">
<ScoreCard slot="card-list-slot" v-for="program in enrolledPrograms" :program="program" :key="program"/>
</CardList>
</div>
<div v-else>
You haven't enrolled in any programs yet.
</div>
2019-02-28 12:41:46 +00:00
2018-11-26 11:23:51 +00:00
</div>
</template>
<script>
import Button from '../components/Button.vue';
import TopSection from "../components/TopSection.vue"
import CardList from "../components/CardList.vue"
import ProgressCard from "../components/ProgressCard.vue"
2018-11-26 13:46:54 +00:00
import ProfileInfo from "../components/ProfileInfo.vue"
2018-11-30 07:16:53 +00:00
import ScoreCard from "../components/ScoreCard.vue"
2018-11-26 11:23:51 +00:00
export default {
name: "ProfilePage",
components: {
AButton: Button,
TopSection,
CardList,
2019-02-28 12:41:46 +00:00
ProfileInfo,
2018-11-30 07:16:53 +00:00
ProgressCard,
2019-02-28 12:41:46 +00:00
ScoreCard
2018-11-26 11:23:51 +00:00
},
data() {
return {
enrolledPrograms: {},
}
},
mounted() {
this.getEnrolledPrograms().then(data => this.enrolledPrograms = data);
},
methods: {
getEnrolledPrograms() {
return lms.call("get_program_enrollments")
}
}
};
2018-11-26 13:46:54 +00:00
</script>