<commit_before><% title @user.display_name %>

<% if can? :update, @user %>
  <%= link_to 'Edit', edit_user_path(@user) %>
<% end %>
<% if @user.id == current_user.id %>
  <%= link_to 'Change my password', edit_user_registration_path %>
<% end %>

<%= clear %>
<%= image_tag @user.avatar('large'), size: '80x80', alt: 'profile photo', style: 'margin-top:1em' %>

<%= paragraphs @user.description if @user.description.present? %>

<div style="margin:1em 0">
  <%= 'Role'.pluralize @user.roles.count %>:
  <% if @user.roles.any? %>
    <%=
      @user.roles.map do |role|
        outp = role.name.capitalize
        if can? :destroy, role
          outp += ' ' + link_to('x', role, method: :delete, title: 'remove this role', data: {confirm: 'Are you sure you want to remove this role?'})
        end
        outp
      end.to_sentence.html_safe
    %>
  <% else %>
    None
  <% end %>
  <% if can? :create, Role %>
    <% other_roles = Role.names.reject{|n, v| @user.roles.find{|r| r.name == n} } %>
    <% if other_roles.any? %>
      <%= form_for [@user, @user.roles.build], html: {style: 'display:inline'} do |f| %>
        <%= f.select :name, options_for_select(other_roles.map{|n,v|[n.capitalize, n]}.unshift(['Add Role', nil])) %>
        <%= f.submit 'Add' %>
      <% end %>
    <% end %>
  <% end %>
</div>

<p>Joined <%= @user.created_at.strftime "%B %d %Y" %>.</p>

<%= clear %>

<div>
  <h2>Contact Information</h2>
  <%= link_to @user.email, "mailto:#{@user.email}" %>
  <% if @user.phone.present? %>
    <br><%= @user.phone %>
  <% end %>
</div>


<% if @upcoming.any? %>
  <div>
    <h2>Upcoming Events</h2>
    <%= render 'events/events', events: @upcoming %>
  </div>
<% end %>

<% if @past.any? %>
  <div>
    <h2>Past Events</h2>
    <%= render 'events/events', events: @past %>
  </div>
<% end %><commit_msg>adding tel: links for phone numbers so you can click on them to dial<commit_after><% title @user.display_name %>

<% if can? :update, @user %>
  <%= link_to 'Edit', edit_user_path(@user) %>
<% end %>
<% if @user.id == current_user.id %>
  <%= link_to 'Change my password', edit_user_registration_path %>
<% end %>

<%= clear %>
<%= image_tag @user.avatar('large'), size: '80x80', alt: 'profile photo', style: 'margin-top:1em' %>

<%= paragraphs @user.description if @user.description.present? %>

<div style="margin:1em 0">
  <%= 'Role'.pluralize @user.roles.count %>:
  <% if @user.roles.any? %>
    <%=
      @user.roles.map do |role|
        outp = role.name.capitalize
        if can? :destroy, role
          outp += ' ' + link_to('x', role, method: :delete, title: 'remove this role', data: {confirm: 'Are you sure you want to remove this role?'})
        end
        outp
      end.to_sentence.html_safe
    %>
  <% else %>
    None
  <% end %>
  <% if can? :create, Role %>
    <% other_roles = Role.names.reject{|n, v| @user.roles.find{|r| r.name == n} } %>
    <% if other_roles.any? %>
      <%= form_for [@user, @user.roles.build], html: {style: 'display:inline'} do |f| %>
        <%= f.select :name, options_for_select(other_roles.map{|n,v|[n.capitalize, n]}.unshift(['Add Role', nil])) %>
        <%= f.submit 'Add' %>
      <% end %>
    <% end %>
  <% end %>
</div>

<p>Joined <%= @user.created_at.strftime "%B %d %Y" %>.</p>

<%= clear %>

<div>
  <h2>Contact Information</h2>
  <%= link_to @user.email, "mailto:#{@user.email}" %>
  <% if @user.phone.present? %>
    <br><%= link_to @user.phone, "tel:#{@user.phone}" %>
  <% end %>
</div>


<% if @upcoming.any? %>
  <div>
    <h2>Upcoming Events</h2>
    <%= render 'events/events', events: @upcoming %>
  </div>
<% end %>

<% if @past.any? %>
  <div>
    <h2>Past Events</h2>
    <%= render 'events/events', events: @past %>
  </div>
<% end %>
{'fraction_non_alphanumeric': 0.2240042769313018, 'fraction_numerical': 0.006950013365410318, 'mean_word_length': 3.1166116611661168, 'pattern_counts': {'":': 0, '<': 109, '<?xml version=': 0, '>': 109, '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': '1182262', 'n_tokens_mistral': 1584, 'n_tokens_neox': 1409, 'n_words': 313}