X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2e2f2124728ca755b2db8f83f022eaea24b647f0..66bdade7439376a28546d3a723d72727756cd836:/app/views/user/view.html.erb
diff --git a/app/views/user/view.html.erb b/app/views/user/view.html.erb
index 36bba478c..1b582c0b9 100644
--- a/app/views/user/view.html.erb
+++ b/app/views/user/view.html.erb
@@ -9,7 +9,7 @@
| <%= link_to t('user.view.my settings'), :controller => 'user', :action => 'account', :display_name => @user.display_name %>
<% else %>
-<%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :user_id => @this_user.id %>
+<%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => @this_user.display_name %>
| <%= link_to t('user.view.diary'), :controller => 'diary_entry', :action => 'list', :display_name => @this_user.display_name %>
| <%= link_to t('user.view.edits'), :controller => 'changeset', :action => 'list_user', :display_name => @this_user.display_name %>
| <%= link_to t('user.view.traces'), :controller => 'trace', :action => 'view', :display_name => @this_user.display_name %>
@@ -71,7 +71,16 @@
<% end %>
<%= link_to h(@friend.display_name), :controller => 'user', :action => 'view', :display_name => @friend.display_name %> |
- <% if @friend.home_lon and @friend.home_lat %><%= t 'user.view.km away', :count => @this_user.distance(@friend).round %><% end %> |
+
+ <% if @friend.home_lon and @friend.home_lat %>
+ <% distance = @this_user.distance(@friend) %>
+ <% if distance < 1 %>
+ <%= t 'user.view.m away', :count => (distance * 1000).round %>
+ <% else %>
+ <%= t 'user.view.km away', :count => distance.round %>
+ <% end %>
+ <% end %>
+ |
(<%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :user_id => @friend.id %>) |
<%end%>
@@ -93,7 +102,14 @@
<% @this_user.nearby.each do |nearby| %>
<%= link_to h(nearby.display_name), :controller => 'user', :action => 'view', :display_name => nearby.display_name %> |
- <%= t 'user.view.km away', :count => @this_user.distance(nearby).round %> |
+
+ <% distance = @this_user.distance(nearby) %>
+ <% if distance < 1 %>
+ <%= t 'user.view.m away', :count => (distance * 1000).round %>
+ <% else %>
+ <%= t 'user.view.km away', :count => distance.round %>
+ <% end %>
+ |
(<%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :user_id => nearby.id %>) |
<% end %>