<commit_before>- show_email_settings = params[:controller] == 'people' and (me? or @logged_in.admin?(:manage_groups))

- if @person.groups.any?
  %table.table.group-list
    %tr
      %th
      %th= t('groups.table.group_name')
      %th= t('groups.table.member_count')
      - if show_email_settings
        %th= t('groups.table.email_enabled')

    - @person.memberships.order('groups.name').includes(:group).each do |membership|
      - if group = membership.group
        - if not group.hidden? or @logged_in.admin?(:manage_groups)
          %tr.row-with-avatar{class: group.hidden? ? 'grayed hidden-group' : ''}
            %td.avatar
              = link_to group do
                = group_avatar_tag(group)
            %td.name
              = link_to group.name, group
              - if group.private?
                %span.label.label-warning
                  = icon 'fa fa-lock'
                  = t('groups.private.label')
              - if group.hidden?
                %span.label.label-danger<commit_msg>Fix bug showing email setting column to everyone.<commit_after>- show_email_settings = params[:controller] == 'people' && (me? or @logged_in.admin?(:manage_groups))

- if @person.groups.active.any? or (@logged_in.admin?(:manage_groups) and @person.groups.any?)
  %table.table.group-list
    %tr
      %th
      %th= t('groups.table.group_name')
      %th= t('groups.table.member_count')
      - if show_email_settings
        %th= t('groups.table.email_enabled')

    - @person.memberships.order('groups.name').includes(:group).each do |membership|
      - if group = membership.group
        - if not group.hidden? or @logged_in.admin?(:manage_groups)
          %tr.row-with-avatar{class: group.hidden? ? 'grayed hidden-group' : ''}
            %td.avatar
              = link_to group do
                = group_avatar_tag(group)
            %td.name
              = link_to group.name, group
              - if group.private?
                %span.label.label-warning
                  = icon 'fa fa-lock'
                  = t('groups.private.label')
              - if group.hidden?
                %span.label.label-danger
{'fraction_non_alphanumeric': 0.13482101348210135, 'fraction_numerical': 0.0, 'mean_word_length': 1.9930458970792768, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5813935', 'n_tokens_mistral': 675, 'n_tokens_neox': 651, 'n_words': 119}