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 <% if @user.home_location_name&.strip.present? %>
147 <dt class="list-inline-item m-0 align-text-bottom">
148 <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">
149 <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">
150 <title><%= t ".home location" %></title>
154 <dd class="list-inline-item"><%= @user.home_location_name %></dd>
156 <dt class="list-inline-item m-0"><%= t ".mapper since" %></dt>
157 <dd class="list-inline-item"><%= l @user.created_at.to_date, :format => :long %></dd>
158 <dt class="list-inline-item m-0"><%= t ".last map edit" %></dt>
159 <dd class="list-inline-item"><%= l @user.changesets.first&.created_at&.to_date, :format => :long, :default => t(".no activity yet") %></dd>
160 <% unless @user.terms_agreed %>
161 <dt class="list-inline-item m-0"><%= t ".ct status" %></dt>
162 <dd class="list-inline-item">
163 <% if @user.terms_seen? -%>
164 <%= t ".ct declined" %>
166 <%= t ".ct undecided" %>
170 <% if current_user&.moderator? || current_user&.administrator? %>
171 <dt class="list-inline-item m-0"><%= t ".uid" %></dt>
172 <dd class="list-inline-item"><%= link_to @user.id, api_user_path(:id => @user.id) %></dd>
178 <% if can?(:update, :user_status) %>
179 <nav class='secondary-actions'>
181 <% if @user.may_activate? %>
183 <%= link_to t(".activate_user"), user_status_path(@user, :event => "activate"), :method => :put, :data => { :confirm => t(".confirm") } %>
187 <% if @user.may_unsuspend? %>
189 <%= link_to t(".unsuspend_user"), user_status_path(@user, :event => "unsuspend"), :method => :put, :data => { :confirm => t(".confirm") } %>
193 <% if @user.may_confirm? %>
195 <%= link_to t(".confirm_user"), user_status_path(@user, :event => "confirm"), :method => :put, :data => { :confirm => t(".confirm") } %>
199 <% if @user.may_unconfirm? %>
201 <%= link_to t(".unconfirm_user"), user_status_path(@user, :event => "unconfirm"), :method => :put, :data => { :confirm => t(".confirm") } %>
205 <% if @user.may_hide? %>
207 <%= link_to t(".hide_user"), user_status_path(@user, :event => "hide"), :method => :put, :data => { :confirm => t(".confirm") } %>
211 <% if @user.may_unhide? %>
213 <%= link_to t(".unhide_user"), user_status_path(@user, :event => "unhide"), :method => :put, :data => { :confirm => t(".confirm") } %>
217 <% if @user.may_soft_destroy? %>
219 <%= link_to t(".delete_user"), user_status_path(@user, :event => "soft_destroy"), :method => :put, :data => { :confirm => t(".confirm") } %>
226 <% if current_user and current_user.administrator? -%>
227 <div class='text-body-secondary'>
229 <dl class="list-inline">
230 <dt class="list-inline-item m-0"><%= t ".email address" %></dt>
231 <dd class="list-inline-item"><%= @user.email %></dd>
232 <% unless @user.creation_address.nil? -%>
233 <dt class="list-inline-item m-0"><%= t ".created from" %></dt>
234 <dd class="list-inline-item"><%= link_to @user.creation_address, users_list_path(:ip => @user.creation_address) %></dd>
236 <dt class="list-inline-item m-0"><%= t ".status" %></dt>
237 <dd class="list-inline-item"><%= link_to @user.status.capitalize, users_list_path(:status => @user.status) %></dd>
238 <dt class="list-inline-item m-0"><%= t ".spam score" %></dt>
239 <dd class="list-inline-item"><%= @user.spam_score %></dd>
248 <div class="richtext text-break"><%= @user.description.to_html %></div>
250 <% if @heatmap_data.present? %>
252 <div class="col overflow-auto">
253 <div class="heatmap-wrapper d-flex align-items-start">
255 <ul class="list-unstyled d-flex flex-column justify-content-between ch-domain-text mb-0 mt-4">
257 <li><%= t("date.abbr_day_names")[1] %></li>
259 <li><%= t("date.abbr_day_names")[3] %></li>
261 <li><%= t("date.abbr_day_names")[5] %></li>
265 <div id="cal-heatmap" class="ms-2"
266 data-heatmap="<%= @heatmap_data.to_json %>" data-display-name="<%= @user.display_name %>">
273 <% if current_user and @user.id == current_user.id %>
275 <%= link_to t(".edit_profile"), edit_profile_path, :class => "btn btn-outline-primary" %>