|
|
|
@ -71,6 +71,9 @@ module WatchersHelper
|
|
|
|
|
# Somebody may use option params
|
|
|
|
|
def join_in_course(course, user, options=[])
|
|
|
|
|
return '' unless user && user.logged?
|
|
|
|
|
# modify by nwb
|
|
|
|
|
# 主讲教师不允许退出课程
|
|
|
|
|
return '' if user.id == course.tea_id
|
|
|
|
|
joined = user.member_of_course?(course)
|
|
|
|
|
text = joined ? l(:label_exit_course) : l(:label_join_course)
|
|
|
|
|
url_t = join_path(:object_id => course.id)
|
|
|
|
@ -85,6 +88,9 @@ module WatchersHelper
|
|
|
|
|
|
|
|
|
|
def join_in_course_for_list(course, user, options=[])
|
|
|
|
|
return '' unless user && user.logged?
|
|
|
|
|
# modify by nwb
|
|
|
|
|
# 主讲教师不允许退出课程
|
|
|
|
|
return '' if user.id == course.tea_id
|
|
|
|
|
joined = user.member_of_course?(course)
|
|
|
|
|
text = joined ? l(:label_exit_course) : l(:label_join_course)
|
|
|
|
|
url_t = join_path(:object_id => course.id)
|
|
|
|
|