diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 6d916f43e..b9d254143 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -100,13 +100,12 @@ module WatchersHelper return '' if user.id == course.tea_id joined = user.member_of_course?(course) text = joined ? l(:label_exit_course) : l(:label_new_join) - url_t = join_path(:object_id => course.id) - url_f = try_join_path(:object_id => course.id) + url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id) method = joined ? 'delete' : 'post' if joined - link_to text, url_t, :remote => true, :method => method, :id => "#{course.id}", :confirm => l(:text_are_you_sure_out), :class => []+options + link_to text, url, :remote => true, :method => method, :id => "#{course.id}", :confirm => l(:text_are_you_sure_out), :class => []+options else - link_to text, url_f, :remote => true, :method => method, :id => "#{course.id}", :class => []+options + link_to text, url, :remote => true, :method => method, :id => "#{course.id}", :class => []+options end end diff --git a/app/views/courses/_set_join.js.erb b/app/views/courses/_set_join.js.erb index 39e40d34e..f65d6e98b 100644 --- a/app/views/courses/_set_join.js.erb +++ b/app/views/courses/_set_join.js.erb @@ -1,5 +1,5 @@ <% if object_id%> - $("#<%=object_id%>").replaceWith('<%= escape_javascript join_in_course_for_list(course, user) %>'); + $("#<%=object_id%>").replaceWith('<%= escape_javascript join_in_course(course, user) %>'); <% end %> <% if @state %> <% if @state == 0 %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 5aedd93a7..23c9e8e06 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1899,7 +1899,7 @@ zh: other: 成员 label_bids_task_list: 作业列表 - label_join_course: 加入课程 + label_join_course: 加入 label_exit_course: 退出 label_new_join: 加入 label_new_course_password: 课程密码