_members_list.rhtml
1.03 KB
<% collection = @collection == :profile_admins ? profile.admins : profile.members %>
<% 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>
<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>