_list_groups.html.erb 1.29 KB
<ul id="groups-list">
<% for group in groups %>
  <li>
    <div class='common-profile-list-block'>
      <%= profile_image_link(group, :portrait, 'div') %>
    </div>
    <span class='profile-details'>
      <strong><%= group.name %></strong><br/>
      <%= _('Role: %s') % rolename_for(profile, group) + '<br/>' if profile.role_assignments.find_by_resource_id(group.id) %>
      <%= _('Type: %s') % _(group.class.identification) %> <br/>
      <%= _('Description: %s') % group.description  + '<br/>' if group.community? %>
      <%= _('Members: %s') % group.members_count.to_s %> <br/>
      <%= _('Created at: %s') % show_date(group.created_at) unless group.enterprise? %> <br/>
      <% button_bar do %>
        <% if user.has_permission?(:edit_profile, group) %>
          <%= button 'menu-ctrl-panel', _('Control panel of this group'), group.admin_url %>
        <% end %>
        <%= button 'menu-logout', _('Leave community'), group.leave_url(true), :class => 'leave-community' %>
        <% if (group.community? && user.has_permission?(:destroy_profile, group)) %>
          <%= button 'delete', _('Remove'), { :controller => 'profile_editor', :action => 'destroy_profile', :profile => group.identifier } %>
        <% end %>
      <% end %>
    </span>
    <br class="may-clear" />
  </li>
<% end %>
</ul>