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', :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 %>
11 <!-- Displaying another user's profile page -->
12 <%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => @this_user.display_name %>
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', :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 %>
19 <%= link_to t('user.view.add as friend'), :controller => 'user', :action => 'make_friend', :display_name => @this_user.display_name %>
24 <% if @this_user != nil %>
26 <b><%= t 'user.view.mapper since' %></b><%= l @this_user.creation_time %> <%= t 'user.view.ago', :time_in_words_ago => time_ago_in_words(@this_user.creation_time) %>
30 <h3><%= t 'user.view.user image heading' %></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 t('user.view.delete image'), :action => 'delete_image' %>
39 <% if @user and @this_user.id == @user.id %>
40 <%= t 'user.view.upload an image' %><br />
41 <%= form_tag({:action=>'upload_image'}, :multipart => true)%>
42 <%= file_column_field 'user', 'image' %>
43 <%= submit_tag t('user.view.add image') %>
47 <h3><%= t 'user.view.description' %></h3>
48 <div id="description"><%= htmlize(@this_user.description) %></div>
50 <% if @this_user.home_lat.nil? or @this_user.home_lon.nil? %>
51 <h3><%= t 'user.view.user location' %></h3>
53 <%= t 'user.view.no home location' %>
54 <% if @user and @this_user.id == @user.id %>
55 <%= t 'user.view.if set location', :settings_link => (link_to t('user.view.settings_link_text'), :controller => 'user', :action => 'account', :display_name => @user.display_name) %>
59 <% if @user and @this_user.id == @user.id %>
60 <h3><%= t 'user.view.your friends' %></h3>
61 <% if @this_user.friends.empty? %>
62 <%= t 'user.view.no friends' %>
65 <% @this_user.friends.each do |friend| %>
66 <% @friend = User.find_by_id(friend.friend_user_id) %>
69 <% if @friend.image %>
70 <%= image_tag url_for_file_column(@friend, "image") %>
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 %><%= t 'user.view.km away', :count => @this_user.distance(@friend).round %><% end %></td>
75 <td class="message">(<%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :user_id => @friend.id %>)</td>
84 <% if @user and @this_user.id == @user.id %>
85 <h3><%= t 'user.view.nearby users' %></h3>
86 <% if @this_user.nearby.empty? %>
87 <%= t 'user.view.no nearby users' %>
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| %>
95 <td class="username"><%= link_to h(nearby.display_name), :controller => 'user', :action => 'view', :display_name => nearby.display_name %></td>
96 <td><%= t 'user.view.km away', :count => @this_user.distance(nearby).round %></td>
97 <td class="message">(<%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :user_id => nearby.id %>)</td>
107 <% if @user and @this_user.id == @user.id %>
108 <%= link_to t('user.view.change your settings'), :controller => 'user', :action => 'account', :display_name => @user.display_name %>