<commit_before><%= stylesheet_link_tag "admin" %>

<h1>
    <%= t('org_admin.users_list') %>
</h1>

<%= raw t('org_admin.user_text_html')%>
  <table id="dmp_table" class="dmp_table tablesorter">
    <thead>
      <tr>
          <th class="dmp_th_big"><%= t('org_admin.user_full_name') %></th>
          <th class="dmp_th_medium"><%= t('org_admin.user_name') %></th>
          <th class="dmp_th_small"><%= t('org_admin.last_logged_in') %></th>
          <th class="dmp_th_small"><%= t('org_admin.how_many_plans') %></th>
          <th class="dmp_th_small"><%= t('org_admin.privileges') %></th>
      </tr>
    </thead>
    <tbody>
      <% @users.each do |user| %>
          <% if !user.nil? then%>
            <tr>
              <td class="dmp_td_big">
                  <% if !user.name.nil? then%>
                      <%= user.name %>
                  <% end %>
              </td>
              <td class="dmp_td_medium">
                  <%= user.email %>
              </td>
              <td class="dmp_td_small">
                  <% if !user.last_sign_in_at.nil? then%>
                  <%= l user.last_sign_in_at.to_date, :formats => :short %>
                  <% end %>
              </td>
              <td class="dmp_td_small">
                  <% if !user.project_groups.nil? then%>
                  <%= user.project_groups.length %>
                  <% end %>
              </td>
              <td class="dmp_td_small">
                <% b_label = t('helpers.submit.edit')%>
                <%= link_to b_label, admin_grant_permissions_user_path(user), :class => "dmp_table_link"%>
              </td>
            </tr>
          <% end %>
      <% end %>
    </tbody>
  </table>
<commit_msg>Update users page logic so that current user cannot edit their own permissions<commit_after><%= stylesheet_link_tag "admin" %>

<h1>
    <%= t('org_admin.users_list') %>
</h1>

<%= raw t('org_admin.user_text_html')%>
  <table id="dmp_table" class="dmp_table tablesorter">
    <thead>
      <tr>
          <th class="dmp_th_big"><%= t('org_admin.user_full_name') %></th>
          <th class="dmp_th_medium"><%= t('org_admin.user_name') %></th>
          <th class="dmp_th_small"><%= t('org_admin.last_logged_in') %></th>
          <th class="dmp_th_small"><%= t('org_admin.how_many_plans') %></th>
          <th class="dmp_th_small"><%= t('org_admin.privileges') %></th>
      </tr>
    </thead>
    <tbody>
      <% @users.each do |user| %>
          <% if !user.nil? then%>
            <tr>
              <td class="dmp_td_big">
                  <% if !user.name.nil? then%>
                      <%= user.name %>
                  <% end %>
              </td>
              <td class="dmp_td_medium">
                  <%= user.email %>
              </td>
              <td class="dmp_td_small">
                  <% if !user.last_sign_in_at.nil? then%>
                  <%= l user.last_sign_in_at.to_date, :formats => :short %>
                  <% end %>
              </td>
              <td class="dmp_td_small">
                  <% if !user.project_groups.nil? then%>
                  <%= user.project_groups.length %>
                  <% end %>
              </td>
              <td class="dmp_td_small">
                <% unless current_user == user %>
                  <% b_label = t('helpers.submit.edit')%>
                  <%= link_to b_label, admin_grant_permissions_user_path(user), :class => "dmp_table_link"%>
                <% end %>
              </td>
            </tr>
          <% end %>
      <% end %>
    </tbody>
  </table>

{'fraction_non_alphanumeric': 0.17668437237908863, 'fraction_numerical': 0.0011182555213866368, 'mean_word_length': 1.589001447178003, 'pattern_counts': {'":': 0, '<': 117, '<?xml version=': 0, '>': 121, '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': '3935378', 'n_tokens_mistral': 1284, 'n_tokens_neox': 1179, 'n_words': 197}