1 <% content_for :heading do %>
3 <div class="col-sm-auto">
4 <%= user_image @user %>
7 <h1><%= @user.display_name %> <%= role_icons(@user) %></h1>
8 <% if current_user and @user.id == current_user.id %>
9 <!-- Displaying user's own profile page -->
10 <nav class='secondary-actions'>
13 <%= link_to t(".my edits"), :controller => "changesets", :action => "index", :display_name => current_user.display_name %>
14 <span class='badge count-number'><%= number_with_delimiter(current_user.changesets.size) %></span>
17 <%= link_to t(".my notes"), user_notes_path(current_user) %>
18 <span class='badge count-number'><%= number_with_delimiter(current_user.note_comments.size) %></span>
21 <%= link_to t(".my traces"), :controller => "traces", :action => "mine" %>
22 <span class='badge count-number'><%= number_with_delimiter(current_user.traces.size) %></span>
25 <%= link_to t(".my diary"), :controller => "diary_entries", :action => "index", :display_name => current_user.display_name %>
26 <span class='badge count-number'><%= number_with_delimiter(current_user.diary_entries.size) %></span>
29 <%= link_to t(".my comments"), diary_comments_path(current_user) %>
30 <span class='badge count-number'><%= number_with_delimiter(current_user.diary_comments.size) %></span>
33 <%= link_to t(".my settings"), edit_account_path %>
36 <% if current_user.blocks.exists? %>
38 <%= link_to t(".blocks on me"), user_blocks_on_path(current_user) %>
39 <span class='badge count-number'><%= number_with_delimiter(current_user.blocks.active.size) %></span>
43 <% if can?(:create, UserBlock) and current_user.blocks_created.exists? %>
45 <%= link_to t(".blocks by me"), user_blocks_by_path(current_user) %>
46 <span class='badge count-number'><%= number_with_delimiter(current_user.blocks_created.active.size) %></span>
54 <!-- Displaying user profile page to the public -->
55 <nav class='secondary-actions'>
59 <%= link_to t(".edits"), :controller => "changesets", :action => "index", :display_name => @user.display_name %>
60 <span class='badge count-number'><%= number_with_delimiter(@user.changesets.size) %></span>
63 <%= link_to t(".notes"), user_notes_path(@user) %>
64 <span class='badge count-number'><%= number_with_delimiter(@user.note_comments.size) %></span>
67 <%= link_to t(".traces"), :controller => "traces", :action => "index", :display_name => @user.display_name %>
68 <span class='badge count-number'><%= number_with_delimiter(@user.traces.size) %></span>
71 <!-- Displaying another user's profile page -->
74 <%= link_to t(".send message"), new_message_path(@user) %>
77 <%= link_to t(".diary"), :controller => "diary_entries", :action => "index", :display_name => @user.display_name %>
78 <span class='badge count-number'><%= number_with_delimiter(@user.diary_entries.size) %></span>
81 <%= link_to t(".comments"), diary_comments_path(@user) %>
82 <span class='badge count-number'><%= number_with_delimiter(@user.diary_comments.size) %></span>
85 <% if current_user and current_user.friends_with?(@user) %>
86 <%= link_to t(".remove as friend"), remove_friend_path(:display_name => @user.display_name), :method => :post %>
87 <% elsif current_user %>
88 <%= link_to t(".add as friend"), make_friend_path(:display_name => @user.display_name), :method => :post %>
90 <%= link_to t(".add as friend"), make_friend_path(:display_name => @user.display_name) %>
94 <% if @user.blocks.exists? %>
96 <%= link_to t(".block_history"), user_blocks_on_path(@user) %>
97 <span class='badge count-number'><%= number_with_delimiter(@user.blocks.active.size) %></span>
101 <% if @user.moderator? and @user.blocks_created.exists? %>
103 <%= link_to t(".moderator_history"), user_blocks_by_path(@user) %>
104 <span class='badge count-number'><%= number_with_delimiter(@user.blocks_created.active.size) %></span>
108 <% if can?(:revoke_all, UserBlock) and @user.blocks.active.exists? %>
110 <%= link_to t(".revoke_all_blocks"), revoke_all_user_blocks_path(@user) %>
114 <% if can?(:create, UserBlock) %>
116 <%= link_to t(".create_block"), new_user_block_path(@user) %>
120 <% if current_user and @user.id != current_user.id %>
122 <%= report_link(t(".report"), @user) %>
126 <% if current_user and UserMute.exists?(owner: current_user, subject: @user) %>
128 <%= link_to t(".destroy_mute"), user_mute_path(@user), :method => :delete %>
130 <% elsif current_user %>
132 <%= link_to t(".create_mute"), user_mute_path(@user), :method => :post, :title => t("user_mutes.index.user_mute_explainer") %>
139 <div class='text-body-secondary'>
141 <dl class="list-inline">
142 <dt class="list-inline-item m-0"><%= t ".mapper since" %></dt>
143 <dd class="list-inline-item"><%= l @user.created_at.to_date, :format => :long %></dd>
144 <dt class="list-inline-item m-0"><%= t ".last map edit" %></dt>
145 <dd class="list-inline-item"><%= l @user.changesets.first&.created_at&.to_date, :format => :long, :default => t(".no activity yet") %></dd>
146 <% unless @user.terms_agreed %>
147 <dt class="list-inline-item m-0"><%= t ".ct status" %></dt>
148 <dd class="list-inline-item">
149 <% if @user.terms_seen? -%>
150 <%= t ".ct declined" %>
152 <%= t ".ct undecided" %>
156 <% if current_user&.moderator? || current_user&.administrator? %>
157 <dt class="list-inline-item m-0"><%= t ".uid" %></dt>
158 <dd class="list-inline-item"><%= link_to @user.id, api_user_path(:id => @user.id) %></dd>
164 <% if can?(:set_status, User) || can?(:destroy, User) %>
165 <nav class='secondary-actions'>
166 <ul class='clearfix'>
167 <% if can? :set_status, User %>
168 <% if @user.may_activate? %>
170 <%= link_to t(".activate_user"), set_status_user_path(:event => "activate", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
174 <% if @user.may_unsuspend? %>
176 <%= link_to t(".unsuspend_user"), set_status_user_path(:event => "unsuspend", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
180 <% if @user.may_confirm? %>
182 <%= link_to t(".confirm_user"), set_status_user_path(:event => "confirm", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
186 <% if @user.may_unconfirm? %>
188 <%= link_to t(".unconfirm_user"), set_status_user_path(:event => "unconfirm", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
192 <% if @user.may_hide? %>
194 <%= link_to t(".hide_user"), set_status_user_path(:event => "hide", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
198 <% if @user.may_unhide? %>
200 <%= link_to t(".unhide_user"), set_status_user_path(:event => "unhide", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
205 <% if can?(:destroy, User) && @user.may_soft_destroy? %>
207 <%= link_to t(".delete_user"), user_path(:display_name => @user.display_name), :method => :delete, :data => { :confirm => t(".confirm") } %>
214 <% if current_user and current_user.administrator? -%>
215 <div class='text-body-secondary'>
217 <dl class="list-inline">
218 <dt class="list-inline-item m-0"><%= t ".email address" %></dt>
219 <dd class="list-inline-item"><%= @user.email %></dd>
220 <% unless @user.creation_ip.nil? -%>
221 <dt class="list-inline-item m-0"><%= t ".created from" %></dt>
222 <dd class="list-inline-item"><%= link_to @user.creation_ip, users_path(:ip => @user.creation_ip) %></dd>
224 <dt class="list-inline-item m-0"><%= t ".status" %></dt>
225 <dd class="list-inline-item"><%= link_to @user.status.capitalize, users_path(:status => @user.status) %></dd>
226 <dt class="list-inline-item m-0"><%= t ".spam score" %></dt>
227 <dd class="list-inline-item"><%= @user.spam_score %></dd>
236 <div class="richtext text-break clearfix"><%= @user.description.to_html %></div>
238 <% if current_user and @user.id == current_user.id %>
240 <%= link_to t(".edit_profile"), edit_profile_path, :class => "btn btn-outline-primary" %>