1 <div id="user_details">
2 <%= user_image @this_user %>
4 <h2><%= h(@this_user.display_name) %>
6 <% UserRole::ALL_ROLES.each do |role| %>
7 <% if @user and @user.administrator? %>
8 <% if @this_user.has_role? role %>
9 <%= 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) %>
11 <%= 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) %>
13 <% elsif @this_user.has_role? role %>
14 <%= image_tag("roles/#{role}.png", :size => "20x20", :border => 0, :alt => t("user.view.role.#{role}"), :title => t("user.view.role.#{role}")) %>
18 <div id="userinformation">
19 <% if @user and @this_user.id == @user.id %>
20 <!-- Displaying user's own profile page -->
21 <%= link_to t('user.view.my diary'), :controller => 'diary_entry', :action => 'list', :display_name => @user.display_name %>
23 <%= link_to t('user.view.new diary entry'), :controller => 'diary_entry', :action => 'new', :display_name => @user.display_name %>
25 <%= link_to t('user.view.my edits'), :controller => 'changeset', :action => 'list', :display_name => @user.display_name %>
27 <%= link_to t('user.view.my traces'), :controller => 'trace', :action=>'mine' %>
29 <%= link_to t('user.view.my settings'), :controller => 'user', :action => 'account', :display_name => @user.display_name %>
31 <%= link_to t('user.view.oauth settings'), :controller => 'oauth_clients', :action => 'index' %>
33 <%= link_to t('user.view.blocks on me'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @user.display_name %>
34 <% if @user and @user.moderator? %>
35 | <%= link_to t('user.view.blocks by me'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => @user.display_name %>
38 <!-- Displaying another user's profile page -->
39 <%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => @this_user.display_name %>
41 <%= link_to t('user.view.diary'), :controller => 'diary_entry', :action => 'list', :display_name => @this_user.display_name %>
43 <%= link_to t('user.view.edits'), :controller => 'changeset', :action => 'list', :display_name => @this_user.display_name %>
45 <%= link_to t('user.view.traces'), :controller => 'trace', :action => 'view', :display_name => @this_user.display_name %>
47 <% if @user and @user.is_friends_with?(@this_user) %>
48 <%= link_to t('user.view.remove as friend'), :controller => 'user', :action => 'remove_friend', :display_name => @this_user.display_name %>
50 <%= link_to t('user.view.add as friend'), :controller => 'user', :action => 'make_friend', :display_name => @this_user.display_name %>
53 <%= link_to t('user.view.block_history'), :controller => 'user_blocks', :action => 'blocks_on', :display_name => @this_user.display_name %>
54 <% if @this_user.moderator? %>
55 | <%= link_to t('user.view.moderator_history'), :controller => 'user_blocks', :action => 'blocks_by', :display_name => @this_user.display_name %>
57 <% if @user and @user.moderator? %>
58 | <%= link_to t('user.view.create_block'), :controller => 'user_blocks', :action => 'new', :display_name => @this_user.display_name %>
61 <% if @user and @user.administrator? %>
63 <% if ["active", "confirmed"].include? @this_user.status %>
64 <%= link_to t('user.view.deactivate_user'), {:controller => 'user', :action => 'set_status', :status => 'pending', :display_name => @this_user.display_name}, {:confirm => t('user.view.confirm')} %> |
65 <% elsif ["pending"].include? @this_user.status %>
66 <%= link_to t('user.view.activate_user'), {:controller => 'user', :action => 'set_status', :status => 'active', :display_name => @this_user.display_name}, {:confirm => t('user.view.confirm')} %> |
68 <% if ["active", "suspended"].include? @this_user.status %>
69 <%= link_to t('user.view.confirm_user'), {:controller => 'user', :action => 'set_status', :status => 'confirmed', :display_name => @this_user.display_name}, {:confirm => t('user.view.confirm')} %> |
71 <% if ["pending", "active", "confirmed", "suspended"].include? @this_user.status %>
72 <%= link_to t('user.view.hide_user'), {:controller => 'user', :action => 'set_status', :status => 'deleted', :display_name => @this_user.display_name}, {:confirm => t('user.view.confirm')} %> |
74 <%= link_to t('user.view.unhide_user'), {:controller => 'user', :action => 'set_status', :status => 'active', :display_name => @this_user.display_name}, {:confirm => t('user.view.confirm')} %> |
76 <%= link_to t('user.view.delete_user'), {:controller => 'user', :action => 'delete', :display_name => @this_user.display_name}, {:confirm => t('user.view.confirm')} %>
80 <p><b><%= t 'user.view.mapper since' %></b> <%= l @this_user.creation_time, :format => :friendly %> <%= t 'user.view.ago', :time_in_words_ago => time_ago_in_words(@this_user.creation_time) %></p>
82 <% if @user and @user.administrator? %>
83 <p><b><%= t 'user.view.email address' %></b> <%= @this_user.email %></p>
84 <p><b><%= t 'user.view.created from' %></b> <%= @this_user.creation_ip %></p>
85 <p><b><%= t 'user.view.status' %></b> <%= @this_user.status.capitalize %></p>
86 <p><b><%= t 'user.view.spam score' %></b> <%= @this_user.spam_score %></p>
89 <h3><%= t 'user.view.description' %></h3>
91 <div id="description"><%= htmlize(@this_user.description) %></div>
93 <% if @user and @this_user.id == @user.id %>
94 <div id="map" class="user_map">
95 <% if @this_user.home_lat.nil? or @this_user.home_lon.nil? %>
96 <p style="position: absolute; top: 0; bottom: 0; width: 90%; height: 30%; margin: auto 5%">
97 <%= 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) %>
100 <%= render :partial => 'map', :locals => { :setting_location => false, :show_other_users => true } %>
104 <% friends = @this_user.friends.collect { |f| f.befriendee } %>
105 <% nearby = @this_user.nearby - friends %>
107 <h3 style="margin-top: 0"><%= t 'user.view.your friends' %></h3>
109 <% if friends.empty? %>
110 <%= t 'user.view.no friends' %>
113 <%= render :partial => "contact", :collection => friends %>
117 <h3><%= t 'user.view.nearby users' %></h3>
119 <% if nearby.empty? %>
120 <%= t 'user.view.no nearby users' %>
122 <table id="nearbyusers">
123 <%= render :partial => "contact", :collection => nearby %>