<% if @members.count == 0 %>
<p><%= t('.empty_group') %></p>
<% else %>
<% if @num_hidden == 0 %>
<p><%= t('.title', count: @members.count) %>:</p>
<% else %>
<p><%= t('.title', count: @members.count) %> <em>(<%= t('.hidden_from_you', count: @num_hidden) %></em>):</p>
<% end %>
<div id="membersTable">
<table>
  <tr class="stickyInline">
    <th><%= t("activeldap.attributes.user.displayName") %> (<%= t("activeldap.attributes.user.uid") %>)</th>
    <th><%= t('activeldap.attributes.user.roles') %></th>
    <th><%= t('columns.primary_school') %></th>
    <th class="width-0"><%= t('groups.index.actions') %></th>
  </tr>
  <% @members.each do |member| %>
  <% pri_school = member.primary_school %>
  <% if member.puavoRemovalRequestTime %>
  <tr class="markedForDeletion">
  <% else %>
  <tr>
  <% end %>
    <td>
      <%= link_to "#{member.displayName} (#{member.uid})", user_path(pri_school, member) %>
      <% if member.puavoLocked %><i class='icon-lock' title="<%= t('users.show.user_is_locked') %>"></i><% end %>
    </td>

    <td><%= Array(member.puavoEduPersonAffiliation).collect { |r| t('puavoEduPersonAffiliation_' + r) }.join(', ') %></td>

    <td><%= pri_school.displayName %></td>

    <td>
      <%= link_to(t('.remove'),
                    remove_user_group_path(school_id: pri_school.id,
                                           id: @group.puavoId,
                                           :user_id => member.puavoId),
                    remote: true,
                    method: :put,
                    class: "btn nowrap") %>
    </td>
  </tr>
  <% end %>
</table>
</div>
<% end %>
