diff --git a/app/controllers/org_member_controller.rb b/app/controllers/org_member_controller.rb
index 642a100c3..2eaa790cd 100644
--- a/app/controllers/org_member_controller.rb
+++ b/app/controllers/org_member_controller.rb
@@ -54,4 +54,8 @@ class OrgMemberController < ApplicationController
def index
end
+
+ def deleteOrgMember
+ destroy
+ end
end
diff --git a/app/views/org_member/deleteOrgMember.js.erb b/app/views/org_member/deleteOrgMember.js.erb
new file mode 100644
index 000000000..d87e62c17
--- /dev/null
+++ b/app/views/org_member/deleteOrgMember.js.erb
@@ -0,0 +1,3 @@
+$("#org_members_count_id").html("");
+$("#org_members_count_id").html("<%= @org.org_members.count %>")
+$("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>');
\ No newline at end of file
diff --git a/app/views/organizations/_org_member_list.html.erb b/app/views/organizations/_org_member_list.html.erb
index 8e8a23b60..8af7986fc 100644
--- a/app/views/organizations/_org_member_list.html.erb
+++ b/app/views/organizations/_org_member_list.html.erb
@@ -1,6 +1,7 @@
<% members.each do |member|%>
- - <%= User.find(member.user_id).realname.blank? ? User.find(member.user_id).login : User.find(member.user_id).realname %>
+ <% username = User.find(member.user_id).realname.blank? ? User.find(member.user_id).login : User.find(member.user_id).realname %>
+ - <%= username %>
-
<%= get_org_member_role_name member %>
<%= form_for(member, {:as => :org_member, :remote => true, :url => Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s,
@@ -32,7 +33,8 @@
<% if ( (User.current.id == member.organization.creator_id || User.current.admin_of_org?(member.organization) ) && member.user_id != member.organization.creator_id )%>
编辑
- <%= link_to '删除', Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s,:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %><% end %>
+ 删除
+ <%#= link_to '删除', Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s,:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %><% end %>
diff --git a/config/routes.rb b/config/routes.rb
index ec8fa2337..189c2671d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -116,6 +116,7 @@ RedmineApp::Application.routes.draw do
end
collection do
get 'org_member_autocomplete'
+ get 'deleteOrgMember'
end
end