1 <% content_for :heading do %>
2 <div id='userinformation'>
3 <%= user_image @this_user %>
4 <div class='userinformation-inner'>
5 <h1><%= @this_user.display_name %><%= role_icons(@this_user) %></h1>
6 <% if current_user and @this_user.id == current_user.id %>
7 <!-- Displaying user's own profile page to themself -->
8 <ul class='secondary-actions clearfix'>
10 <%= link_to t('user.view.my edits'), :controller => 'changeset', :action => 'list', :display_name => current_user.display_name %>
11 <span class='count-number'><%= number_with_delimiter(current_user.changesets.size) %></span>
14 <%= link_to t('user.view.my notes'), :controller => 'notes', :action=> 'mine' %>
17 <%= link_to t('user.view.my traces'), :controller => 'trace', :action=>'mine' %>
18 <span class='count-number'><%= number_with_delimiter(current_user.traces.size) %></span>
21 <%= link_to t('user.view.my diary'), :controller => 'diary_entry', :action => 'list', :display_name => current_user.display_name %>
22 <span class='count-number'><%= number_with_delimiter(current_user.diary_entries.size) %></span>
25 <%= link_to t('user.view.my comments' ), :controller => 'diary_entry', :action => 'comments', :display_name => current_user.display_name %>
28 <%= link_to t('user.view.my settings'), :controller => 'user', :action => 'account', :display_name => current_user.display_name %>
31 <% if current_user.blocks.exists? %>
33 <%= link_to t('user.view.blocks on me'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => current_user.display_name %>
34 <span class='count-number'><%= number_with_delimiter(current_user.blocks.active.size) %></span>
38 <% if current_user and current_user.moderator? and current_user.blocks_created.exists? %>
40 <%= link_to t('user.view.blocks by me'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => current_user.display_name %>
41 <span class='count-number'><%= number_with_delimiter(current_user.blocks_created.active.size) %></span>
48 <!-- Displaying user profile page to the public -->
49 <ul class='secondary-actions clearfix'>
52 <%= link_to t('user.view.edits'), :controller => 'changeset', :action => 'list', :display_name => @this_user.display_name %>
53 <span class='count-number'><%= number_with_delimiter(@this_user.changesets.size) %></span>
56 <%= link_to t('user.view.notes'), :controller => 'notes', :action=> 'mine' %>
59 <%= link_to t('user.view.traces'), :controller => 'trace', :action => 'list', :display_name => @this_user.display_name %>
60 <span class='count-number'><%= number_with_delimiter(@this_user.traces.size) %></span>
63 <!-- Displaying another user's profile page -->
66 <%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => @this_user.display_name %>
69 <%= link_to t('user.view.diary'), :controller => 'diary_entry', :action => 'list', :display_name => @this_user.display_name %>
70 <span class='count-number'><%= number_with_delimiter(@this_user.diary_entries.size) %></span>
73 <%= link_to t('user.view.comments'), :controller => 'diary_entry', :action => 'comments', :display_name => @this_user.display_name %>
76 <% if current_user and current_user.is_friends_with?(@this_user) %>
77 <%= link_to t('user.view.remove as friend'), remove_friend_path(:display_name => @this_user.display_name), :method => :post %>
78 <% elsif current_user %>
79 <%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name), :method => :post %>
81 <%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name) %>
85 <% if @this_user.blocks.exists? %>
87 <%= link_to t('user.view.block_history'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @this_user.display_name %>
88 <span class='count-number'><%= number_with_delimiter(@this_user.blocks.active.size) %></span>
92 <% if @this_user.moderator? and @this_user.blocks_created.exists? %>
94 <%= link_to t('user.view.moderator_history'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => @this_user.display_name %>
95 <span class='count-number'><%= number_with_delimiter(@this_user.blocks_created.active.size) %></span>
99 <% if current_user and current_user.moderator? %>
101 <%= link_to t('user.view.create_block'), :controller => 'user_blocks', :action => 'new', :display_name => @this_user.display_name %>
109 <% if current_user and current_user.administrator? %>
111 <ul class='secondary-actions clearfix'>
112 <% if ["active", "confirmed"].include? @this_user.status %>
114 <%= link_to t('user.view.deactivate_user'), set_status_user_path(:status => 'pending', :display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
116 <% elsif ["pending"].include? @this_user.status %>
118 <%= link_to t('user.view.activate_user'), set_status_user_path(:status => 'active', :display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
122 <% if ["active", "suspended"].include? @this_user.status %>
124 <%= link_to t('user.view.confirm_user'), set_status_user_path(:status => 'confirmed', :display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
128 <% if ["pending", "active", "confirmed", "suspended"].include? @this_user.status %>
129 <%= link_to t('user.view.hide_user'), set_status_user_path(:status => 'deleted', :display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
131 <%= link_to t('user.view.unhide_user'), set_status_user_path(:status => 'active', :display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
135 <%= link_to t('user.view.delete_user'), delete_user_path(:display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
141 <p class='deemphasize'>
143 <%= t 'user.view.mapper since' %> <%= l @this_user.creation_time.to_date, :format => :long %>
144 <% unless @this_user.terms_agreed %>
146 <%= t 'user.view.ct status' %>
147 <% if @this_user.terms_seen? -%>
148 <%= t 'user.view.ct declined' %>
150 <%= t 'user.view.ct undecided' %>
157 <% if current_user and @this_user.id != current_user.id %>
158 <div class="report-button">
159 <%= link_to new_issue_url(reportable_id: @this_user.id, reportable_type: @this_user.class.name, referer: request.fullpath), :title => t('user.view.report') do%>
165 <div class="user-description richtext"><%= @this_user.description.to_html %></div>
169 <% if current_user and current_user.administrator? -%>
170 <div class='admin-user-info deemphasize'>
171 <small><b><%= t 'user.view.email address' %></b> <%= @this_user.email %></small>
172 <% unless @this_user.creation_ip.nil? -%>
173 <small><b><%= t 'user.view.created from' %></b> <%= @this_user.creation_ip %></small>
175 <small><b><%= t 'user.view.status' %></b> <%= @this_user.status.capitalize %></small>
176 <small><b><%= t 'user.view.spam score' %></b> <%= @this_user.spam_score %></small>
182 <% if current_user and @this_user.id == current_user.id %>
183 <% if @this_user.home_lat.nil? or @this_user.home_lon.nil? %>
184 <div id="map" class="content_map">
185 <p id="no_home_location"><%= raw(t 'user.view.if set location', :settings_link => (link_to t('user.view.settings_link_text'), :controller => 'user', :action => 'account', :display_name => current_user.display_name)) %></p>
188 <% content_for :head do %>
189 <%= javascript_include_tag "user" %>
193 :lon => current_user.home_lon,
194 :lat => current_user.home_lat,
195 :icon => image_path("marker-red.png"),
196 :description => render(:partial => "popup", :object => current_user, :locals => {:type => "your location"})
199 <%= content_tag "div", "", :id => "map", :class => "content_map", :data => {:user => user_data} %>
202 <% friends = @this_user.friends.collect { |f| f.befriendee } %>
203 <% nearby = @this_user.nearby - friends %>
205 <div class="activity-block column-1">
206 <h3><%= t 'user.view.your friends' %></h3>
208 <% if friends.empty? %>
209 <%= t 'user.view.no friends' %>
211 <ul class='secondary-actions clearfix'>
212 <li><%= link_to t('user.view.friends_changesets'), friend_changesets_path %></li>
213 <li><%= link_to t('user.view.friends_diaries'), friend_diaries_path %></li>
215 <div id="friends-container">
216 <%= render :partial => "contact", :collection => friends, :locals => {:type => "friend"} %>
221 <div class="activity-block column-1">
222 <h3><%= t 'user.view.nearby users' %></h3>
224 <% if nearby.empty? %>
225 <%= t 'user.view.no nearby users' %>
227 <ul class='secondary-actions clearfix'>
228 <li><%= link_to t('user.view.nearby_changesets'), nearby_changesets_path %></li>
229 <li><%= link_to t('user.view.nearby_diaries'), nearby_diaries_path %></li>
231 <div id="nearbyusers">
232 <%= render :partial => "contact", :collection => nearby, :locals => {:type => "nearby mapper"} %>