]> git.openstreetmap.org Git - rails.git/blob - app/views/user/_contact.html.erb
be1c241068736d2577806fdd99812197c9a6ee06
[rails.git] / app / views / user / _contact.html.erb
1 <tr>
2   <td rowspan="2">
3     <% if contact.image %>
4       <%= image_tag url_for_file_column(contact, "image"), :class => "user_thumbnail" %>
5     <% else %>
6       <%= image_tag "anon_small.png" %>
7     <% end %>
8   </td>
9   <td>
10     <%= link_to h(contact.display_name), :controller => 'user', :action => 'view',  :display_name => contact.display_name %>
11     <% if contact.home_lon and contact.home_lat %>
12       <% distance = @this_user.distance(contact) %>
13       <% if distance < 1 %>
14         (<%= t 'user.view.m away', :count => (distance * 1000).round %>)
15       <% else %>
16         (<%= t 'user.view.km away', :count => distance.round %>)
17       <% end %>
18     <% end %>
19   </td>
20 </tr>
21 <tr>
22   <td>
23     <%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => contact.display_name %>
24     |
25     <% if @user.is_friends_with?(contact) %>
26       <%= link_to t('user.view.remove as friend'), :controller => 'user', :action => 'remove_friend', :display_name => contact.display_name, :referer => request.request_uri %>
27     <% else %>
28       <%= link_to t('user.view.add as friend'), :controller => 'user', :action => 'make_friend', :display_name => contact.display_name, :referer => request.request_uri %>
29     <% end %>
30   </td>
31 </tr>