1 <% content_for :heading do %>
2 <div id="userinformation" class="row">
3 <div class="col-sm-auto">
4 <%= user_image @user, :class => "user_image_no_margins" %>
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='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='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='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"), user_account_path(current_user) %>
34 <% if current_user.blocks.exists? %>
36 <%= link_to t(".blocks on me"), user_blocks_on_path(current_user) %>
37 <span class='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='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='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='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='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.is_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='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='count-number'><%= number_with_delimiter(@user.blocks_created.active.size) %></span>
104 <% if can?(:create, UserBlock) %>
106 <%= link_to t(".create_block"), new_user_block_path(@user) %>
110 <% if current_user and @user.id != current_user.id %>
112 <%= report_link(t(".report"), @user) %>
119 <div class='text-muted'>
121 <dl class="dl-inline">
122 <dt><%= t ".mapper since" %></dt>
123 <dd><%= l @user.creation_time.to_date, :format => :long %></dd>
124 <% unless @user.terms_agreed %>
125 <dt><%= t ".ct status" %></dt>
127 <% if @user.terms_seen? -%>
128 <%= t ".ct declined" %>
130 <%= t ".ct undecided" %>
138 <% if can?(:set_status, User) || can?(:destroy, User) %>
139 <nav class='secondary-actions'>
140 <ul class='clearfix'>
141 <% if can? :set_status, User %>
142 <% if ["active", "confirmed"].include? @user.status %>
144 <%= link_to t(".deactivate_user"), set_status_user_path(:status => "pending", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
146 <% elsif ["pending"].include? @user.status %>
148 <%= link_to t(".activate_user"), set_status_user_path(:status => "active", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
152 <% if ["active", "suspended"].include? @user.status %>
154 <%= link_to t(".confirm_user"), set_status_user_path(:status => "confirmed", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
158 <% if ["pending", "active", "confirmed", "suspended"].include? @user.status %>
159 <%= link_to t(".hide_user"), set_status_user_path(:status => "deleted", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
161 <%= link_to t(".unhide_user"), set_status_user_path(:status => "active", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
165 <% if can? :destroy, User %>
167 <%= link_to t(".delete_user"), user_path(:display_name => @user.display_name), :method => :delete, :data => { :confirm => t(".confirm") } %>
174 <% if current_user and current_user.administrator? -%>
175 <div class='text-muted'>
177 <dl class='dl-inline'>
178 <dt><%= t ".email address" %></dt>
179 <dd><%= @user.email %></dd>
180 <% unless @user.creation_ip.nil? -%>
181 <dt><%= t ".created from" %></dt>
182 <dd><%= @user.creation_ip %></dd>
184 <dt><%= t ".status" %></dt>
185 <dd><%= @user.status.capitalize %></dd>
186 <dt><%= t ".spam score" %></dt>
187 <dd><%= @user.spam_score %></dd>
196 <div class="richtext text-break clearfix"><%= @user.description.to_html %></div>
198 <% if current_user and @user.id == current_user.id %>
200 <%= link_to t(".edit_profile"), edit_profile_path, :class => "btn btn-outline-primary" %>