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(@user) %>
20 <%= link_to t(".my traces"), :controller => "traces", :action => "mine" %>
21 <span class='badge count-number'><%= number_with_delimiter(current_user.traces.size) %></span>
24 <%= link_to t(".my diary"), :controller => "diary_entries", :action => "index", :display_name => current_user.display_name %>
25 <span class='badge count-number'><%= number_with_delimiter(current_user.diary_entries.size) %></span>
28 <%= link_to t(".my comments"), diary_comments_path(current_user) %>
31 <%= link_to t(".my settings"), edit_account_path %>
34 <% if current_user.blocks.exists? %>
36 <%= link_to t(".blocks on me"), user_blocks_on_path(current_user) %>
37 <span class='badge count-number'><%= number_with_delimiter(current_user.blocks.active.size) %></span>
41 <% if can?(:create, UserBlock) and current_user.blocks_created.exists? %>
43 <%= link_to t(".blocks by me"), user_blocks_by_path(current_user) %>
44 <span class='badge count-number'><%= number_with_delimiter(current_user.blocks_created.active.size) %></span>
52 <!-- Displaying user profile page to the public -->
53 <nav class='secondary-actions'>
57 <%= link_to t(".edits"), :controller => "changesets", :action => "index", :display_name => @user.display_name %>
58 <span class='badge count-number'><%= number_with_delimiter(@user.changesets.size) %></span>
61 <%= link_to t(".notes"), user_notes_path(@user) %>
64 <%= link_to t(".traces"), :controller => "traces", :action => "index", :display_name => @user.display_name %>
65 <span class='badge count-number'><%= number_with_delimiter(@user.traces.size) %></span>
68 <!-- Displaying another user's profile page -->
71 <%= link_to t(".send message"), new_message_path(@user) %>
74 <%= link_to t(".diary"), :controller => "diary_entries", :action => "index", :display_name => @user.display_name %>
75 <span class='badge count-number'><%= number_with_delimiter(@user.diary_entries.size) %></span>
78 <%= link_to t(".comments"), diary_comments_path(@user) %>
81 <% if current_user and current_user.friends_with?(@user) %>
82 <%= link_to t(".remove as friend"), remove_friend_path(:display_name => @user.display_name), :method => :post %>
83 <% elsif current_user %>
84 <%= link_to t(".add as friend"), make_friend_path(:display_name => @user.display_name), :method => :post %>
86 <%= link_to t(".add as friend"), make_friend_path(:display_name => @user.display_name) %>
90 <% if @user.blocks.exists? %>
92 <%= link_to t(".block_history"), user_blocks_on_path(@user) %>
93 <span class='badge count-number'><%= number_with_delimiter(@user.blocks.active.size) %></span>
97 <% if @user.moderator? and @user.blocks_created.exists? %>
99 <%= link_to t(".moderator_history"), user_blocks_by_path(@user) %>
100 <span class='badge count-number'><%= number_with_delimiter(@user.blocks_created.active.size) %></span>
104 <% if can?(:revoke_all, UserBlock) and @user.blocks.active.exists? %>
106 <%= link_to t(".revoke_all_blocks"), revoke_all_user_blocks_path(@user) %>
110 <% if can?(:create, UserBlock) %>
112 <%= link_to t(".create_block"), new_user_block_path(@user) %>
116 <% if current_user and @user.id != current_user.id %>
118 <%= report_link(t(".report"), @user) %>
122 <% if current_user and UserMute.exists?(owner: current_user, subject: @user) %>
124 <%= link_to t(".destroy_mute"), user_mute_path(@user), :method => :delete %>
126 <% elsif current_user %>
128 <%= link_to t(".create_mute"), user_mute_path(@user), :method => :post, :title => t("user_mutes.index.user_mute_explainer") %>
135 <div class='text-body-secondary'>
137 <dl class="list-inline">
138 <dt class="list-inline-item m-0"><%= t ".mapper since" %></dt>
139 <dd class="list-inline-item"><%= l @user.created_at.to_date, :format => :long %></dd>
140 <dt class="list-inline-item m-0"><%= t ".last map edit" %></dt>
141 <dd class="list-inline-item"><%= l @user.changesets.first&.created_at&.to_date, :format => :long, :default => t(".no activity yet") %></dd>
142 <% unless @user.terms_agreed %>
143 <dt class="list-inline-item m-0"><%= t ".ct status" %></dt>
144 <dd class="list-inline-item">
145 <% if @user.terms_seen? -%>
146 <%= t ".ct declined" %>
148 <%= t ".ct undecided" %>
152 <% if current_user&.moderator? || current_user&.administrator? %>
153 <dt class="list-inline-item m-0"><%= t ".uid" %></dt>
154 <dd class="list-inline-item"><%= link_to @user.id, api_user_path(:id => @user.id) %></dd>
160 <% if can?(:set_status, User) || can?(:destroy, User) %>
161 <nav class='secondary-actions'>
162 <ul class='clearfix'>
163 <% if can? :set_status, User %>
164 <% if @user.may_activate? %>
166 <%= link_to t(".activate_user"), set_status_user_path(:event => "activate", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
170 <% if @user.may_unsuspend? %>
172 <%= link_to t(".unsuspend_user"), set_status_user_path(:event => "unsuspend", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
176 <% if @user.may_confirm? %>
178 <%= link_to t(".confirm_user"), set_status_user_path(:event => "confirm", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
182 <% if @user.may_unconfirm? %>
184 <%= link_to t(".unconfirm_user"), set_status_user_path(:event => "unconfirm", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
188 <% if @user.may_hide? %>
190 <%= link_to t(".hide_user"), set_status_user_path(:event => "hide", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
194 <% if @user.may_unhide? %>
196 <%= link_to t(".unhide_user"), set_status_user_path(:event => "unhide", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
201 <% if can?(:destroy, User) && @user.may_soft_destroy? %>
203 <%= link_to t(".delete_user"), user_path(:display_name => @user.display_name), :method => :delete, :data => { :confirm => t(".confirm") } %>
210 <% if current_user and current_user.administrator? -%>
211 <div class='text-body-secondary'>
213 <dl class="list-inline">
214 <dt class="list-inline-item m-0"><%= t ".email address" %></dt>
215 <dd class="list-inline-item"><%= @user.email %></dd>
216 <% unless @user.creation_ip.nil? -%>
217 <dt class="list-inline-item m-0"><%= t ".created from" %></dt>
218 <dd class="list-inline-item"><%= link_to @user.creation_ip, users_path(:ip => @user.creation_ip) %></dd>
220 <dt class="list-inline-item m-0"><%= t ".status" %></dt>
221 <dd class="list-inline-item"><%= link_to @user.status.capitalize, users_path(:status => @user.status) %></dd>
222 <dt class="list-inline-item m-0"><%= t ".spam score" %></dt>
223 <dd class="list-inline-item"><%= @user.spam_score %></dd>
232 <div class="richtext text-break clearfix"><%= @user.description.to_html %></div>
234 <% if current_user and @user.id == current_user.id %>
236 <%= link_to t(".edit_profile"), edit_profile_path, :class => "btn btn-outline-primary" %>