]> git.openstreetmap.org Git - rails.git/commitdiff
Don't try and print the distance to a friend that has not set a
authorTom Hughes <tom@compton.nu>
Fri, 12 Oct 2007 13:03:08 +0000 (13:03 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 12 Oct 2007 13:03:08 +0000 (13:03 +0000)
home location. Closes #560.

app/views/user/view.rhtml

index 93bed72b083ff8be308ee191b754479708032179..a96fd5b1917c4a24dcc5a9f1f287a0b46c64ec52 100644 (file)
@@ -38,7 +38,7 @@
       <% @friend = User.find_by_id(friend.friend_user_id) %>
       <tr>
       <td class="username"><%= link_to @friend.display_name, :controller => 'user', :action => 'view',  :display_name => @friend.display_name %></td>
-      <td><%= @this_user.distance(@friend).round %>km away</td>
+      <td><% if @friend.home_lon and @friend.home_lat %><%= @this_user.distance(@friend).round %>km away<% end %></td>
       <td class="message">(<%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => @friend.id %>)</td>
       </tr>
       <%end%>