<% content_for :main do %>

User '<%= @user.email %>'

<%= icon_to "Back to User List", "/admin/user" %>
<% if current_user.superadmin? %> <% end %> <% if Preference.get_cached(_sid, 'show_groups') %> <% end %> <% if feature?("forums") %> <% end %> <% if feature?("newsletters") %> <% end %> <% if @user.locked_at %> <% end %> <% if feature?("forums") %> <% end %> <% if feature?("forums") %> <% end %> <% if feature?("ads") %> <% end %> <% if @user.ranking <= current_user.ranking %> <% end %>
ID:<%= @user.id %>
User Permission Level: <%= @user.ranking %>
<%= link_to "Groups", "/admin/groups" %>: <%= @user.groups.map {|g| link_to g.name, "/admin/user/#{@user.id}/group/#{g.id}", :method=>"delete" }.join(", ").html_safe %> <%= "click to remove".html_safe if @user.groups.size>0 %> <% one_group = false %>
<%= link_to_function "Add to other groups", "$('#add_to_groups').slideDown(); $('#add_to_groups_link').hide();", :id=>"add_to_groups_link", :class=>"action" if one_group %>
Login Email:
<%= best_in_place @user, :email, :path=>"/admin/user/#{@user.id}" %> click to edit
Display Name:
<%= best_in_place @user, :display_name, :path=>"/admin/user/#{@user.id}" %> click to edit
Password:
<%= best_in_place @user, :password, :path=>"/admin/user/#{@user.id}/password" %>
Sign in count:<%= @user.sign_in_count %>
Registered:<%= time_ago_in_words(@user.created_at) %> ago at <%= @user.created_at %>
Last sign in:<%= time_ago_in_words(@user.last_sign_in_at) rescue 'never' %> ago at <%= @user.last_sign_in_at rescue 'never' %>
Current sign in:<%= time_ago_in_words(@user.current_sign_in_at) rescue 'never' %> ago at <%= @user.current_sign_in_at rescue 'never'%>
Current sign in IP:<%= @user.current_sign_in_ip %>
Last sign in:<%= time_ago_in_words(@user.last_sign_in_at) rescue 'never' %>
Last sign in IP:<%= @user.last_sign_in_ip rescue 'none' %>
Subscribed Newsletter:<%= @user.subscribe_newsletter==1 ? 'Yes' : 'No' %> <%= link_to "Unsubscribe", "/admin/user/#{@user.id}?newsletter=0", :class=>"action_pl" if @user.subscribe_newsletter==1 %> <%= link_to "Subscribe", "/admin/user/#{@user.id}?newsletter=1", :class=>"action_pl" if @user.subscribe_newsletter==0 %>
Locked:<%= time_ago_in_words(@user.locked_at) %> ago <%= link_to "Unlock Now", "/admin/user/#{@user.id}?unlock=1" %>
Banned: <% if @user.not_banned? %> No <% else %> <%= time_ago_in_words(@user.banned_at) %> <% end %> <%= link_to @user.not_banned? ? "Ban" : "Unban", "/admin/user/#{@user.id}?#{@user.not_banned? ? 'ban':'unban'}=1", :class=>"action_pl" %>
Spam Points:<%= @user.spam_points %> <%= link_to "Zero", "/admin/user/#{@user.id}?spam_points=0", :class=>"action_pl" %>
When a user conducts activity that looks like it might be related to spamming this score is increased. When it exceeds <%= (Preference.getCached(_sid, 'spam_points_to_ban_user') || "10") %> the user will be automatically banned.
Forum Status: <%= @user.forum_status %> <%= link_to "Increase", "/admin/user/#{@user.id}?forum_status=up", :class=>"action_pl" %> <%= link_to "Decrease", "/admin/user/#{@user.id}?forum_status=down", :class=>"action_pl" %> Higher number indicates higher risk
Moderator:<%= @user.moderator? ? "Yes" : "No" %> <%= link_to @user.moderator? ? "Revoke" : "Grant", "/admin/user/#{@user.id}?moderator=#{@user.moderator? ? '0' : '1'}", :class=>"action_pl" %>
Editor/Admin:<%= @user.admin? ? "Yes" : "No" %> <%= link_to @user.admin? ? "Revoke" : "Grant", "/admin/user/#{@user.id}?admin=#{@user.admin? ? '0' : '1'}", :class=>"action_pl" %>
Designer:<%= @user.designer? ? "Yes" : "No" %> <%= link_to @user.designer? ? "Revoke" : "Grant", "/admin/user/#{@user.id}?designer=#{@user.designer? ? '0' : '1'}", :class=>"action_pl" %>
Forum Access Level: <%= @user.forum_level %> <%= link_to "Increase", "/admin/user/#{@user.id}?forum_level=up", :class=>"action_pl" %> <%= link_to "Decrease", "/admin/user/#{@user.id}?forum_level=down", :class=>"action_pl" %>
Advertisments: <%= @user.ads.count %> <%= icon_to "Show Ads", "/admin/ads?user_id=#{@user.id}", false,:style=>"display: inline-block; margin-left: 10px; padding: 20px;" %>
<%= link_to "Login As This User", "/admin/user/#{@user.id}/become", {:method=>"POST", :class=>"action"} %>

User Attributes

<% UserAttribute.sys(_sid).all.each do |ua| %> <% uav = @user.user_attribute_values.where(:user_attribute_id=>ua.id).first || UserAttributeValue.new %> <%# = text_field_tag "parameter[#{ua.id}]", uav ? uav.value : '' %> <% end %>
<%= ua.name.titleize %>:<%= best_in_place uav, :value, :path=>"/admin/user/#{@user.id}/attribute/#{ua.id}" %>

User Notes

<%= icon_to_function "Add New Note", "$('#add_note').slideDown(); $('#add_note_link').hide();", false, :id=>"add_note_link" %> <%= icon_to "EMail User", "/admin/user/#{@user.id}/email" %>
<% @user.user_notes.order("created_at desc").each do |note| %> <% end %>
<%= note.category %> <%= note.description ? field_reveal(note.description.html_safe, 160) : ' '%> <%= time_ago_in_words(note.created_at) %> ago <%= note.created_by.email rescue 'System' %>
<%= icon_to "Back to User List", "/admin/user", false, :style=>"margin-top: 20px;" %> <% end unless @user.id.to_i==1 %>