<% members.each do |member|%>
    <ul class="orgListRow">
      <li class="orgListUser hidden"><a href="<%= user_url_in_org(member.user_id) %>" class="linkBlue"><%= User.find(member.user_id).realname.blank? ? User.find(member.user_id).login : User.find(member.user_id).realname  %></a></li>
      <li class="orgListRole">
        <%= 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,
                              :method => :put,
                              :html => {:id => "org-member-#{member.id}-roles-form", :style=>'display:none'}}
            ) do |f| %>
            <% Role.givable.where("id in (11,12)").each do |role| %>
                <ul style="text-align: left;" >
                  <%= radio_button_tag 'org_member[role_ids][]', role.id, member.roles.include?(role) %>
                  <!--编辑时候显示成员，中英文切换后面需从数据库的角度优化-->
                  <% if role.id == 11 %>
                      <label >管理人员</label>
                  <% elsif role.id == 12 %>
                      <label >组织成员</label>
                  <% end %>
                </ul>
                <!--<br/>-->
            <% end %>
            <%= hidden_field_tag 'membership[role_ids][]', '' %>
            <div class="pt5">
              <a href="javascript:void(0)" class="org_member_btn" onclick="$('#org-member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;">
                <%= l(:button_change)%>
              </a>
              <a href="javascript:void(0)" class="org_member_btn" onclick="$('#org-member-<%= member.id%>-roles-form').hide();$(this).parent().parent().parent().parent().height(18)">
                <%= l(:button_cancel)%>
              </a>
            </div>
        <% end %>
      </li>
        <% if ( (User.current.id == member.organization.creator_id || User.current.admin_of_org?(member.organization) ) && member.user_id != member.organization.creator_id )%>
        <a href="javascript:void(0);" style="color: #0781B4;margin-left: 30px;float: left"  onclick="$(this).parent().height(70);$('#org-member-<%= member.id%>-roles-form').show();">编辑</a>
            <%= 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 %>
      <div class="cl"></div>
    </ul>
<% end %>