1 <% content_for :head do %>
2 <%= javascript_include_tag "heatmap" %>
4 <% content_for :heading do %>
6 <div class="col-sm-auto">
7 <% if current_user and @user == current_user %>
8 <%= link_to user_image(@user), profile_image_path, :class => "d-block", :title => t(".change_image") %>
10 <%= user_image @user %>
15 <%= @user.display_name %>
16 <%= render "role_icons" %>
18 <% if current_user and @user.id == current_user.id %>
19 <!-- Displaying user's own profile page -->
20 <nav class='secondary-actions'>
23 <%= link_to t(".my edits"), :controller => "changesets", :action => "index", :display_name => current_user.display_name %>
24 <span class='badge count-number'><%= number_with_delimiter(current_user.changesets.size) %></span>
27 <%= link_to t(".my notes"), user_notes_path(current_user) %>
28 <span class='badge count-number'><%= number_with_delimiter(current_user.note_comments.size) %></span>
31 <%= link_to t(".my traces"), :controller => "traces", :action => "mine" %>
32 <span class='badge count-number'><%= number_with_delimiter(current_user.traces.size) %></span>
35 <%= link_to t(".my diary"), :controller => "diary_entries", :action => "index", :display_name => current_user.display_name %>
36 <span class='badge count-number'><%= number_with_delimiter(current_user.diary_entries.size) %></span>
39 <%= link_to t(".my comments"), user_diary_comments_path(current_user) %>
40 <span class='badge count-number'><%= number_with_delimiter(current_user.diary_comments.size) %></span>
43 <%= link_to t(".my_account"), account_path %>
46 <% if current_user.blocks.exists? %>
48 <%= link_to t(".blocks on me"), user_received_blocks_path(current_user) %>
49 <span class='badge count-number'><%= number_with_delimiter(current_user.blocks.active.size) %></span>
53 <% if can?(:create, UserBlock) and current_user.blocks_created.exists? %>
55 <%= link_to t(".blocks by me"), user_issued_blocks_path(current_user) %>
56 <span class='badge count-number'><%= number_with_delimiter(current_user.blocks_created.active.size) %></span>
64 <!-- Displaying user profile page to the public -->
65 <nav class='secondary-actions'>
69 <%= link_to t(".edits"), :controller => "changesets", :action => "index", :display_name => @user.display_name %>
70 <span class='badge count-number'><%= number_with_delimiter(@user.changesets.size) %></span>
73 <%= link_to t(".notes"), user_notes_path(@user) %>
74 <span class='badge count-number'><%= number_with_delimiter(@user.note_comments.size) %></span>
77 <%= link_to t(".traces"), :controller => "traces", :action => "index", :display_name => @user.display_name %>
78 <span class='badge count-number'><%= number_with_delimiter(@user.traces.size) %></span>
81 <!-- Displaying another user's profile page -->
84 <%= link_to t(".send message"), new_message_path(@user) %>
87 <%= link_to t(".diary"), :controller => "diary_entries", :action => "index", :display_name => @user.display_name %>
88 <span class='badge count-number'><%= number_with_delimiter(@user.diary_entries.size) %></span>
91 <%= link_to t(".comments"), user_diary_comments_path(@user) %>
92 <span class='badge count-number'><%= number_with_delimiter(@user.diary_comments.size) %></span>
96 <% if current_user.follows?(@user) %>
97 <%= link_to t(".unfollow"), follow_path(@user), :method => :delete %>
99 <%= link_to t(".follow"), follow_path(@user), :method => :post %>
104 <% if @user.blocks.exists? %>
106 <%= link_to t(".block_history"), user_received_blocks_path(@user) %>
107 <span class='badge count-number'><%= number_with_delimiter(@user.blocks.active.size) %></span>
111 <% if @user.moderator? and @user.blocks_created.exists? %>
113 <%= link_to t(".moderator_history"), user_issued_blocks_path(@user) %>
114 <span class='badge count-number'><%= number_with_delimiter(@user.blocks_created.active.size) %></span>
118 <% if can?(:destroy, UserBlock) and @user.blocks.active.exists? %>
120 <%= link_to t(".revoke_all_blocks"), edit_user_received_blocks_path(@user) %>
124 <% if can?(:create, UserBlock) %>
126 <%= link_to t(".create_block"), new_user_block_path(@user) %>
130 <% if current_user and @user.id != current_user.id %>
132 <%= report_link(t(".report"), @user) %>
136 <% if current_user and UserMute.exists?(owner: current_user, subject: @user) %>
138 <%= link_to t(".destroy_mute"), user_mute_path(@user), :method => :delete %>
140 <% elsif current_user %>
142 <%= link_to t(".create_mute"), user_mute_path(@user), :method => :post, :title => t("user_mutes.index.user_mute_explainer") %>
149 <div class='text-body-secondary'>
151 <dl class="list-inline">
152 <dt class="list-inline-item m-0"><%= t ".mapper since" %></dt>
153 <dd class="list-inline-item"><%= l @user.created_at.to_date, :format => :long %></dd>
154 <dt class="list-inline-item m-0"><%= t ".last map edit" %></dt>
155 <dd class="list-inline-item"><%= l @user.changesets.first&.created_at&.to_date, :format => :long, :default => t(".no activity yet") %></dd>
156 <% unless @user.terms_agreed %>
157 <dt class="list-inline-item m-0"><%= t ".ct status" %></dt>
158 <dd class="list-inline-item">
159 <% if @user.terms_seen? -%>
160 <%= t ".ct declined" %>
162 <%= t ".ct undecided" %>
166 <% if current_user&.moderator? || current_user&.administrator? %>
167 <dt class="list-inline-item m-0"><%= t ".uid" %></dt>
168 <dd class="list-inline-item"><%= link_to @user.id, api_user_path(:id => @user.id) %></dd>
174 <% if can?(:update, :user_status) %>
175 <nav class='secondary-actions'>
177 <% if @user.may_activate? %>
179 <%= link_to t(".activate_user"), user_status_path(@user, :event => "activate"), :method => :put, :data => { :confirm => t(".confirm") } %>
183 <% if @user.may_unsuspend? %>
185 <%= link_to t(".unsuspend_user"), user_status_path(@user, :event => "unsuspend"), :method => :put, :data => { :confirm => t(".confirm") } %>
189 <% if @user.may_confirm? %>
191 <%= link_to t(".confirm_user"), user_status_path(@user, :event => "confirm"), :method => :put, :data => { :confirm => t(".confirm") } %>
195 <% if @user.may_unconfirm? %>
197 <%= link_to t(".unconfirm_user"), user_status_path(@user, :event => "unconfirm"), :method => :put, :data => { :confirm => t(".confirm") } %>
201 <% if @user.may_hide? %>
203 <%= link_to t(".hide_user"), user_status_path(@user, :event => "hide"), :method => :put, :data => { :confirm => t(".confirm") } %>
207 <% if @user.may_unhide? %>
209 <%= link_to t(".unhide_user"), user_status_path(@user, :event => "unhide"), :method => :put, :data => { :confirm => t(".confirm") } %>
213 <% if @user.may_soft_destroy? %>
215 <%= link_to t(".delete_user"), user_status_path(@user, :event => "soft_destroy"), :method => :put, :data => { :confirm => t(".confirm") } %>
222 <% if current_user and current_user.administrator? -%>
223 <div class='text-body-secondary'>
225 <dl class="list-inline">
226 <dt class="list-inline-item m-0"><%= t ".email address" %></dt>
227 <dd class="list-inline-item"><%= @user.email %></dd>
228 <% unless @user.creation_address.nil? -%>
229 <dt class="list-inline-item m-0"><%= t ".created from" %></dt>
230 <dd class="list-inline-item"><%= link_to @user.creation_address, users_list_path(:ip => @user.creation_address) %></dd>
232 <dt class="list-inline-item m-0"><%= t ".status" %></dt>
233 <dd class="list-inline-item"><%= link_to @user.status.capitalize, users_list_path(:status => @user.status) %></dd>
234 <dt class="list-inline-item m-0"><%= t ".spam score" %></dt>
235 <dd class="list-inline-item"><%= @user.spam_score %></dd>
244 <% owned = current_user && @user == current_user %>
245 <% if @user.home_location_name&.strip.present? || @user.company&.strip.present? || !@user.social_links.empty? || owned %>
247 <div class="col-sm-3">
248 <%= render "sidebar_section", :edit_title => t(".change_image"),
249 :edit_path => profile_image_path do %>
252 <%= render "sidebar_section", :present => @user.home_location_name&.strip.present?,
253 :edit_title => t(".edit_location"),
254 :edit_path => profile_location_path do %>
255 <div class="icon-link mw-100">
256 <%= inline_svg_tag "icons/home_location.svg", :class => "flex-shrink-0", :title => t(".home_location") %>
257 <span class="text-truncate">
258 <%= @user.home_location_name %>
263 <%= render "sidebar_section", :present => @user.company&.strip.present?,
264 :edit_title => t(".edit_company"),
265 :edit_path => profile_company_path do %>
266 <div class="icon-link mw-100">
267 <%= inline_svg_tag "icons/company.svg", :class => "flex-shrink-0", :title => t(".company") %>
268 <%= tag.span :class => "text-truncate", :title => t(".company_tooltip") do %>
274 <%= render "sidebar_section", :present => !@user.social_links.empty?,
275 :edit_title => t(".edit_links"),
276 :edit_path => profile_links_path do %>
277 <%= render "social_links/show", :social_links => @user.social_links %>
282 <%= tag.button t(".edit_profile_details"), :type => "button",
283 :class => "btn btn-sm btn-outline-primary w-100 overflow-hidden",
284 :data => { :bs_toggle => "collapse", :bs_target => "[data-sidebar-edit]" } %>
288 <div class="col-sm-9">
289 <div class="richtext text-break"><%= @user.description.to_html %></div>
292 <%= link_to t(".edit_description"), profile_description_path, :class => "btn btn-outline-primary" %>
298 <div class="richtext text-break"><%= @user.description.to_html %></div>
301 <% if @heatmap_frame %>
302 <%= turbo_frame_tag "#{dom_id(@user)}_heatmap", :src => user_heatmap_path(@user), :data => { :turbo => false } %>
305 <%= render :partial => "diary_entries/profile_diaries", :locals => { :diary_entries => @user.diary_entries.visible.order(:created_at => :desc).limit(4) } %>