index.rhtml 1.55 KB
<div id="memberships-index">

<h1><%= _('Manage my groups') %></h1>

<% button_bar do %>
  <%= button(:add, __('Create a new community'), :controller => 'memberships', :action => 'new_community') %>
  <%= button :add, __('Register a new enterprise'), :controller => 'enterprise_registration' if environment.enabled?('enterprise_registration') %>
  <%= button :back, _('Go back'), :controller => 'profile_editor' %>
<% end %>

<ul>
<% for membership in @memberships %>
  <li>
    <div class='common-profile-list-block'>
      <%= profile_image_link(membership, :portrait, 'div') %>
    </div>
    <span class='profile-details'>
      <strong><%= membership.name %></strong><br/>
      <%= _('Role: %s') % rolename_for(profile, membership) %> <br/>
      <%= _('Type: %s') % getterm(membership.class.name) %> <br/>
      <%= _('Description: %s') % membership.description  + '<br/>' if membership.community? %>
      <%= _('Members: %s') % membership.members.size.to_s %> <br/>
      <%= _('Created at: %s') % show_date(membership.created_at) unless membership.enterprise? %> <br/>
      <% button_bar do %>
        <%= button 'menu-ctrl-panel', _('Control panel of this group'), membership.admin_url %>
        <%= lightbox_button 'menu-logout', _('Leave'), membership.leave_url %>
        <% if (membership.community? && user.has_permission?(:destroy_profile, membership)) %>
          <%= button 'delete', _('Remove'), { :action => 'destroy_community', :id => membership } %>
        <% end %>
      <% end %>
    </span>
    <br class="may-clear" />
  </li>
<% end %>
</ul>

</div>