1 <%= user_image @this_user %>
3 <h2><%= @this_user.display_name %><%= role_icons(@this_user) %></h2>
5 <div id="userinformation">
6 <% if @user and @this_user.id == @user.id %>
7 <!-- Displaying user's own profile page -->
8 <%= link_to t('user.view.my edits'), :controller => 'changeset', :action => 'list', :display_name => @user.display_name %>
9 <span class='count-number'><%= number_with_delimiter(@user.changesets.size) %></span>
11 <%= link_to t('user.view.my traces'), :controller => 'trace', :action=>'mine' %>
12 <span class='count-number'><%= number_with_delimiter(@user.traces.size) %></span>
14 <%= link_to t('user.view.my diary'), :controller => 'diary_entry', :action => 'list', :display_name => @user.display_name %>
15 <span class='count-number'><%= number_with_delimiter(@user.diary_entries.size) %></span>
17 <%= link_to t('user.view.my comments' ), :controller => 'diary_entry', :action => 'comments', :display_name => @user.display_name %>
19 <%= link_to t('user.view.my settings'), :controller => 'user', :action => 'account', :display_name => @user.display_name %>
20 <% if @user.blocks.exists? %>
22 <%= link_to t('user.view.blocks on me'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @user.display_name %>
23 <span class='count-number'><%= number_with_delimiter(@user.blocks.active.size) %></span>
25 <% if @user and @user.moderator? and @user.blocks_created.exists? %>
27 <%= link_to t('user.view.blocks by me'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => @user.display_name %>
28 <span class='count-number'><%= number_with_delimiter(@user.blocks_created.active.size) %></span>
31 <%= link_to t('user.view.edits'), :controller => 'changeset', :action => 'list', :display_name => @this_user.display_name %>
32 <span class='count-number'><%= number_with_delimiter(@this_user.changesets.size) %></span>
34 <%= link_to t('user.view.traces'), :controller => 'trace', :action => 'list', :display_name => @this_user.display_name %>
35 <span class='count-number'><%= number_with_delimiter(@this_user.traces.size) %></span>
37 <!-- Displaying another user's profile page -->
38 <%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => @this_user.display_name %>
40 <%= link_to t('user.view.diary'), :controller => 'diary_entry', :action => 'list', :display_name => @this_user.display_name %>
41 <span class='count-number'><%= number_with_delimiter(@this_user.diary_entries.size) %></span>
43 <%= link_to t('user.view.comments'), :controller => 'diary_entry', :action => 'comments', :display_name => @this_user.display_name %>
45 <% if @user and @user.is_friends_with?(@this_user) %>
46 <%= link_to t('user.view.remove as friend'), remove_friend_path(:display_name => @this_user.display_name), :method => :post %>
48 <%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name), :method => :post %>
50 <% if @this_user.blocks.exists? %>
52 <%= link_to t('user.view.block_history'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @this_user.display_name %>
53 <span class='count-number'><%= number_with_delimiter(@this_user.blocks.active.size) %></span>
55 <% if @this_user.moderator? and @this_user.blocks_created.exists? %>
57 <%= link_to t('user.view.moderator_history'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => @this_user.display_name %>
58 <span class='count-number'><%= number_with_delimiter(@this_user.blocks_created.active.size) %></span>
60 <% if @user and @user.moderator? %>
61 | <%= link_to t('user.view.create_block'), :controller => 'user_blocks', :action => 'new', :display_name => @this_user.display_name %>
64 <% if @user and @user.administrator? %>
66 <% if ["active", "confirmed"].include? @this_user.status %>
67 <%= 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') } %> |
68 <% elsif ["pending"].include? @this_user.status %>
69 <%= 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') } %> |
71 <% if ["active", "suspended"].include? @this_user.status %>
72 <%= 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') } %> |
74 <% if ["pending", "active", "confirmed", "suspended"].include? @this_user.status %>
75 <%= 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') } %> |
77 <%= 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') } %> |
79 <%= link_to t('user.view.delete_user'), delete_user_path(:display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
83 <div id="description"><%= @this_user.description.to_html %></div>
85 <p class='deemphasize'><small>
86 <%= t 'user.view.mapper since' %> <%= l @this_user.creation_time.to_date, :format => :long %>
88 <%= t 'user.view.ct status' %>
89 <% if not @this_user.terms_agreed.nil? -%>
90 <%= t 'user.view.ct accepted', :ago =>time_ago_in_words(@this_user.terms_agreed) %>
91 <% elsif not @this_user.terms_seen? -%>
92 <%= t 'user.view.ct undecided' %>
94 <%= t 'user.view.ct declined' %>
99 <% if @user and @user.administrator? -%>
100 <p><b><%= t 'user.view.email address' %></b> <%= @this_user.email %></p>
101 <% unless @this_user.creation_ip.nil? -%>
102 <p><b><%= t 'user.view.created from' %></b> <%= @this_user.creation_ip %></p>
104 <p><b><%= t 'user.view.status' %></b> <%= @this_user.status.capitalize %></p>
105 <p><b><%= t 'user.view.spam score' %></b> <%= @this_user.spam_score %></p>
108 <% if @user and @this_user.id == @user.id %>
109 <% if @this_user.home_lat.nil? or @this_user.home_lon.nil? %>
110 <div id="map" class="user_map">
111 <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 => @user.display_name)) %></p>
114 <% content_for :head do %>
115 <%= javascript_include_tag "user" %>
119 :lon => @user.home_lon,
120 :lat => @user.home_lat,
121 :icon => image_path("marker-red.png"),
122 :description => render(:partial => "popup", :object => @user, :locals => {:type => "your location"})
125 <%= content_tag "div", "", :id => "map", :class => "user_map", :data => {:user => user_data} %>
128 <% friends = @this_user.friends.collect { |f| f.befriendee } %>
129 <% nearby = @this_user.nearby - friends %>
131 <h3 style="margin-top: 0"><%= t 'user.view.your friends' %></h3>
133 <% if friends.empty? %>
134 <%= t 'user.view.no friends' %>
136 <%= link_to t('user.view.friends_changesets'), friend_changesets_path %><br/>
137 <%= link_to t('user.view.friends_diaries'), friend_diaries_path %><br/><br/>
139 <%= render :partial => "contact", :collection => friends, :locals => {:type => "friend"} %>
143 <h3><%= t 'user.view.nearby users' %></h3>
145 <% if nearby.empty? %>
146 <%= t 'user.view.no nearby users' %>
148 <%= link_to t('user.view.nearby_changesets'), nearby_changesets_path %><br/>
149 <%= link_to t('user.view.nearby_diaries'), nearby_diaries_path %><br/><br/>
150 <table id="nearbyusers">
151 <%= render :partial => "contact", :collection => nearby, :locals => {:type => "nearby mapper"} %>