1 <% content_for :heading do %>
2 <div id="userinformation" class="row">
3 <div class="col-sm-auto">
4 <%= user_image @user, :class => "" %>
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 <ul class='secondary-actions clearfix'>
12 <%= link_to t(".my edits"), :controller => "changesets", :action => "index", :display_name => current_user.display_name %>
13 <span class='count-number'><%= number_with_delimiter(current_user.changesets.size) %></span>
16 <%= link_to t(".my notes"), user_notes_path(@user) %>
19 <%= link_to t(".my traces"), :controller => "traces", :action => "mine" %>
20 <span class='count-number'><%= number_with_delimiter(current_user.traces.size) %></span>
23 <%= link_to t(".my diary"), :controller => "diary_entries", :action => "index", :display_name => current_user.display_name %>
24 <span class='count-number'><%= number_with_delimiter(current_user.diary_entries.size) %></span>
27 <%= link_to t(".my comments"), diary_comments_path(current_user) %>
30 <%= link_to t(".my settings"), user_account_path(current_user) %>
33 <% if current_user.blocks.exists? %>
35 <%= link_to t(".blocks on me"), user_blocks_on_path(current_user) %>
36 <span class='count-number'><%= number_with_delimiter(current_user.blocks.active.size) %></span>
40 <% if can?(:create, UserBlock) and current_user.blocks_created.exists? %>
42 <%= link_to t(".blocks by me"), user_blocks_by_path(current_user) %>
43 <span class='count-number'><%= number_with_delimiter(current_user.blocks_created.active.size) %></span>
50 <!-- Displaying user profile page to the public -->
51 <ul class='secondary-actions clearfix'>
54 <%= link_to t(".edits"), :controller => "changesets", :action => "index", :display_name => @user.display_name %>
55 <span class='count-number'><%= number_with_delimiter(@user.changesets.size) %></span>
58 <%= link_to t(".notes"), user_notes_path(@user) %>
61 <%= link_to t(".traces"), :controller => "traces", :action => "index", :display_name => @user.display_name %>
62 <span class='count-number'><%= number_with_delimiter(@user.traces.size) %></span>
65 <!-- Displaying another user's profile page -->
68 <%= link_to t(".send message"), new_message_path(@user) %>
71 <%= link_to t(".diary"), :controller => "diary_entries", :action => "index", :display_name => @user.display_name %>
72 <span class='count-number'><%= number_with_delimiter(@user.diary_entries.size) %></span>
75 <%= link_to t(".comments"), diary_comments_path(@user) %>
78 <% if current_user and current_user.is_friends_with?(@user) %>
79 <%= link_to t(".remove as friend"), remove_friend_path(:display_name => @user.display_name), :method => :post %>
80 <% elsif current_user %>
81 <%= link_to t(".add as friend"), make_friend_path(:display_name => @user.display_name), :method => :post %>
83 <%= link_to t(".add as friend"), make_friend_path(:display_name => @user.display_name) %>
87 <% if @user.blocks.exists? %>
89 <%= link_to t(".block_history"), user_blocks_on_path(@user) %>
90 <span class='count-number'><%= number_with_delimiter(@user.blocks.active.size) %></span>
94 <% if @user.moderator? and @user.blocks_created.exists? %>
96 <%= link_to t(".moderator_history"), user_blocks_by_path(@user) %>
97 <span class='count-number'><%= number_with_delimiter(@user.blocks_created.active.size) %></span>
101 <% if can?(:create, UserBlock) %>
103 <%= link_to t(".create_block"), new_user_block_path(@user) %>
107 <% if current_user and @user.id != current_user.id %>
109 <%= report_link(t(".report"), @user) %>
115 <p class='text-muted'>
117 <%= t ".mapper since" %> <%= l @user.creation_time.to_date, :format => :long %>
118 <% unless @user.terms_agreed %>
120 <%= t ".ct status" %>
121 <% if @user.terms_seen? -%>
122 <%= t ".ct declined" %>
124 <%= t ".ct undecided" %>
132 <% if can?(:set_status, User) || can?(:destroy, User) %>
133 <ul class='secondary-actions clearfix'>
134 <% if can? :set_status, User %>
135 <% if ["active", "confirmed"].include? @user.status %>
137 <%= link_to t(".deactivate_user"), set_status_user_path(:status => "pending", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
139 <% elsif ["pending"].include? @user.status %>
141 <%= link_to t(".activate_user"), set_status_user_path(:status => "active", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
145 <% if ["active", "suspended"].include? @user.status %>
147 <%= link_to t(".confirm_user"), set_status_user_path(:status => "confirmed", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
151 <% if ["pending", "active", "confirmed", "suspended"].include? @user.status %>
152 <%= link_to t(".hide_user"), set_status_user_path(:status => "deleted", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
154 <%= link_to t(".unhide_user"), set_status_user_path(:status => "active", :display_name => @user.display_name), :method => :post, :data => { :confirm => t(".confirm") } %>
158 <% if can? :destroy, User %>
160 <%= link_to t(".delete_user"), user_path(:display_name => @user.display_name), :method => :delete, :data => { :confirm => t(".confirm") } %>
166 <% if current_user and current_user.administrator? -%>
167 <div class='admin-user-info text-muted'>
168 <small><b><%= t ".email address" %></b> <%= @user.email %></small>
169 <% unless @user.creation_ip.nil? -%>
170 <small><b><%= t ".created from" %></b> <%= @user.creation_ip %></small>
172 <small><b><%= t ".status" %></b> <%= @user.status.capitalize %></small>
173 <small><b><%= t ".spam score" %></b> <%= @user.spam_score %></small>
178 <div class="richtext text-break clearfix"><%= @user.description.to_html %></div>
180 <% if current_user and @user.id == current_user.id %>
182 <%= link_to t(".edit_profile"), edit_profile_path, :class => "btn btn-outline-primary" %>