- <div id="map" style="border: 1px solid black; position: relative; width : 90%; height : 400px;"></div>
- <%= render :partial => 'friend_map' %>
- <table id="nearbyusers">
- <% @this_user.nearby.each do |nearby| %>
- <tr>
- <td class="username"><%= link_to h(nearby.display_name), :controller => 'user', :action => 'view', :display_name => nearby.display_name %></td>
- <td><%= t 'user.view.km away', :count => @this_user.distance(nearby).round %></td>
- <td class="message">(<%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :user_id => nearby.id %>)</td>
- </tr>
+ <% if current_user and current_user.administrator? %>
+
+ <ul class='secondary-actions clearfix'>
+ <% if ["active", "confirmed"].include? @user.status %>
+ <li>
+ <%= link_to t('.deactivate_user'), set_status_user_path(:status => 'pending', :display_name => @user.display_name), :data => { :confirm => t('.confirm') } %>
+ </li>
+ <% elsif ["pending"].include? @user.status %>
+ <li>
+ <%= link_to t('.activate_user'), set_status_user_path(:status => 'active', :display_name => @user.display_name), :data => { :confirm => t('.confirm') } %>
+ </li>
+ <% end %>
+
+ <% if ["active", "suspended"].include? @user.status %>
+ <li>
+ <%= link_to t('.confirm_user'), set_status_user_path(:status => 'confirmed', :display_name => @user.display_name), :data => { :confirm => t('.confirm') } %>
+ </li>
+ <% end %>
+ <li>
+ <% if ["pending", "active", "confirmed", "suspended"].include? @user.status %>
+ <%= link_to t('.hide_user'), set_status_user_path(:status => 'deleted', :display_name => @user.display_name), :data => { :confirm => t('.confirm') } %>
+ <% else %>
+ <%= link_to t('.unhide_user'), set_status_user_path(:status => 'active', :display_name => @user.display_name), :data => { :confirm => t('.confirm') } %>
+ </li>
+ <% end %>
+ <li>
+ <%= link_to t('.delete_user'), delete_user_path(:display_name => @user.display_name), :data => { :confirm => t('.confirm') } %>
+ </li>
+ </ul>
+
+ <% end %>
+
+ <p class='deemphasize'>
+ <small>
+ <%= t '.mapper since' %> <%= l @user.creation_time.to_date, :format => :long %>
+ <% unless @user.terms_agreed %>
+ |
+ <%= t '.ct status' %>
+ <% if @user.terms_seen? -%>
+ <%= t '.ct declined' %>
+ <% else -%>
+ <%= t '.ct undecided' %>
+ <% end -%>
+ <% end -%>
+ </small>
+ </p>
+ </div>
+
+ <div class="user-description richtext"><%= @user.description.to_html %></div>
+
+ </div>
+
+ <% if current_user and current_user.administrator? -%>
+ <div class='admin-user-info deemphasize'>
+ <small><b><%= t '.email address' %></b> <%= @user.email %></small>
+ <% unless @user.creation_ip.nil? -%>
+ <small><b><%= t '.created from' %></b> <%= @user.creation_ip %></small>
+ <% end -%>
+ <small><b><%= t '.status' %></b> <%= @user.status.capitalize %></small>
+ <small><b><%= t '.spam score' %></b> <%= @user.spam_score %></small>
+ </div>
+ <% end -%>
+
+<% end %>
+
+ <% if current_user and @user.id == current_user.id %>
+ <% if @user.home_lat.nil? or @user.home_lon.nil? %>
+ <div id="map" class="content_map">
+ <p id="no_home_location"><%= raw(t '.if set location', :settings_link => (link_to t('.settings_link_text'), :controller => 'user', :action => 'account', :display_name => current_user.display_name)) %></p>
+ </div>
+ <% else %>
+ <% content_for :head do %>
+ <%= javascript_include_tag "user" %>