1 <% content_for :heading do %>
2 <div id='userinformation'>
3 <%= user_image @this_user %>
4 <div class='userinformation-inner'>
5 <h2><%= @this_user.display_name %><%= role_icons(@this_user) %></h2>
6 <% if @user and @this_user.id == @user.id %>
7 <!-- Displaying user's own profile page -->
8 <ul class='secondary-actions clearfix'>
10 <%= link_to t('user.view.my edits'), :controller => 'changeset', :action => 'list', :display_name => @user.display_name %>
11 <span class='count-number'><%= number_with_delimiter(@user.changesets.size) %></span>
14 <%= link_to t('user.view.my traces'), :controller => 'trace', :action=>'mine' %>
15 <span class='count-number'><%= number_with_delimiter(@user.traces.size) %></span>
18 <%= link_to t('user.view.my diary'), :controller => 'diary_entry', :action => 'list', :display_name => @user.display_name %>
19 <span class='count-number'><%= number_with_delimiter(@user.diary_entries.size) %></span>
22 <%= link_to t('user.view.my comments' ), :controller => 'diary_entry', :action => 'comments', :display_name => @user.display_name %>
25 <%= link_to t('user.view.my settings'), :controller => 'user', :action => 'account', :display_name => @user.display_name %>
28 <% if @user.blocks.exists? %>
30 <%= link_to t('user.view.blocks on me'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @user.display_name %>
31 <span class='count-number'><%= number_with_delimiter(@user.blocks.active.size) %></span>
35 <% if @user and @user.moderator? and @user.blocks_created.exists? %>
37 <%= link_to t('user.view.blocks by me'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => @user.display_name %>
38 <span class='count-number'><%= number_with_delimiter(@user.blocks_created.active.size) %></span>
46 <ul class='secondary-actions clearfix'>
49 <%= link_to t('user.view.edits'), :controller => 'changeset', :action => 'list', :display_name => @this_user.display_name %>
50 <span class='count-number'><%= number_with_delimiter(@this_user.changesets.size) %></span>
53 <%= link_to t('user.view.traces'), :controller => 'trace', :action => 'list', :display_name => @this_user.display_name %>
54 <span class='count-number'><%= number_with_delimiter(@this_user.traces.size) %></span>
57 <!-- Displaying another user's profile page -->
60 <%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => @this_user.display_name %>
63 <%= link_to t('user.view.diary'), :controller => 'diary_entry', :action => 'list', :display_name => @this_user.display_name %>
64 <span class='count-number'><%= number_with_delimiter(@this_user.diary_entries.size) %></span>
67 <%= link_to t('user.view.comments'), :controller => 'diary_entry', :action => 'comments', :display_name => @this_user.display_name %>
70 <% if @user and @user.is_friends_with?(@this_user) %>
71 <%= link_to t('user.view.remove as friend'), remove_friend_path(:display_name => @this_user.display_name), :method => :post %>
73 <%= link_to t('user.view.add as friend'), make_friend_path(:display_name => @this_user.display_name), :method => :post %>
77 <% if @this_user.blocks.exists? %>
79 <%= link_to t('user.view.block_history'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @this_user.display_name %>
80 <span class='count-number'><%= number_with_delimiter(@this_user.blocks.active.size) %></span>
84 <% if @this_user.moderator? and @this_user.blocks_created.exists? %>
86 <%= link_to t('user.view.moderator_history'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => @this_user.display_name %>
87 <span class='count-number'><%= number_with_delimiter(@this_user.blocks_created.active.size) %></span>
91 <% if @user and @user.moderator? %>
93 <%= link_to t('user.view.create_block'), :controller => 'user_blocks', :action => 'new', :display_name => @this_user.display_name %>
101 <% if @user and @user.administrator? %>
103 <ul class='secondary-actions clearfix'>
104 <% if ["active", "confirmed"].include? @this_user.status %>
106 <%= 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') } %>
108 <% elsif ["pending"].include? @this_user.status %>
110 <%= 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') } %>
114 <% if ["active", "suspended"].include? @this_user.status %>
116 <%= 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') } %>
120 <% if ["pending", "active", "confirmed", "suspended"].include? @this_user.status %>
121 <%= 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') } %>
123 <%= 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') } %>
127 <%= link_to t('user.view.delete_user'), delete_user_path(:display_name => @this_user.display_name), :data => { :confirm => t('user.view.confirm') } %>
133 <p class='deemphasize'>
135 <%= t 'user.view.mapper since' %> <%= l @this_user.creation_time.to_date, :format => :long %>
137 <%= t 'user.view.ct status' %>
138 <% if not @this_user.terms_agreed.nil? -%>
139 <%= t 'user.view.ct accepted', :ago =>time_ago_in_words(@this_user.terms_agreed) %>
140 <% elsif not @this_user.terms_seen? -%>
141 <%= t 'user.view.ct undecided' %>
143 <%= t 'user.view.ct declined' %>
149 <div class='user-description'><%= @this_user.description.to_html %></div>
153 <% if @user and @user.administrator? -%>
154 <div class='admin-user-info deemphasize'>
155 <small><b><%= t 'user.view.email address' %></b> <%= @this_user.email %></small>
156 <% unless @this_user.creation_ip.nil? -%>
157 <small><b><%= t 'user.view.created from' %></b> <%= @this_user.creation_ip %></small>
159 <small><b><%= t 'user.view.status' %></b> <%= @this_user.status.capitalize %></small>
160 <small><b><%= t 'user.view.spam score' %></b> <%= @this_user.spam_score %></small>
166 <% if @user and @this_user.id == @user.id %>
167 <% if @this_user.home_lat.nil? or @this_user.home_lon.nil? %>
168 <div id="map" class="content_map">
169 <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>
172 <% content_for :head do %>
173 <%= javascript_include_tag "user" %>
177 :lon => @user.home_lon,
178 :lat => @user.home_lat,
179 :icon => image_path("marker-red.png"),
180 :description => render(:partial => "popup", :object => @user, :locals => {:type => "your location"})
183 <%= content_tag "div", "", :id => "map", :class => "content_map", :data => {:user => user_data} %>
186 <% friends = @this_user.friends.collect { |f| f.befriendee } %>
187 <% nearby = @this_user.nearby - friends %>
189 <div class="activity-block column-1">
190 <h3><%= t 'user.view.your friends' %></h3>
192 <% if friends.empty? %>
193 <%= t 'user.view.no friends' %>
195 <ul class='secondary-actions clearfix'>
196 <li><%= link_to t('user.view.friends_changesets'), friend_changesets_path %></li>
197 <li><%= link_to t('user.view.friends_diaries'), friend_diaries_path %></li>
199 <div id="friends-container">
200 <%= render :partial => "contact", :collection => friends, :locals => {:type => "friend"} %>
205 <div class="activity-block column-1">
206 <h3><%= t 'user.view.nearby users' %></h3>
208 <% if nearby.empty? %>
209 <%= t 'user.view.no nearby users' %>
211 <ul class='secondary-actions clearfix'>
212 <li><%= link_to t('user.view.nearby_changesets'), nearby_changesets_path %></li>
213 <li><%= link_to t('user.view.nearby_diaries'), nearby_diaries_path %></li>
215 <div id="nearbyusers">
216 <%= render :partial => "contact", :collection => nearby, :locals => {:type => "nearby mapper"} %>