1 <% if @this_user.image %>
2 <%= image_tag url_for_file_column(@this_user, "image"), :align => "right", :float => "left" %>
4 <h2><%= h(@this_user.display_name) %>
5 <% UserRole::ALL_ROLES.each do |role| %>
6 <% if @user and @user.administrator? %>
7 <% if @this_user.has_role? role %>
8 <%= link_to(image_tag("roles/#{role}.png", :size => "20x20", :border => 0, :alt => t("user.view.role.revoke.#{role}"), :title => t("user.view.role.revoke.#{role}")), :controller => 'user_roles', :action => 'revoke', :display_name => @this_user.display_name, :role => role) %>
10 <%= link_to(image_tag("roles/blank_#{role}.png", :size => "20x20", :border => 0, :alt => t("user.view.role.grant.#{role}"), :title => t("user.view.role.grant.#{role}")), :controller => 'user_roles', :action => 'grant', :display_name => @this_user.display_name, :role => role) %>
12 <% elsif @this_user.has_role? role %>
13 <%= image_tag("roles/#{role}.png", :size => "20x20", :border => 0, :alt => t("user.view.role.#{role}"), :title => t("user.view.role.#{role}")) %>
16 <div id="userinformation">
17 <% if @user and @this_user.id == @user.id %>
18 <!-- Displaying user's own profile page -->
19 <%= link_to t('user.view.my diary'), :controller => 'diary_entry', :action => 'list', :display_name => @user.display_name %>
20 | <%= link_to t('user.view.new diary entry'), :controller => 'diary_entry', :action => 'new', :display_name => @user.display_name %>
21 | <%= link_to t('user.view.my edits'), :controller => 'changeset', :action => 'list', :display_name => @user.display_name %>
22 | <%= link_to t('user.view.my traces'), :controller => 'trace', :action=>'mine' %>
23 | <%= link_to t('user.view.my settings'), :controller => 'user', :action => 'account', :display_name => @user.display_name %>
24 | <%= link_to t('user.view.blocks on me'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @user.display_name %>
25 <% if @user and @user.moderator? %>
26 | <%= link_to t('user.view.blocks by me'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => @user.display_name %>
29 <!-- Displaying another user's profile page -->
30 <%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => @this_user.display_name %>
31 | <%= link_to t('user.view.diary'), :controller => 'diary_entry', :action => 'list', :display_name => @this_user.display_name %>
32 | <%= link_to t('user.view.edits'), :controller => 'changeset', :action => 'list', :display_name => @this_user.display_name %>
33 | <%= link_to t('user.view.traces'), :controller => 'trace', :action => 'view', :display_name => @this_user.display_name %>
34 | <% if @user and @user.is_friends_with?(@this_user) %>
35 <%= link_to t('user.view.remove as friend'), :controller => 'user', :action => 'remove_friend', :display_name => @this_user.display_name %>
37 <%= link_to t('user.view.add as friend'), :controller => 'user', :action => 'make_friend', :display_name => @this_user.display_name %>
39 | <%= link_to t('user.view.block_history'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @this_user.display_name %>
40 <% if @this_user.moderator? %>
41 | <%= link_to t('user.view.moderator_history'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => @this_user.display_name %>
43 <% if @user and @user.moderator? %>
44 | <%= link_to t('user.view.create_block'), :controller => 'user_blocks', :action => 'new', :display_name => @this_user.display_name %>
47 <% if @user and @user.administrator? %>
49 <% if @this_user.active? %>
50 <%= link_to t('user.view.deactivate_user'), {:controller => 'user', :action => 'deactivate', :display_name => @this_user.display_name}, {:confirm => t('user.view.confirm')} %>
52 <%= link_to t('user.view.activate_user'), {:controller => 'user', :action => 'activate', :display_name => @this_user.display_name}, {:confirm => t('user.view.confirm')} %>
54 <% if @this_user.visible? %>
55 | <%= link_to t('user.view.hide_user'), {:controller => 'user', :action => 'hide', :display_name => @this_user.display_name}, {:confirm => t('user.view.confirm')} %>
56 | <%= link_to t('user.view.delete_user'), {:controller => 'user', :action => 'delete', :display_name => @this_user.display_name}, {:confirm => t('user.view.confirm')} %>
58 | <%= link_to t('user.view.unhide_user'), {:controller => 'user', :action => 'unhide', :display_name => @this_user.display_name}, {:confirm => t('user.view.confirm')} %>
63 <p><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) %></p>
65 <% if @user and @user.administrator? %>
66 <p><b><%= t 'user.view.email address' %></b> <%= @this_user.email %></p>
67 <p><b><%= t 'user.view.created from' %></b> <%= @this_user.creation_ip %></p>
70 <h3><%= t 'user.view.description' %></h3>
71 <div id="description"><%= htmlize(@this_user.description) %></div>
73 <% if @this_user.home_lat.nil? or @this_user.home_lon.nil? %>
74 <h3><%= t 'user.view.user location' %></h3>
76 <%= t 'user.view.no home location' %>
77 <% if @user and @this_user.id == @user.id %>
78 <%= 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) %>
82 <% if @user and @this_user.id == @user.id %>
83 <h3><%= t 'user.view.your friends' %></h3>
84 <% if @this_user.friends.empty? %>
85 <%= t 'user.view.no friends' %>
88 <% @this_user.friends.each do |friend| %>
89 <% @friend = User.find_by_id(friend.friend_user_id) %>
92 <% if @friend.image %>
93 <%= image_tag url_for_file_column(@friend, "image") %>
96 <td class="username"><%= link_to h(@friend.display_name), :controller => 'user', :action => 'view', :display_name => @friend.display_name %></td>
98 <% if @friend.home_lon and @friend.home_lat %>
99 <% distance = @this_user.distance(@friend) %>
100 <% if distance < 1 %>
101 <%= t 'user.view.m away', :count => (distance * 1000).round %>
103 <%= t 'user.view.km away', :count => distance.round %>
107 <td class="message">(<%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => @friend.display_name %>)</td>
116 <% if @user and @this_user.id == @user.id %>
117 <h3><%= t 'user.view.nearby users' %></h3>
118 <% if @this_user.nearby.empty? %>
119 <%= t 'user.view.no nearby users' %>
122 <div id="map" style="border: 1px solid black; position: relative; width : 90%; height : 400px;"></div>
123 <%= render :partial => 'friend_map' %>
124 <table id="nearbyusers">
125 <% @this_user.nearby.each do |nearby| %>
127 <td class="username"><%= link_to h(nearby.display_name), :controller => 'user', :action => 'view', :display_name => nearby.display_name %></td>
129 <% distance = @this_user.distance(nearby) %>
130 <% if distance < 1 %>
131 <%= t 'user.view.m away', :count => (distance * 1000).round %>
133 <%= t 'user.view.km away', :count => distance.round %>
136 <td class="message">(<%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => nearby.display_name %>)</td>
146 <% if @user and @this_user.id == @user.id %>
147 <%= link_to t('user.view.my_oauth_details'), :controller => 'oauth_clients', :action => 'index' %>