主讲教师修改为不允许退出课程

This commit is contained in:
nwb 2014-06-17 17:48:02 +08:00
parent 726697a69b
commit 3afb70bf84
1 changed files with 6 additions and 0 deletions

View File

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