Minor UI changes

This commit is contained in:
scmmishra 2018-11-21 15:21:57 +05:30 committed by Aditya Hase
parent a592f70d4a
commit d93cec374d
3 changed files with 25 additions and 7 deletions

View File

@ -7,7 +7,11 @@
<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>
<li v-for="content in course.course_content" :key="content.name">
<router-link tag="a" :class="'text-muted'" :to="{name: 'content', params:{program_name: program_name, course: course.name, type:content.content_type, content: content.content} }">
<span style="padding-right: 0.4em"><i :class="iconClass(content.content_type)"></i></span>{{ content.content }}
</router-link>
</li>
</ul>
</span>
</div>
@ -58,14 +62,27 @@ export default {
return " hidden"
}
}
},
methods: {
iconClass(content_type) {
if(content_type == 'Video') return 'fa fa-play'
if(content_type == 'Article') return 'fa fa-file-text-o'
if(content_type == 'Quiz') return 'fa fa-question-circle-o'
}
}
};
</script>
<style scoped>
@media only screen and (max-width: 576px) {
.course-buttons {
margin-top: 1em;
.course-buttons {
margin-top: 1em;
}
}
li {
list-style-type: none;
}
.fa {
font-size: 0.8em;
}
}
</style>

View File

@ -5,6 +5,9 @@
</template>
<script>
export default {
name: "lmsRoot",
name: "lmsRoot",
mounted() {
$(document).scrollTop(0)
}
};
</script>

View File

@ -204,9 +204,7 @@ def check_quiz_completion(quiz, enrollment_name):
def get_course_meta(course_enrollment):
# course_enrollment = frappe.get_doc("Course Enrollment", course_enrollment_name)
progress = get_course_progress(course_enrollment)
print(progress)
count = sum([act['is_complete'] for act in progress])
print('Count', count)
if count == 0:
return {'flag':'Start Course', 'content_type': progress[0]['content_type'], 'content': progress[0]['content']}
elif count == len(progress):