<commit_before><% if @person.has_groups? %>
  <p><%=h @person.first_name %> is a member of the following groups:</p>
  <ul>
    <% @person.groups.select { |g| @logged_in.can_see? g }.each do |group| %>
      <% if not group.hidden? or @logged_in.admin?(:manage_groups) %>
        <li <% if group.hidden? %>class="grayed hidden-group" style="display:none;"<% end %>>
          <%= link_to h(group.name), group %><br/>
          <span>
            email:
            <% if group.get_options_for(@person).get_email %>
              <strong title="email from this group is ON">on</strong> |
              <%= link_to 'off', group_membership_path(group, @person, :email => 'off'), :method => 'put', :confirm => 'If you click OK, you will no longer receive email from this group.', :title => 'turn off email from this group' %>
            <% else %>
              <%= link_to 'on', group_membership_path(group, @person, :email => 'on'), :method => 'put', :confirm => 'If you click OK, you will start receiving email from this group.', :title => 'turn on email from this group' %> |
              <strong title="email from this group is OFF">off</strong>
            <% end %>
          </span>
        </li>
      <% end %>
    <% end %>
  </ul>
  <% if @logged_in.admin?(:manage_groups) %>
    <p><%= link_to_function 'Show Hidden Groups', "$$('.hidden-group').each(function(e){Element.toggle(e)})" %></p>
  <% end %>
<% elsif me? %>
  <p>
    You aren't in any groups yet.
    <% if params[:person_id] %>
      Find a group <%= link_to 'here', groups_url %>.
    <% end %>
  </p>
<% else %>
  <p><%=h @person.first_name %> isn't in any groups right now.</p>
<% end %><commit_msg>Only show group email on/off links for self or admins.<commit_after><% if @person.has_groups? %>
  <p><%=h @person.first_name %> is a member of the following groups:</p>
  <ul>
    <% @person.groups.select { |g| @logged_in.can_see? g }.each do |group| %>
      <% if not group.hidden? or @logged_in.admin?(:manage_groups) %>
        <li <% if group.hidden? %>class="grayed hidden-group" style="display:none;"<% end %>>
          <%= link_to h(group.name), group %>
          <% if me? or @logged_in.admin?(:manage_groups) %>
            <br/>
            <span>
              email:
              <% if group.get_options_for(@person).get_email %>
                <strong title="email from this group is ON">on</strong> |
                <%= link_to 'off', group_membership_path(group, @person, :email => 'off'), :method => 'put', :confirm => 'If you click OK, you will no longer receive email from this group.', :title => 'turn off email from this group' %>
              <% else %>
                <%= link_to 'on', group_membership_path(group, @person, :email => 'on'), :method => 'put', :confirm => 'If you click OK, you will start receiving email from this group.', :title => 'turn on email from this group' %> |
                <strong title="email from this group is OFF">off</strong>
              <% end %>
            </span>
          <% end %>
        </li>
      <% end %>
    <% end %>
  </ul>
  <% if @logged_in.admin?(:manage_groups) and @person.groups.detect { |g| g.hidden? } %>
    <p><%= link_to_function 'Show Hidden Groups', "$$('.hidden-group').each(function(e){Element.toggle(e)})" %></p>
  <% end %>
<% elsif me? %>
  <p>
    You aren't in any groups yet.
    <% if params[:person_id] %>
      Find a group <%= link_to 'here', groups_url %>.
    <% end %>
  </p>
<% else %>
  <p><%=h @person.first_name %> isn't in any groups right now.</p>
<% end %>
{'fraction_non_alphanumeric': 0.18704225352112677, 'fraction_numerical': 0.0, 'mean_word_length': 2.616089613034623, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 0, '>': 107, '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': '1193569', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1124, 'n_words': 332}