<div id="your-groups-div" class="group-tab">
  <% if @person.memberships.empty? %>
  <p>You are not a member of any groups.</p>
  <% else %>

  <ul>
    <% @person.memberships.sort_by {|m| m.group_name.downcase}.each do |membership| %>
    <li><%= group_link(membership.group) %>
      (<%= pluralize(membership.group_size, "member") %>)
      (<%= link_to "leave this group", :controller => :membership, :action => :leave, :id => membership.id, :confirm => "Are you sure that you want to leave this group?" %>)
    </li>
    <% end %>
  </ul>
  <% end %>
</div>

<div id="your-groups-div" class="group-tab">
  <% if @person.nil? %>
  <p>You are not logged in.</p>
  <% elsif @person.memberships.empty? %>
  <p>You are not a member of any groups.</p>
  <% else %>

  <ul>
    <% @person.memberships.sort_by {|m| m.group_name.downcase}.each do |membership| %>
    <li><%= group_link(membership.group) %>
      (<%= pluralize(membership.group_size, "member") %>)
      (<%= link_to "leave this group", :controller => :membership, :action => :leave, :id => membership.id, :confirm => "Are you sure that you want to leave this group?" %>)
    </li>
    <% end %>
  </ul>
  <% end %>
</div>

Handle users who are not logged in from seeing groups
Handle users who are not logged in from seeing groups


Former-commit-id: c18b70b5172d78d9ced9924ac4c9aafbad167457