Minor UI changes

This commit is contained in:
scmmishra 2018-11-13 12:22:49 +05:30 committed by Aditya Hase
parent f9b2fb6717
commit d7c993f028
2 changed files with 8 additions and 3 deletions

View File

@ -53,9 +53,12 @@ export default {
else if (this.courseMeta.flag == "Complete" ) {
return "success"
}
else {
else if (this.courseMeta.flag == "Continue" ) {
return "info"
}
else {
return " hidden"
}
}
}
};

View File

@ -84,8 +84,8 @@ def get_courses(program_name):
@frappe.whitelist()
def get_continue_content(course_name):
if(frappe.session.user == "Guest"):
return None
if frappe.session.user == "Guest":
return dict(content=None, content_type=None, flag=None)
enrollment = get_enrollment(course_name)
course = frappe.get_doc("Course", enrollment.course)
last_activity = enrollment.get_last_activity()
@ -126,6 +126,8 @@ def get_content(content_name, content_type):
@frappe.whitelist()
def get_next_content(content, content_type, course):
if frappe.session.user == "Guest":
return None
course_doc = frappe.get_doc("Course", course)
content_list = [{'content_type':item.content_type, 'content':item.content} for item in course_doc.get_all_children()]
current_index = content_list.index({'content': content, 'content_type': content_type})