1 <% content_for :head do %>
 
   2   <%= javascript_include_tag "heatmap" %>
 
   4 <% content_for :heading do %>
 
   6     <div class="col-sm-auto">
 
   7       <%= user_image @user %>
 
  10       <h1><%= @user.display_name %> <%= role_icons(@user) %></h1>
 
  11       <% if current_user and @user.id == current_user.id %>
 
  12         <!-- Displaying user's own profile page -->
 
  13         <nav class='secondary-actions'>
 
  16               <%= link_to t(".my edits"), :controller => "changesets", :action => "index", :display_name => current_user.display_name %>
 
  17               <span class='badge count-number'><%= number_with_delimiter(current_user.changesets.size) %></span>
 
  20               <%= link_to t(".my notes"), user_notes_path(current_user) %>
 
  21               <span class='badge count-number'><%= number_with_delimiter(current_user.note_comments.size) %></span>
 
  24               <%= link_to t(".my traces"), :controller => "traces", :action => "mine" %>
 
  25               <span class='badge count-number'><%= number_with_delimiter(current_user.traces.size) %></span>
 
  28               <%= link_to t(".my diary"), :controller => "diary_entries", :action => "index", :display_name => current_user.display_name %>
 
  29               <span class='badge count-number'><%= number_with_delimiter(current_user.diary_entries.size) %></span>
 
  32               <%= link_to t(".my comments"), user_diary_comments_path(current_user) %>
 
  33               <span class='badge count-number'><%= number_with_delimiter(current_user.diary_comments.size) %></span>
 
  36               <%= link_to t(".my_account"), account_path %>
 
  39             <% if current_user.blocks.exists? %>
 
  41                 <%= link_to t(".blocks on me"), user_received_blocks_path(current_user) %>
 
  42                 <span class='badge count-number'><%= number_with_delimiter(current_user.blocks.active.size) %></span>
 
  46             <% if can?(:create, UserBlock) and current_user.blocks_created.exists? %>
 
  48                 <%= link_to t(".blocks by me"), user_issued_blocks_path(current_user) %>
 
  49                 <span class='badge count-number'><%= number_with_delimiter(current_user.blocks_created.active.size) %></span>
 
  57         <!-- Displaying user profile page to the public -->
 
  58         <nav class='secondary-actions'>
 
  62               <%= link_to t(".edits"), :controller => "changesets", :action => "index", :display_name => @user.display_name %>
 
  63               <span class='badge count-number'><%= number_with_delimiter(@user.changesets.size) %></span>
 
  66               <%= link_to t(".notes"), user_notes_path(@user) %>
 
  67               <span class='badge count-number'><%= number_with_delimiter(@user.note_comments.size) %></span>
 
  70               <%= link_to t(".traces"), :controller => "traces", :action => "index", :display_name => @user.display_name %>
 
  71               <span class='badge count-number'><%= number_with_delimiter(@user.traces.size) %></span>
 
  74             <!-- Displaying another user's profile page -->
 
  77               <%= link_to t(".send message"), new_message_path(@user) %>
 
  80               <%= link_to t(".diary"), :controller => "diary_entries", :action => "index", :display_name => @user.display_name %>
 
  81               <span class='badge count-number'><%= number_with_delimiter(@user.diary_entries.size) %></span>
 
  84               <%= link_to t(".comments"), user_diary_comments_path(@user) %>
 
  85               <span class='badge count-number'><%= number_with_delimiter(@user.diary_comments.size) %></span>
 
  89                 <% if current_user.follows?(@user) %>
 
  90                   <%= link_to t(".unfollow"), follow_path(@user), :method => :delete %>
 
  92                   <%= link_to t(".follow"), follow_path(@user), :method => :post %>
 
  97             <% if @user.blocks.exists? %>
 
  99                 <%= link_to t(".block_history"), user_received_blocks_path(@user) %>
 
 100                 <span class='badge count-number'><%= number_with_delimiter(@user.blocks.active.size) %></span>
 
 104             <% if @user.moderator? and @user.blocks_created.exists? %>
 
 106                 <%= link_to t(".moderator_history"), user_issued_blocks_path(@user) %>
 
 107                 <span class='badge count-number'><%= number_with_delimiter(@user.blocks_created.active.size) %></span>
 
 111             <% if can?(:destroy, UserBlock) and @user.blocks.active.exists? %>
 
 113                 <%= link_to t(".revoke_all_blocks"), edit_user_received_blocks_path(@user) %>
 
 117             <% if can?(:create, UserBlock) %>
 
 119                 <%= link_to t(".create_block"), new_user_block_path(@user) %>
 
 123             <% if current_user and @user.id != current_user.id %>
 
 125                 <%= report_link(t(".report"), @user) %>
 
 129             <% if current_user and UserMute.exists?(owner: current_user, subject: @user) %>
 
 131               <%= link_to t(".destroy_mute"), user_mute_path(@user), :method => :delete %>
 
 133             <% elsif current_user %>
 
 135               <%= link_to t(".create_mute"), user_mute_path(@user), :method => :post, :title => t("user_mutes.index.user_mute_explainer") %>
 
 142       <div class='text-body-secondary'>
 
 144           <dl class="list-inline">
 
 145             <% if @user.home_location_name&.strip.present? %>
 
 146               <dt class="list-inline-item m-0 align-text-bottom">
 
 147                 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-geo-alt-fill" viewBox="0 0 16 16">
 
 148                   <path d="M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10m0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6">
 
 149                     <title><%= t ".home location" %></title>
 
 153               <dd class="list-inline-item"><%= @user.home_location_name %></dd>
 
 155             <% if @user.company&.strip.present? %>
 
 156               <dt class="list-inline-item m-0 align-text-bottom">
 
 157                 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-buildings-fill" viewBox="0 0 16 16">
 
 158                   <path d="M15 .5a.5.5 0 0 0-.724-.447l-8 4A.5.5 0 0 0 6 4.5v3.14L.342 9.526A.5.5 0 0 0 0 10v5.5a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5V14h1v1.5a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5zM2 11h1v1H2zm2 0h1v1H4zm-1 2v1H2v-1zm1 0h1v1H4zm9-10v1h-1V3zM8 5h1v1H8zm1 2v1H8V7zM8 9h1v1H8zm2 0h1v1h-1zm-1 2v1H8v-1zm1 0h1v1h-1zm3-2v1h-1V9zm-1 2h1v1h-1zm-2-4h1v1h-1zm3 0v1h-1V7zm-2-2v1h-1V5zm1 0h1v1h-1z">
 
 159                     <title><%= t ".company" %></title>
 
 163               <dd class="list-inline-item" title="<%= t ".company tooltip" %>"><%= @user.company %></dd>
 
 165             <dt class="list-inline-item m-0"><%= t ".mapper since" %></dt>
 
 166             <dd class="list-inline-item"><%= l @user.created_at.to_date, :format => :long %></dd>
 
 167             <dt class="list-inline-item m-0"><%= t ".last map edit" %></dt>
 
 168             <dd class="list-inline-item"><%= l @user.changesets.first&.created_at&.to_date, :format => :long, :default => t(".no activity yet") %></dd>
 
 169             <% unless @user.terms_agreed %>
 
 170               <dt class="list-inline-item m-0"><%= t ".ct status" %></dt>
 
 171               <dd class="list-inline-item">
 
 172                 <% if @user.terms_seen? -%>
 
 173                   <%= t ".ct declined" %>
 
 175                   <%= t ".ct undecided" %>
 
 179             <% if current_user&.moderator? || current_user&.administrator? %>
 
 180               <dt class="list-inline-item m-0"><%= t ".uid" %></dt>
 
 181               <dd class="list-inline-item"><%= link_to @user.id, api_user_path(:id => @user.id) %></dd>
 
 187       <% if can?(:update, :user_status) %>
 
 188         <nav class='secondary-actions'>
 
 190             <% if @user.may_activate? %>
 
 192                 <%= link_to t(".activate_user"), user_status_path(@user, :event => "activate"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 196             <% if @user.may_unsuspend? %>
 
 198                 <%= link_to t(".unsuspend_user"), user_status_path(@user, :event => "unsuspend"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 202             <% if @user.may_confirm? %>
 
 204                 <%= link_to t(".confirm_user"), user_status_path(@user, :event => "confirm"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 208             <% if @user.may_unconfirm? %>
 
 210                 <%= link_to t(".unconfirm_user"), user_status_path(@user, :event => "unconfirm"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 214             <% if @user.may_hide? %>
 
 216                 <%= link_to t(".hide_user"), user_status_path(@user, :event => "hide"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 220             <% if @user.may_unhide? %>
 
 222                 <%= link_to t(".unhide_user"), user_status_path(@user, :event => "unhide"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 226             <% if @user.may_soft_destroy? %>
 
 228                 <%= link_to t(".delete_user"), user_status_path(@user, :event => "soft_destroy"), :method => :put, :data => { :confirm => t(".confirm") } %>
 
 235       <% if current_user and current_user.administrator? -%>
 
 236         <div class='text-body-secondary'>
 
 238             <dl class="list-inline">
 
 239               <dt class="list-inline-item m-0"><%= t ".email address" %></dt>
 
 240               <dd class="list-inline-item"><%= @user.email %></dd>
 
 241               <% unless @user.creation_address.nil? -%>
 
 242                 <dt class="list-inline-item m-0"><%= t ".created from" %></dt>
 
 243                 <dd class="list-inline-item"><%= link_to @user.creation_address, users_list_path(:ip => @user.creation_address) %></dd>
 
 245               <dt class="list-inline-item m-0"><%= t ".status" %></dt>
 
 246               <dd class="list-inline-item"><%= link_to @user.status.capitalize, users_list_path(:status => @user.status) %></dd>
 
 247               <dt class="list-inline-item m-0"><%= t ".spam score" %></dt>
 
 248               <dd class="list-inline-item"><%= @user.spam_score %></dd>
 
 256 <% if @user.social_links.empty? %>
 
 257   <div class="richtext text-break"><%= @user.description.to_html %></div>
 
 260     <div class="col-sm-3">
 
 261       <%= render "social_links/show",
 
 262                  :social_links => @user.social_links %>
 
 264     <div class="col-sm-9">
 
 265       <div class="richtext text-break"><%= @user.description.to_html %></div>
 
 270 <% if @heatmap_frame %>
 
 271   <%= turbo_frame_tag "#{dom_id(@user)}_heatmap", :src => user_heatmap_path(@user), :data => { :turbo => false } %>
 
 274 <%= render :partial => "diary_entries/profile_diaries", :locals => { :diary_entries => @user.diary_entries.visible.order(:created_at => :desc).limit(4) } %>
 
 276 <% if current_user and @user.id == current_user.id %>
 
 278     <%= link_to t(".edit_profile"), profile_path, :class => "btn btn-outline-primary" %>