1 <% @this_user = User.find_by_display_name(@this_user.display_name) %>
 
   2 <h2><%= @this_user.display_name %></h2>
 
   3 <div id="userinformation">
 
   4 <% if @user and @this_user.id == @user.id %>
 
   5 <%= link_to 'my diary', :controller => 'diary_entry', :action => 'list', :display_name => @user.display_name %>
 
   6 | <%= link_to 'new diary post', :controller => 'diary_entry', :action => 'new', :display_name => @user.display_name %>
 
   7 | <%= link_to 'my traces', :controller => 'trace', :action=>'mine' %>
 
   8 | <%= link_to 'my settings', :controller => 'user', :action => 'account', :display_name => @user.display_name %>
 
  10 <%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => @this_user.id %>
 
  11 | <%= link_to 'diary', :controller => 'diary_entry', :action => 'list', :display_name => @this_user.display_name %>
 
  12 | <%= link_to 'traces', :controller => 'trace', :action => 'view', :display_name => @this_user.display_name %>
 
  13 | <% if @user and @user.is_friends_with?(@this_user) %>
 
  14   <%= link_to 'remove as friend', :controller => 'user', :action => 'remove_friend', :display_name => @this_user.display_name %>
 
  16   <%= link_to 'add as friend', :controller => 'user', :action => 'make_friend', :display_name => @this_user.display_name %>
 
  21 <div id="description"><%= simple_format(@this_user.description) %></div>
 
  23 <h3>User location</h3>
 
  24 <% if @this_user.home_lat.nil? or @this_user.home_lon.nil? %>
 
  25   No home location has been set.
 
  26   <% if @user and @this_user.id == @user.id %>
 
  27   You can set your home location on your <%= link_to 'settings', :controller => 'user', :action => 'account', :display_name => @user.display_name %> page.
 
  31   <% if @user and @this_user.id == @user.id %>
 
  33     <% if @this_user.friends.empty? %>
 
  34       You have not added any friends yet.
 
  37       <% @this_user.friends.each do |friend| %>
 
  38       <% @friend = User.find_by_id(friend.friend_user_id) %>
 
  40       <td class="username"><%= link_to @friend.display_name, :controller => 'user', :action => 'view',  :display_name => @friend.display_name %></td>
 
  41       <td><% if @friend.home_lon and @friend.home_lat %><%= @this_user.distance(@friend).round %>km away<% end %></td>
 
  42       <td class="message">(<%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => @friend.id %>)</td>
 
  51   <% if @this_user.nearby.empty? %>
 
  52     There are no users who admit to mapping nearby yet.
 
  54     <table id="nearbyusers">
 
  55     <% @this_user.nearby.each do |nearby| %>
 
  57     <td class="username"><%= link_to nearby.display_name, :controller => 'user', :action => 'view',  :display_name => nearby.display_name %></td>
 
  58     <td><%= @this_user.distance(nearby).round %>km away</td>
 
  59     <td class="message">(<%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => nearby.id %>)</td>