brotherton-erpnext/erpnext/public/js/education/lms/components/CourseCardButton.vue

30 lines
861 B
Vue
Raw Normal View History

2018-11-02 15:21:24 +00:00
<template>
2018-11-05 07:41:37 +00:00
<button :class="getClassName" class='btn btn-primary btn-sm btn-block' @click="$router.push($route.path + '/' + course + '/' + nextContentType + '/' + nextContent)">{{ getButtonName }}</button>
2018-11-02 15:21:24 +00:00
</template>
<script>
export default {
props: ['course', 'nextContent', 'nextContentType'],
2018-11-13 11:54:07 +00:00
name: "CourseCardButton",
2018-11-02 15:21:24 +00:00
data() {
return {
buttonName: 'Start',
className: 'btn-primary'
}
},
2018-11-05 07:41:37 +00:00
computed: {
getButtonName: function() {
2018-11-13 11:17:46 +00:00
if(lms.store.checkCourseCompletion(this.course)){
2018-11-05 07:41:37 +00:00
return 'Completed'
}
else{
return 'Start'
}
},
getClassName: function() {
2018-11-13 11:17:46 +00:00
if(lms.store.checkCourseCompletion(this.course)){
2018-11-05 07:41:37 +00:00
return 'btn-success'
}
}
2018-11-02 15:21:24 +00:00
}
};
</script>