diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index b05e0b286..793581664 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -251,6 +251,7 @@ module WatchersHelper end def exit_project_link(project) - link_to("退出项目",exit_cur_project_path(project.id),:remote => true ) + link_to(l(:label_exit_project),exit_cur_project_path(project.id), + :remote => true, :confirm => l(:lable_sure_exit_project) ) end end diff --git a/app/views/courses/settings/_members.html.erb b/app/views/courses/settings/_members.html.erb index d0c77ae83..a62a9c613 100644 --- a/app/views/courses/settings/_members.html.erb +++ b/app/views/courses/settings/_members.html.erb @@ -20,26 +20,34 @@ <% members.each do |member| %> <% next if member.new_record? %> - <%= link_to_user member.principal %> + + <%= link_to_user member.principal %> + - - <%= h member.roles.sort.collect(&:to_s).join(', ') %> - - <%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member), - :method => :put, - :html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}} + + <%= h member.roles.sort.collect(&:to_s).join(', ') %> + + <%= form_for(member, {:as => :membership, :remote => true, + :url => course_memberships_path(member),:method => :put, + :html => {:id => "member-#{member.id}-roles-form", + :class => 'hol'}} ) do |f| %> -

<% roles.each do |role| %> -
- <% end %>

+ +
+ <% end %> +

<%= hidden_field_tag 'membership[role_ids][]', '' %> -

<%= submit_tag l(:button_change), :class => "small" %> +

+ <%= submit_tag l(:button_change), :class => "small" %> <%= link_to_function l(:button_cancel), "$('#member-#{member.id}-roles').show(); $('#member-#{member.id}-roles-form').hide(); return false;" - %>

+ %> +

<% end %> @@ -71,8 +79,10 @@ <%= form_for(@member, {:as => :membership, :url => course_memberships_path(@course), :remote => true, :method => :post}) do |f| %>
<%= l(:label_member_new) %> - -

<%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %>

+

+ <%= label_tag "principal_search", l(:label_principal_search) %> + <%= text_field_tag 'principal_search', nil %> +

<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_course_memberships_path(@course, :format => 'js') }')" %>
@@ -82,10 +92,12 @@

<%= l(:label_role_plural) %>: <% roles.each do |role| %> - - - <% end %>

- + + <% end %> +

<%= submit_tag l(:button_add), :id => 'member-add-submit' %>

<% end %> diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb index c43ad55a2..310d4ecd3 100644 --- a/app/views/layouts/_join_exit_project.html.erb +++ b/app/views/layouts/_join_exit_project.html.erb @@ -14,7 +14,9 @@
- <% if ((User.current.member_of? @project) && User.current.login?) %> + <% if ((User.current.member_of? @project) && + User.current.login? && + @project.members.where("user_id = #{User.current.id}").first.roles.first.to_s != "Manager") %> <%= exit_project_link(@project) %> <% end %>
\ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index fe3dd0fe1..e2ed6a045 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2139,3 +2139,4 @@ zh: lable_user_active: 用户动态 lable_bar_active: 贴吧动态 lable_student_list_visable: 学生列表是否公开 + lable_sure_exit_project: 是否确认退出该项目