<commit_before><div class="subtitle">
  <%= t('.subtitle') %>
</div>

<div class="spacer"></div>

<% if @groups.any? %>
  <h1 class="group_type">Joined Groups</h1>
  <% @groups.each do |group| %>
    <% if @groups.last == group %>
      <div class="group no_margin_bottom">
    <% else %>
      <div class="group">
    <% end %>
    <h1 class="group_name">
      <%= link_to group.name, group %>
      <% if user_is_leader_of?(group) %>
        (<%= t('.leader') %>)
      <% end %>
    </h1>

    <div class="notification_wrapper">
      <strong class="tip_notifications_button">
        <i class="fa fa-list small_margin_right"></i>
        <%= group.group_members.count %>
        <% if group.group_members.count == 1 %>
          <%= t('groups.index.member') %>
        <% else %>
          <%= t('groups.index.members') %>
        <% end %>
      </strong>
      <%= render partial: '/notifications/members',
                 locals: { data: group.group_members } %>
    </div>

    <%= simple_format(group.description[0..80]) %>
    <% if group.description.length >= 80 %>
        <%= " [...]" %>
    <% end %>

    <% if user_is_leader_of?(group) %>
      <i class="fa fa-pencil action"></i>
      <%= edit_group_link(group) %>
    <% end %>
    <% if (!user_is_leader_of?(group)) ||
        (user_is_leader_of?(group) && group_has_more_than_one_member?(group)) %>
      <i class="fa fa-times action"></i>
      <%= leave_group_link(group) %>
    <% end %>
    <% if user_is_leader_of?(group) && group.group_members.count == 1 %>
      <i class="fa fa-trash-o action"></i>
      <%= delete_group_link(group) %>
    <% end %>
    </div>
  <% end %>
<% else %>
  You aren't a part of any groups yet! Click <i class="fa fa-plus-circle"></i> to create one or join any available groups below.
  <br>
  <br>Support groups are great for having open discussions about mental health! You can create groups, invite members, and organize meetup events online or offline. You can also join groups your allies have created.
<% end %>

    <% if @available_groups.length > 0 %>
      <div class="spacer"></div>

      <h1 class="group_type">Available Groups</h1>

      <% @available_groups.each do |group| %>
        <% if @available_groups.last == group %>
          <div class="group no_margin_bottom">
          <% else %>
            <div class="group">
            <% end %>

            <h1 class="group_name">
              <%= link_to group.name, group %>
            </h1>

            <strong class="tip_notifications_button">
              <i class="fa fa-list small_margin_right"></i>
              <%= GroupMember.where(groupid: group.id).count %>
              <% if GroupMember.where(groupid: group.id).count == 1 %><%= t('groups.index.member') %><% else %><%= t('groups.index.members') %><% end %></strong>

            <%= render :partial => '/notifications/members', locals: { data: GroupMember.where(groupid: group.id).all } %>

            <%= simple_format(Group.where(id: group.id).first.description[0..80]) %>
            <% if Group.where(id: group.id).first.description.length >= 80 %>
              <%= " [...]" %>
            <% end %>

            <%= link_to t('groups.index.join'), join_groups_path(groupid: group.id), id: 'join' %>
            </div>
          <% end %>
        <% end %><commit_msg>Fixing indentation in available_groups loop<commit_after><div class="subtitle">
  <%= t('.subtitle') %>
</div>

<div class="spacer"></div>

<% if @groups.any? %>
  <h1 class="group_type">Joined Groups</h1>
  <% @groups.each do |group| %>
    <% if @groups.last == group %>
      <div class="group no_margin_bottom">
    <% else %>
      <div class="group">
    <% end %>
    <h1 class="group_name">
      <%= link_to group.name, group %>
      <% if user_is_leader_of?(group) %>
        (<%= t('.leader') %>)
      <% end %>
    </h1>

    <div class="notification_wrapper">
      <strong class="tip_notifications_button">
        <i class="fa fa-list small_margin_right"></i>
        <%= group.group_members.count %>
        <% if group.group_members.count == 1 %>
          <%= t('groups.index.member') %>
        <% else %>
          <%= t('groups.index.members') %>
        <% end %>
      </strong>
      <%= render partial: '/notifications/members',
                 locals: { data: group.group_members } %>
    </div>

    <%= simple_format(group.description[0..80]) %>
    <% if group.description.length >= 80 %>
        <%= " [...]" %>
    <% end %>

    <% if user_is_leader_of?(group) %>
      <i class="fa fa-pencil action"></i>
      <%= edit_group_link(group) %>
    <% end %>
    <% if (!user_is_leader_of?(group)) ||
        (user_is_leader_of?(group) && group_has_more_than_one_member?(group)) %>
      <i class="fa fa-times action"></i>
      <%= leave_group_link(group) %>
    <% end %>
    <% if user_is_leader_of?(group) && group.group_members.count == 1 %>
      <i class="fa fa-trash-o action"></i>
      <%= delete_group_link(group) %>
    <% end %>
    </div>
  <% end %>
<% else %>
  You aren't a part of any groups yet! Click <i class="fa fa-plus-circle"></i> to create one or join any available groups below.
  <br>
  <br>Support groups are great for having open discussions about mental health! You can create groups, invite members, and organize meetup events online or offline. You can also join groups your allies have created.
<% end %>

<% if @available_groups.length > 0 %>
  <div class="spacer"></div>

  <h1 class="group_type">Available Groups</h1>

  <% @available_groups.each do |group| %>
    <% if @available_groups.last == group %>
      <div class="group no_margin_bottom">
    <% else %>
      <div class="group">
    <% end %>
      <h1 class="group_name">
        <%= link_to group.name, group %>
      </h1>

      <strong class="tip_notifications_button">
        <i class="fa fa-list small_margin_right"></i>
        <%= GroupMember.where(groupid: group.id).count %>
        <% if GroupMember.where(groupid: group.id).count == 1 %>
          <%= t('groups.index.member') %>
        <% else %>
          <%= t('groups.index.members') %>
        <% end %>
      </strong>

      <%= render :partial => '/notifications/members', locals: { data: GroupMember.where(groupid: group.id).all } %>
      <%= simple_format(Group.where(id: group.id).first.description[0..80]) %>

      <% if Group.where(id: group.id).first.description.length >= 80 %>
        <%= " [...]" %>
      <% end %>

      <%= link_to t('groups.index.join'), join_groups_path(groupid: group.id), id: 'join' %>
    </div>
  <% end %>
<% end %>
{'fraction_non_alphanumeric': 0.1890577507598784, 'fraction_numerical': 0.006686930091185411, 'mean_word_length': 2.5324745034889964, 'pattern_counts': {'":': 0, '<': 189, '<?xml version=': 0, '>': 197, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2862538', 'n_tokens_mistral': 2334, 'n_tokens_neox': 2087, 'n_words': 438}