1 <% content_for :head do %>
 
   2   <%= stylesheet_link_tag "cal-heatmap/dist/cal-heatmap" %>
 
   3   <%= javascript_include_tag "heatmap" %>
 
   5 <% content_for :heading do %>
 
   7     <div class="col-sm-auto">
 
   8       <%= user_image @user %>
 
  11       <h1><%= @user.display_name %> <%= role_icons(@user) %></h1>
 
  12       <% if current_user and @user.id == current_user.id %>
 
  13         <!-- Displaying user's own profile page -->
 
  14         <nav class='secondary-actions'>
 
  17               <%= link_to t(".my edits"), :controller => "changesets", :action => "index", :display_name => current_user.display_name %>
 
  18               <span class='badge count-number'><%= number_with_delimiter(current_user.changesets.size) %></span>
 
  21               <%= link_to t(".my notes"), user_notes_path(current_user) %>
 
  22               <span class='badge count-number'><%= number_with_delimiter(current_user.note_comments.size) %></span>
 
  25               <%= link_to t(".my traces"), :controller => "traces", :action => "mine" %>
 
  26               <span class='badge count-number'><%= number_with_delimiter(current_user.traces.size) %></span>
 
  29               <%= link_to t(".my diary"), :controller => "diary_entries", :action => "index", :display_name => current_user.display_name %>
 
  30               <span class='badge count-number'><%= number_with_delimiter(current_user.diary_entries.size) %></span>
 
  33               <%= link_to t(".my comments"), user_diary_comments_path(current_user) %>
 
  34               <span class='badge count-number'><%= number_with_delimiter(current_user.diary_comments.size) %></span>
 
  37               <%= link_to t(".my_account"), account_path %>
 
  40             <% if current_user.blocks.exists? %>
 
  42                 <%= link_to t(".blocks on me"), user_received_blocks_path(current_user) %>
 
  43                 <span class='badge count-number'><%= number_with_delimiter(current_user.blocks.active.size) %></span>
 
  47             <% if can?(:create, UserBlock) and current_user.blocks_created.exists? %>
 
  49                 <%= link_to t(".blocks by me"), user_issued_blocks_path(current_user) %>
 
  50                 <span class='badge count-number'><%= number_with_delimiter(current_user.blocks_created.active.size) %></span>
 
  58         <!-- Displaying user profile page to the public -->
 
  59         <nav class='secondary-actions'>
 
  63               <%= link_to t(".edits"), :controller => "changesets", :action => "index", :display_name => @user.display_name %>
 
  64               <span class='badge count-number'><%= number_with_delimiter(@user.changesets.size) %></span>
 
  67               <%= link_to t(".notes"), user_notes_path(@user) %>
 
  68               <span class='badge count-number'><%= number_with_delimiter(@user.note_comments.size) %></span>
 
  71               <%= link_to t(".traces"), :controller => "traces", :action => "index", :display_name => @user.display_name %>
 
  72               <span class='badge count-number'><%= number_with_delimiter(@user.traces.size) %></span>
 
  75             <!-- Displaying another user's profile page -->
 
  78               <%= link_to t(".send message"), new_message_path(@user) %>
 
  81               <%= link_to t(".diary"), :controller => "diary_entries", :action => "index", :display_name => @user.display_name %>
 
  82               <span class='badge count-number'><%= number_with_delimiter(@user.diary_entries.size) %></span>
 
  85               <%= link_to t(".comments"), user_diary_comments_path(@user) %>
 
  86               <span class='badge count-number'><%= number_with_delimiter(@user.diary_comments.size) %></span>
 
  90                 <% if current_user.follows?(@user) %>
 
  91                   <%= link_to t(".unfollow"), follow_path(:display_name => @user.display_name), :method => :delete %>
 
  93                   <%= link_to t(".follow"), follow_path(:display_name => @user.display_name), :method => :post %>
 
  98             <% if @user.blocks.exists? %>
 
 100                 <%= link_to t(".block_history"), user_received_blocks_path(@user) %>
 
 101                 <span class='badge count-number'><%= number_with_delimiter(@user.blocks.active.size) %></span>
 
 105             <% if @user.moderator? and @user.blocks_created.exists? %>
 
 107                 <%= link_to t(".moderator_history"), user_issued_blocks_path(@user) %>
 
 108                 <span class='badge count-number'><%= number_with_delimiter(@user.blocks_created.active.size) %></span>
 
 112             <% if can?(:destroy, UserBlock) and @user.blocks.active.exists? %>
 
 114                 <%= link_to t(".revoke_all_blocks"), edit_user_received_blocks_path(@user) %>
 
 118             <% if can?(:create, UserBlock) %>
 
 120                 <%= link_to t(".create_block"), new_user_block_path(@user) %>
 
 124             <% if current_user and @user.id != current_user.id %>
 
 126                 <%= report_link(t(".report"), @user) %>
 
 130             <% if current_user and UserMute.exists?(owner: current_user, subject: @user) %>
 
 132               <%= link_to t(".destroy_mute"), user_mute_path(@user), :method => :delete %>
 
 134             <% elsif current_user %>
 
 136               <%= link_to t(".create_mute"), user_mute_path(@user), :method => :post, :title => t("user_mutes.index.user_mute_explainer") %>
 
 143       <div class='text-body-secondary'>
 
 145           <dl class="list-inline">
 
 146             <dt class="list-inline-item m-0"><%= t ".mapper since" %></dt>
 
 147             <dd class="list-inline-item"><%= l @user.created_at.to_date, :format => :long %></dd>
 
 148             <dt class="list-inline-item m-0"><%= t ".last map edit" %></dt>
 
 149             <dd class="list-inline-item"><%= l @user.changesets.first&.created_at&.to_date, :format => :long, :default => t(".no activity yet") %></dd>
 
 150             <% unless @user.terms_agreed %>
 
 151               <dt class="list-inline-item m-0"><%= t ".ct status" %></dt>
 
 152               <dd class="list-inline-item">
 
 153                 <% if @user.terms_seen? -%>
 
 154                   <%= t ".ct declined" %>
 
 156                   <%= t ".ct undecided" %>
 
 160             <% if current_user&.moderator? || current_user&.administrator? %>
 
 161               <dt class="list-inline-item m-0"><%= t ".uid" %></dt>
 
 162               <dd class="list-inline-item"><%= link_to @user.id, api_user_path(:id => @user.id) %></dd>
 
 168       <% if can?(:update, :user_status) %>
 
 169         <nav class='secondary-actions'>
 
 170           <ul class='clearfix'>
 
 171             <% if @user.may_activate? %>
 
 173                 <%= link_to t(".activate_user"), user_status_path(@user, :event => "activate"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 177             <% if @user.may_unsuspend? %>
 
 179                 <%= link_to t(".unsuspend_user"), user_status_path(@user, :event => "unsuspend"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 183             <% if @user.may_confirm? %>
 
 185                 <%= link_to t(".confirm_user"), user_status_path(@user, :event => "confirm"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 189             <% if @user.may_unconfirm? %>
 
 191                 <%= link_to t(".unconfirm_user"), user_status_path(@user, :event => "unconfirm"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 195             <% if @user.may_hide? %>
 
 197                 <%= link_to t(".hide_user"), user_status_path(@user, :event => "hide"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 201             <% if @user.may_unhide? %>
 
 203                 <%= link_to t(".unhide_user"), user_status_path(@user, :event => "unhide"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 207             <% if @user.may_soft_destroy? %>
 
 209                 <%= link_to t(".delete_user"), user_status_path(@user, :event => "soft_destroy"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 216       <% if current_user and current_user.administrator? -%>
 
 217         <div class='text-body-secondary'>
 
 219             <dl class="list-inline">
 
 220               <dt class="list-inline-item m-0"><%= t ".email address" %></dt>
 
 221               <dd class="list-inline-item"><%= @user.email %></dd>
 
 222               <% unless @user.creation_address.nil? -%>
 
 223                 <dt class="list-inline-item m-0"><%= t ".created from" %></dt>
 
 224                 <dd class="list-inline-item"><%= link_to @user.creation_address, users_list_path(:ip => @user.creation_address) %></dd>
 
 226               <dt class="list-inline-item m-0"><%= t ".status" %></dt>
 
 227               <dd class="list-inline-item"><%= link_to @user.status.capitalize, users_list_path(:status => @user.status) %></dd>
 
 228               <dt class="list-inline-item m-0"><%= t ".spam score" %></dt>
 
 229               <dd class="list-inline-item"><%= @user.spam_score %></dd>
 
 238 <div class="richtext text-break clearfix"><%= @user.description.to_html %></div>
 
 240 <% if @heatmap_data.present? %>
 
 242     <div class="col overflow-auto">
 
 243       <div class="heatmap-wrapper d-flex align-items-start">
 
 245         <ul class="list-unstyled d-flex flex-column justify-content-between ch-domain-text mb-0 mt-4">
 
 247           <li><%= t("date.abbr_day_names")[1] %></li>
 
 249           <li><%= t("date.abbr_day_names")[3] %></li>
 
 251           <li><%= t("date.abbr_day_names")[5] %></li>
 
 255         <div id="cal-heatmap" class="ms-2"
 
 256           data-heatmap="<%= @heatmap_data.to_json %>">
 
 263 <% if current_user and @user.id == current_user.id %>
 
 265     <%= link_to t(".edit_profile"), edit_profile_path, :class => "btn btn-outline-primary" %>