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 <dt class="list-inline-item m-0"><%= t ".mapper since" %></dt>
146 <dd class="list-inline-item"><%= l @user.created_at.to_date, :format => :long %></dd>
147 <dt class="list-inline-item m-0"><%= t ".last map edit" %></dt>
148 <dd class="list-inline-item"><%= l @user.changesets.first&.created_at&.to_date, :format => :long, :default => t(".no activity yet") %></dd>
149 <% unless @user.terms_agreed %>
150 <dt class="list-inline-item m-0"><%= t ".ct status" %></dt>
151 <dd class="list-inline-item">
152 <% if @user.terms_seen? -%>
153 <%= t ".ct declined" %>
155 <%= t ".ct undecided" %>
159 <% if current_user&.moderator? || current_user&.administrator? %>
160 <dt class="list-inline-item m-0"><%= t ".uid" %></dt>
161 <dd class="list-inline-item"><%= link_to @user.id, api_user_path(:id => @user.id) %></dd>
167 <% if can?(:update, :user_status) %>
168 <nav class='secondary-actions'>
170 <% if @user.may_activate? %>
172 <%= link_to t(".activate_user"), user_status_path(@user, :event => "activate"), :method => :put, :data => { :confirm => t(".confirm") } %>
176 <% if @user.may_unsuspend? %>
178 <%= link_to t(".unsuspend_user"), user_status_path(@user, :event => "unsuspend"), :method => :put, :data => { :confirm => t(".confirm") } %>
182 <% if @user.may_confirm? %>
184 <%= link_to t(".confirm_user"), user_status_path(@user, :event => "confirm"), :method => :put, :data => { :confirm => t(".confirm") } %>
188 <% if @user.may_unconfirm? %>
190 <%= link_to t(".unconfirm_user"), user_status_path(@user, :event => "unconfirm"), :method => :put, :data => { :confirm => t(".confirm") } %>
194 <% if @user.may_hide? %>
196 <%= link_to t(".hide_user"), user_status_path(@user, :event => "hide"), :method => :put, :data => { :confirm => t(".confirm") } %>
200 <% if @user.may_unhide? %>
202 <%= link_to t(".unhide_user"), user_status_path(@user, :event => "unhide"), :method => :put, :data => { :confirm => t(".confirm") } %>
206 <% if @user.may_soft_destroy? %>
208 <%= link_to t(".delete_user"), user_status_path(@user, :event => "soft_destroy"), :method => :put, :data => { :confirm => t(".confirm") } %>
215 <% if current_user and current_user.administrator? -%>
216 <div class='text-body-secondary'>
218 <dl class="list-inline">
219 <dt class="list-inline-item m-0"><%= t ".email address" %></dt>
220 <dd class="list-inline-item"><%= @user.email %></dd>
221 <% unless @user.creation_address.nil? -%>
222 <dt class="list-inline-item m-0"><%= t ".created from" %></dt>
223 <dd class="list-inline-item"><%= link_to @user.creation_address, users_list_path(:ip => @user.creation_address) %></dd>
225 <dt class="list-inline-item m-0"><%= t ".status" %></dt>
226 <dd class="list-inline-item"><%= link_to @user.status.capitalize, users_list_path(:status => @user.status) %></dd>
227 <dt class="list-inline-item m-0"><%= t ".spam score" %></dt>
228 <dd class="list-inline-item"><%= @user.spam_score %></dd>
237 <% owned = current_user && @user == current_user %>
238 <% if @user.home_location_name&.strip.present? || @user.company&.strip.present? || !@user.social_links.empty? || owned %>
240 <div class="col-sm-3">
241 <%= render "sidebar_section", :present => @user.home_location_name&.strip.present? do %>
242 <div class="icon-link mw-100">
243 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16" class="flex-shrink-0">
244 <title><%= t ".home_location" %></title>
245 <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" />
247 <span class="text-truncate">
248 <%= @user.home_location_name %>
253 <%= render "sidebar_section", :present => @user.company&.strip.present? do %>
254 <div class="icon-link mw-100">
255 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16" class="flex-shrink-0">
256 <title><%= t ".company" %></title>
257 <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" />
259 <%= tag.span :class => "text-truncate", :title => t(".company_tooltip") do %>
265 <%= render "sidebar_section", :present => !@user.social_links.empty?,
266 :edit_title => t(".edit_links"),
267 :edit_path => profile_links_path do %>
268 <%= render "social_links/show", :social_links => @user.social_links %>
273 <%= tag.button t(".edit_profile_details"), :type => "button",
274 :class => "btn btn-sm btn-outline-primary w-100 overflow-hidden",
275 :data => { :bs_toggle => "collapse", :bs_target => "[data-sidebar-edit]" } %>
279 <div class="col-sm-9">
280 <div class="richtext text-break"><%= @user.description.to_html %></div>
283 <%= link_to t(".edit_description"), profile_description_path, :class => "btn btn-outline-primary" %>
289 <div class="richtext text-break"><%= @user.description.to_html %></div>
292 <% if @heatmap_frame %>
293 <%= turbo_frame_tag "#{dom_id(@user)}_heatmap", :src => user_heatmap_path(@user), :data => { :turbo => false } %>
296 <%= render :partial => "diary_entries/profile_diaries", :locals => { :diary_entries => @user.diary_entries.visible.order(:created_at => :desc).limit(4) } %>
300 <%= link_to t(".edit_profile"), profile_description_path, :class => "btn btn-outline-primary" %>