]> git.openstreetmap.org Git - rails.git/blob - app/views/user/view.rhtml
Typo in site key. More of the user view i18n'ed
[rails.git] / app / views / user / view.rhtml
1 <h2><%= h(@this_user.display_name) %></h2>
2 <div id="userinformation">
3 <% if @user and @this_user.id == @user.id %>
4 <!-- Displaying user's own profile page -->
5 <%= link_to t('user.view.my diary'), :controller => 'diary_entry', :action => 'list', :display_name => @user.display_name %>
6 | <%= link_to t('user.view.new diary entry'), :controller => 'diary_entry', :action => 'new', :display_name => @user.display_name %>
7 | <%= link_to t('user.view.my edits'), :controller => 'changeset', :action => 'list_user', :display_name => @user.display_name %>
8 | <%= link_to t('user.view.my traces'), :controller => 'trace', :action=>'mine' %>
9 | <%= link_to t('user.view.my settings'), :controller => 'user', :action => 'account', :display_name => @user.display_name %>
10 <% else %>
11 <!-- Displaying another user's profile page -->
12 <%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :user_id => @this_user.id %>
13 | <%= link_to t('user.view.diary'), :controller => 'diary_entry', :action => 'list', :display_name => @this_user.display_name %>
14 | <%= link_to t('user.view.edits'), :controller => 'changeset', :action => 'list_user', :display_name => @this_user.display_name %>
15 | <%= link_to t('user.view.traces'), :controller => 'trace', :action => 'view', :display_name => @this_user.display_name %>
16 | <% if @user and @user.is_friends_with?(@this_user) %>
17   <%= link_to t('user.view.remove as friend'), :controller => 'user', :action => 'remove_friend', :display_name => @this_user.display_name %>
18 <% else %>
19   <%= link_to t('user.view.add as friend'), :controller => 'user', :action => 'make_friend', :display_name => @this_user.display_name %>
20 <% end %>
21 <% end %>
22 </div>
23
24 <% if @this_user != nil %>
25 <P>
26 <b><%= t 'user.view.mapper since' %></b><%= l @this_user.creation_time %> (<%= time_ago_in_words(@this_user.creation_time) %> ago)
27 </P>
28 <% end %>
29   
30 <h3>User image</h3>
31 <% if @this_user.image %>
32   <%= image_tag url_for_file_column(@this_user, "image") %>
33   <% if @user and @this_user.id == @user.id %>
34     <%= button_to 'Delete Image', :action => 'delete_image' %>
35   <% end %>
36 <% end %>
37 <br />
38
39 <% if @user and @this_user.id == @user.id %>
40   Upload an image<br />
41   <%= form_tag({:action=>'upload_image'}, :multipart => true)%>
42     <%= file_column_field 'user', 'image' %>
43     <%= submit_tag 'Add Image' %>
44   </form>
45 <% end %>
46
47 <h3>Description</h3>
48 <div id="description"><%= htmlize(@this_user.description) %></div>
49
50 <% if @this_user.home_lat.nil? or @this_user.home_lon.nil? %>
51 <h3>User location</h3>
52
53   No home location has been set.
54   <% if @user and @this_user.id == @user.id %>
55   If you set your location, a pretty map and stuff will appear below. You can set your home location on your <%= link_to 'settings', :controller => 'user', :action => 'account', :display_name => @user.display_name %> page.
56   <% end %>
57 <% else %>
58
59   <% if @user and @this_user.id == @user.id %>
60     <h3>Your friends</h3>
61     <% if @this_user.friends.empty? %>
62       You have not added any friends yet.
63     <% else %>
64       <table id="friends">
65       <% @this_user.friends.each do |friend| %>
66       <% @friend = User.find_by_id(friend.friend_user_id) %>
67       <tr>
68       <td class="image">
69       <% if @friend.image %>
70         <%= image_tag url_for_file_column(@friend, "image") %>
71       <% end %>
72       </td>
73       <td class="username"><%= link_to h(@friend.display_name), :controller => 'user', :action => 'view',  :display_name => @friend.display_name %></td>
74       <td><% if @friend.home_lon and @friend.home_lat %><%= @this_user.distance(@friend).round %>km away<% end %></td>
75       <td class="message">(<%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => @friend.id %>)</td>
76       </tr>
77       <%end%>
78       </table>
79     <%end%>
80     <br/>
81   <%end%>
82
83
84   <% if @user and @this_user.id == @user.id %>
85     <h3>Nearby users:</h3>
86     <% if @this_user.nearby.empty? %>
87       There are no users who admit to mapping nearby yet.
88     <% else %>
89
90     <div id="map" style="border: 1px solid black; position: relative; width : 90%; height : 400px;"></div>
91     <%= render :partial => 'friend_map' %>
92       <table id="nearbyusers">
93       <% @this_user.nearby.each do |nearby| %>
94       <tr>
95       <td class="username"><%= link_to h(nearby.display_name), :controller => 'user', :action => 'view',  :display_name => nearby.display_name %></td>
96       <td><%= @this_user.distance(nearby).round %>km away</td>
97       <td class="message">(<%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => nearby.id %>)</td>
98       </tr>
99       <% end %>
100       </table>
101     <% end %>
102   <% end %>
103 <% end %>
104
105 <br/>
106 <br/>
107 <% if @user and @this_user.id == @user.id %>
108 <%= link_to 'change your settings', :controller => 'user', :action => 'account', :display_name => @user.display_name %>
109 <% end %>