From 3afb70bf846a06915a0adb7e265a1149a692f008 Mon Sep 17 00:00:00 2001 From: nwb Date: Tue, 17 Jun 2014 17:48:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E8=AE=B2=E6=95=99=E5=B8=88=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=B8=8D=E5=85=81=E8=AE=B8=E9=80=80=E5=87=BA?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/watchers_helper.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 9a77b436..a5672766 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -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)