|
|
|
@ -11,7 +11,7 @@ json.course_end @course.is_end
|
|
|
|
|
json.deadline course_end_date @course.end_date
|
|
|
|
|
json.educoder_teacher @user.is_teacher?
|
|
|
|
|
#json.is_student @is_student
|
|
|
|
|
json.is_admin @user.creator_of_course?(@course)
|
|
|
|
|
json.is_admin @user_course_identity < Course::PROFESSOR
|
|
|
|
|
json.is_public @course.is_public == 1
|
|
|
|
|
json.code_halt @course.invite_code_halt == 1
|
|
|
|
|
json.invite_code @course.invite_code_halt == 0 ? @course.generate_invite_code : ""
|
|
|
|
@ -20,7 +20,7 @@ json.switch_to_teacher switch_teacher_role(@is_student, @course, @user)
|
|
|
|
|
json.switch_to_assistant switch_assistant_role(@is_student, @course, @user)
|
|
|
|
|
#json.join_course !@user.member_of_course?(@course)
|
|
|
|
|
#json.copy_course !@user.member_of_course?(@course) && @user.is_teacher?
|
|
|
|
|
json.course_identity @user.course_identity(@course)
|
|
|
|
|
json.course_identity @user_course_identity
|
|
|
|
|
if @course.is_end == 0
|
|
|
|
|
json.days_remaining (@course.end_date.to_date - Time.now.to_date).to_i
|
|
|
|
|
end
|
|
|
|
|