_members_list.html.erb 1.06 KB
<% collection = @collection == :profile_admins ? profile.admins : profile.members_by_name %>
<% title = @title ? @title : _('Current members') %>
<% remove_action = @remove_action ? @remove_action : {:action => 'unassociate'} %>

<h3><%= title %></h3>

<table>
  <tr>
    <th><%= _('Member') %></th>
    <th><%= _('Actions') %></th>
  </tr>
  <% collection.each do |m| %>
    <tr title="<%= m.name %>">
      <td><%= link_to_profile m.short_name, m.identifier, :title => m.name %> </td>
      <td>
        <div class="members-buttons-cell">
          <%= button_without_text :edit, _('Edit'), :action => 'change_role', :id => m %>
          <%= button_to_remote_without_text(:remove, _('Remove'),
                :update => 'members-list',
                :loading => "$('members-list').addClassName('loading')",
                :success => "$('tr-#{m.identifier}').show()",
                :complete => "$('members-list').removeClassName('loading')",
                :url => { :id => m }.merge(remove_action)) if m != user %>
        </div>
      </td>
    </tr>
  <% end %>
</table>