From 19b61118ac94e4c568401fef8ad6255bf83a98f0 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 2 Dec 2014 18:00:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8A=A0=E5=85=A5=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=A4=B1=E8=B4=A5=E5=90=8E=E5=8F=98=E4=B8=BA=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E8=AF=BE=E7=A8=8B=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/watchers_helper.rb | 7 +++---- app/views/courses/_set_join.js.erb | 2 +- config/locales/zh.yml | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) 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: 课程密码