brotherton-erpnext/erpnext/public/js/education/web-academy/components/AcademyCourseCard.vue

59 lines
1.7 KiB
Vue
Raw Normal View History

2018-11-01 11:49:53 +00:00
<template>
<div class="card mt-3" data-list="getting-started">
<div class='card-body'>
<div class="row">
<div class="course-details col-xs-8 col-sm-9 col-md-10">
<h5 class="card-title">{{ course.course_name }}</h5>
<span class="course-list text-muted" id="getting-started">
Course Content
<ul class="mb-0 mt-1">
<li v-for="content in course.course_content" :key="content.name">{{ content.content }}</li>
</ul>
</span>
</div>
2018-11-05 05:31:37 +00:00
<div v-if="$root.$data.isLogin" class='course-buttons text-center col-xs-4 col-sm-3 col-md-2'>
2018-11-02 15:21:24 +00:00
<AcademyCourseCardButton :course="course.name" :nextContent="nextContent" :nextContentType="nextContentType"/>
2018-11-01 11:49:53 +00:00
</div>
</div>
</div>
</div>
</template>
<script>
2018-11-02 15:21:24 +00:00
import AcademyCourseCardButton from './AcademyCourseCardButton.vue'
2018-11-01 11:49:53 +00:00
export default {
props: ['course'],
name: "AcademyCourseCard",
data() {
return {
nextContent: '',
nextContentType: ''
}
},
mounted() {
2018-11-03 09:18:42 +00:00
if(this.$root.$data.checkLogin()){
frappe.call({
method: "erpnext.www.academy.get_starting_content",
args: {
course_name: this.course.name
}
}).then(r => {
this.nextContent = r.message.content,
this.nextContentType = r.message.content_type
});
}
2018-11-02 15:21:24 +00:00
},
components: {
AcademyCourseCardButton
2018-11-01 11:49:53 +00:00
}
};
</script>
<style scoped>
@media only screen and (max-width: 576px) {
.course-buttons {
margin-top: 1em;
}
}
</style>