<% content_for :head do %> <%= javascript_include_tag "heatmap" %> <% end %> <% content_for :heading do %>
<% if current_user and @user == current_user %> <%= link_to user_image(@user), profile_image_path, :class => "d-block", :title => t(".change_image") %> <% else %> <%= user_image @user %> <% end %>

<%= @user.display_name %> <%= render "role_icons" %>

<% if current_user and @user.id == current_user.id %> <% else %> <% end %>
<%= t ".mapper since" %>
<%= l @user.created_at.to_date, :format => :long %>
<%= t ".last map edit" %>
<%= l @user.changesets.first&.created_at&.to_date, :format => :long, :default => t(".no activity yet") %>
<% unless @user.terms_agreed %>
<%= t ".ct status" %>
<% if @user.terms_seen? -%> <%= t ".ct declined" %> <% else -%> <%= t ".ct undecided" %> <% end -%>
<% end -%> <% if current_user&.moderator? || current_user&.administrator? %>
<%= t ".uid" %>
<%= link_to @user.id, api_user_path(:id => @user.id) %>
<% end -%>
<% if can?(:update, :user_status) %> <% end %> <% if current_user and current_user.administrator? -%>
<%= t ".email address" %>
<%= @user.email %>
<% unless @user.creation_address.nil? -%>
<%= t ".created from" %>
<%= link_to @user.creation_address, users_list_path(:ip => @user.creation_address) %>
<% end -%>
<%= t ".status" %>
<%= link_to @user.status.capitalize, users_list_path(:status => @user.status) %>
<%= t ".spam score" %>
<%= @user.spam_score %>
<% end -%>
<% end %> <% owned = current_user && @user == current_user %> <% if @user.home_location_name&.strip.present? || @user.company&.strip.present? || !@user.social_links.empty? || owned %>
<%= render "sidebar_section", :edit_title => t(".change_image"), :edit_path => profile_image_path do %> <% end %> <%= render "sidebar_section", :present => @user.home_location_name&.strip.present?, :edit_title => t(".edit_location"), :edit_path => profile_location_path do %> <% end %> <%= render "sidebar_section", :present => @user.company&.strip.present?, :edit_title => t(".edit_company"), :edit_path => profile_company_path do %> <% end %> <%= render "sidebar_section", :present => !@user.social_links.empty?, :edit_title => t(".edit_links"), :edit_path => profile_links_path do %> <%= render "social_links/show", :social_links => @user.social_links %> <% end %> <% if owned %>
<%= tag.button t(".edit_profile_details"), :type => "button", :class => "btn btn-sm btn-outline-primary w-100 overflow-hidden", :data => { :bs_toggle => "collapse", :bs_target => "[data-sidebar-edit]" } %>
<% end %>
<%= @user.description.to_html %>
<% if owned %>
<%= link_to t(".edit_description"), profile_description_path, :class => "btn btn-outline-primary" %>
<% end %>
<% else %>
<%= @user.description.to_html %>
<% end %> <% if @heatmap_frame %> <%= turbo_frame_tag "#{dom_id(@user)}_heatmap", :src => user_heatmap_path(@user), :data => { :turbo => false } %> <% end %> <%= render :partial => "diary_entries/profile_diaries", :locals => { :diary_entries => @user.diary_entries.visible.order(:created_at => :desc).limit(4) } %>