<commit_before><% @page_title = "User: #{@user.name}" %>

</p>

<h2>
  Basic Profile Information
  <%= link_to 'Edit Profile', edit_user_path(@user),
      class: "btn btn-primary pull-right" %>
</h2>
<div class="row">
  <div class="col-sm-3 text-center">
    <%= image_tag Upload.upload_path_for(@user.profile || "silhouette.jpg"),
        alt: @user.display_name, style: 'max-height: 300px; max-width: 300px;' %>
  </div>
  <div class="col-sm-9">
    <table class="table">
      <tr>
        <td>Name:</td>
        <td><%= @user.first_name %> <%= @user.last_name %></td>
      </tr>
      <tr>
        <td>Nickname:</td>
        <td><%= @user.nickname %></td>
      </tr>
      
      <tr>
        <td>Email:</td>
        <td>
          <% if @user.email.blank? %>
          &lt;none specified&gt;
          <% else %>
          <%= mail_to "#{@user.name} <#{@user.email}>", @user.email %>
          <% end %>
        </td>
      </tr>
      <tr>
        <td>NUID:</td>
        <td><%= @user.nuid_safe(current_user) %></td>
      </tr>
      <% if current_user.site_admin? %>
      <tr>
        <td>Site Admin?</td>
        <td><%= @user.site_admin? ? "Yes" : "No" %></td>
      </tr>
      <% end %>
    </table>
  </div>
</div>


<h2>Registrations
<% if (current_user.site_admin? || current_user.professor_ever?) &&
   current_user.id != @user.id %>
<%= link_to "Impersonate", impersonate_user_path(@user), 
    method: 'post',
    class: "btn btn-primary pull-right" %>
<% end %>
</h2>

<% grouped_regs = @user.grouped_registrations
   terms = Term.all_sorted.to_a %>
<% Registration.roles.to_a.reverse.each do |role_name, role_val| %>
  <% as_role = grouped_regs[role_name] %>
  <% if as_role[:count] > 0 %>
<h3>As <%= role_name.capitalize %>:</h3>
<ul>
  <% terms.each do |term| %>
    <% by_term = as_role[term.name] %>
    <% by_term.sort_by{|info| info[:course]}.each do |info| %><commit_msg>show usernames as well as email addresses<commit_after><% @page_title = "User: #{@user.name}" %>

</p>

<h2>
  Basic Profile Information
  <%= link_to 'Edit Profile', edit_user_path(@user),
      class: "btn btn-primary pull-right" %>
</h2>
<div class="row">
  <div class="col-sm-3 text-center">
    <%= image_tag Upload.upload_path_for(@user.profile || "silhouette.jpg"),
        alt: @user.display_name, style: 'max-height: 300px; max-width: 300px;' %>
  </div>
  <div class="col-sm-9">
    <table class="table">
      <tr>
        <td>Name:</td>
        <td><%= @user.first_name %> <%= @user.last_name %></td>
      </tr>
      <tr>
        <td>Nickname:</td>
        <td><%= @user.nickname %></td>
      </tr>
      <tr>
        <td>Email:</td>
        <td>
          <% if @user.email.blank? %>
          &lt;none specified&gt;
          <% else %>
          <%= mail_to "#{@user.name} <#{@user.email}>", @user.email %>
          <% end %>
        </td>
      </tr>
      <tr>
        <td>NUID:</td>
        <td><%= @user.nuid_safe(current_user) %></td>
      </tr>
      <tr>
        <td>Username:</td>
        <td><%= @user.username %></td>
      </tr>      
      <% if current_user.site_admin? %>
      <tr>
        <td>Site Admin?</td>
        <td><%= @user.site_admin? ? "Yes" : "No" %></td>
      </tr>
      <% end %>
    </table>
  </div>
</div>


<h2>Registrations
<% if (current_user.site_admin? || current_user.professor_ever?) &&
   current_user.id != @user.id %>
<%= link_to "Impersonate", impersonate_user_path(@user), 
    method: 'post',
    class: "btn btn-primary pull-right" %>
<% end %>
</h2>

<% grouped_regs = @user.grouped_registrations
   terms = Term.all_sorted.to_a %>
<% Registration.roles.to_a.reverse.each do |role_name, role_val| %>
  <% as_role = grouped_regs[role_name] %>
  <% if as_role[:count] > 0 %>
<h3>As <%= role_name.capitalize %>:</h3>
<ul>
  <% terms.each do |term| %>
    <% by_term = as_role[term.name] %>
    <% by_term.sort_by{|info| info[:course]}.each do |info| %>
{'fraction_non_alphanumeric': 0.2165816326530612, 'fraction_numerical': 0.007653061224489796, 'mean_word_length': 2.513440860215054, 'pattern_counts': {'":': 0, '<': 154, '<?xml version=': 0, '>': 156, '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': '1756406', 'n_tokens_mistral': 1614, 'n_tokens_neox': 1490, 'n_words': 272}