2018-10-30 12:55:49 +00:00
|
|
|
<template>
|
2018-11-01 11:49:53 +00:00
|
|
|
<div>
|
|
|
|
<component v-bind:is="currentComponent" :content="content" :type="type">
|
2018-11-13 11:54:07 +00:00
|
|
|
<Navigation :nextContent="nextContent" :nextContentType="nextContentType"/>
|
2018-11-01 11:49:53 +00:00
|
|
|
</component>
|
|
|
|
</div>
|
2018-10-30 12:55:49 +00:00
|
|
|
</template>
|
|
|
|
<script>
|
2018-11-13 11:54:07 +00:00
|
|
|
import Article from "../components/Article.vue"
|
|
|
|
import Quiz from "../components/Quiz.vue"
|
|
|
|
import Video from "../components/Video.vue"
|
|
|
|
import Navigation from "../components/Navigation.vue"
|
2018-11-01 11:49:53 +00:00
|
|
|
|
2018-10-30 12:55:49 +00:00
|
|
|
export default {
|
2018-11-12 07:20:54 +00:00
|
|
|
props:['program_name', 'course', 'type', 'content'],
|
2018-11-13 11:33:18 +00:00
|
|
|
name: "CoursePage",
|
2018-11-01 11:49:53 +00:00
|
|
|
data() {
|
|
|
|
return{
|
2018-11-05 07:41:37 +00:00
|
|
|
nextContent: '',
|
2018-11-01 11:49:53 +00:00
|
|
|
nextContentType: '',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
currentComponent: function() {
|
|
|
|
if(this.type === "Article") {
|
2018-11-13 11:54:07 +00:00
|
|
|
return 'Article'
|
2018-11-01 11:49:53 +00:00
|
|
|
}
|
|
|
|
else if(this.type === "Quiz") {
|
2018-11-13 11:54:07 +00:00
|
|
|
return 'Quiz'
|
2018-11-01 11:49:53 +00:00
|
|
|
}
|
|
|
|
else if(this.type === "Video") {
|
2018-11-13 11:54:07 +00:00
|
|
|
return 'Video'
|
2018-11-01 11:49:53 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
frappe.call({
|
2018-11-13 11:05:34 +00:00
|
|
|
method: "erpnext.www.lms.get_next_content",
|
2018-11-01 11:49:53 +00:00
|
|
|
args:{
|
|
|
|
content: this.content,
|
|
|
|
content_type: this.type,
|
|
|
|
course: this.course
|
|
|
|
}
|
|
|
|
}).then(r => {
|
|
|
|
this.nextContent = r.message.content,
|
|
|
|
this.nextContentType = r.message.content_type
|
|
|
|
});
|
|
|
|
},
|
|
|
|
components: {
|
2018-11-13 11:54:07 +00:00
|
|
|
Article,
|
|
|
|
Video,
|
|
|
|
Quiz,
|
|
|
|
Navigation
|
2018-11-01 11:49:53 +00:00
|
|
|
}
|
2018-10-30 12:55:49 +00:00
|
|
|
};
|
2018-11-01 11:49:53 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.footer-message {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.video-top-section {
|
|
|
|
padding-top: 3rem !important;
|
|
|
|
padding-bottom: 1rem !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.video-description-section {
|
|
|
|
padding-top: 0em !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.article-top-section {
|
|
|
|
padding-top: 0.5em !important;
|
|
|
|
padding-bottom: 0rem !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.article-content-section {
|
|
|
|
padding-top: 0em !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.quiz-section {
|
2018-11-02 05:59:02 +00:00
|
|
|
padding-top: 0.5em !important;
|
2018-11-01 11:49:53 +00:00
|
|
|
padding-bottom: 0rem !important;
|
|
|
|
}
|
|
|
|
</style>
|