<% @registration = @user.registration %>
<% status_hash = {approved: "success", pending: "default", suspended: "danger"} %>
<% if @current_user.super_admin? %> <%= edit_image(@user, "profile_picture.image.large.url", upload_image_link(@user, :profile_picture, nil ), remove_image_link(@user, :profile_picture, nil ), image_options: {assoc_name: :profile_picture }) %> <% else %> <%= display_image(@user, "profile_picture.image.large.url", class: "img-circle img-inline userpic-32", alt: @user.display_name) %> <% end %>
<%= theme_panel_heading(@user.name) %> <%= theme_panel_sub_heading(@user.designation, "#") if @user.designation %> <%= clear_tag(10) %> <%= @user.status.titleize %> <% if @user.super_admin %> Super Admin <% else %> Normal <% end %> <%= clear_tag(10) %>
<% edit_link = edit_user_path(id: @user.id) %> <% delete_link = user_path(id: @user.id) %> <%= link_to raw(" Edit User"), edit_link, :remote=>true, class: "btn btn-block btn-success" if @user.can_be_edited? %> <%= link_to raw(" Delete"), delete_link, method: :delete, role: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "btn btn-block btn-danger btn-only-hover" if @user.can_be_deleted? && (@current_user != @user) %> <% if @current_user.super_admin? %> <%= link_to raw(" Masquerade"), masquerade_user_path(@user), method: :put, data: { confirm: "Are you sure? Do you really want to logout current session and login as #{@user.name}?" }, class: "btn btn-block btn-gray btn-only-hover" if @current_user != @user %> <%= link_to raw(" Remove Super Admin"), remove_super_admin_user_path(id: @user.id), method: :put, :remote=>true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-danger btn-only-hover" if @user.super_admin? && (@current_user != @user) %> <%= link_to raw(" Make Super Admin"), make_super_admin_user_path(id: @user.id), method: :put, remote: true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-gray btn-only-hover" unless @user.super_admin? %> <% end %> <%= link_to raw(" Approve"), update_status_user_path(:id =>@user.id, :status =>'approved'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-success btn-only-hover" if @user.can_be_approved? && (@current_user != @user) %> <%= link_to raw(" Mark as Pending"), update_status_user_path(:id =>@user.id, :status =>'pending'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-gray btn-only-hover" if @user.can_be_marked_as_pending? && (@current_user != @user) %> <%= link_to raw(" Suspend"), update_status_user_path(:id =>@user.id, :status =>'suspended'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-danger btn-only-hover" if @user.can_be_suspended? && (@current_user != @user) %>
<%= clear_tag(50) %>
<%= clear_tag(20) %>
<% if @current_user.super_admin? %> <% end %>
Name<%= @user.name %> Username<%= @user.username %>
Email<%= @user.email %> Phone<%= @user.phone %>
Gender<%= @user.gender %> Date of Birth<%= @user.date_of_birth.strftime("%m/%d/%Y") if @user.date_of_birth %>
Designation<%= @user.designation %> Status <% if @user.pending? %> Pending <% elsif @user.approved? %> Approved <% elsif @user.suspended? %> Suspended <% end %>
Dummy?<%= @user.dummy.to_s.titleize %> Super Admin<%= @user.super_admin?.to_s.titleize %>
<%= clear_tag(20) %> <% if @registration %>
ID<%= @registration.id %> User / Profile ID<%= @registration.user_id %>
Status <% if @registration.pending? %> Pending <% elsif @registration.verified? %> Verified <% elsif @registration.suspended? %> Suspended <% end %>
Country<%= @registration.country.try(:display_name) %> City<%= @registration.city.try(:display_name) %>
Dialing Prefix<%= @registration.dialing_prefix %> Mobile Number<%= @registration.mobile_number %>
Created At<%= @registration.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @registration.created_at %> Updated At<%= @registration.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @registration.updated_at %>
<% end %>
<% if @current_user.super_admin? %>
<%= clear_tag(20) %>
Super Admin?<%= @user.super_admin.to_s.upcase %> Status<%= @user.status.titleize %>
Sign In Count<%= @user.sign_in_count %> Remember User<%= @user.remember_created_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.remember_created_at %>
Current Sign In At<%= @user.current_sign_in_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.current_sign_in_at %> Last Sign In At<%= @user.last_sign_in_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.last_sign_in_at %>
Current Sign In IP<%= @user.current_sign_in_ip %> Last Sign In IP<%= @user.last_sign_in_ip %>
Reset Password Token<%= @user.reset_password_token %> Reset Password Sent At<%= @user.reset_password_sent_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.reset_password_sent_at %>
Locked At<%= @user.locked_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.locked_at %>
Failed Attempts<%= @user.failed_attempts %> Unlock Token<%= @user.unlock_token %>
Confirmation Token<%= @user.confirmation_token %> Confirmation Token Sent At<%= @user.confirmed_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.confirmed_at %>
Confirmation Sent At<%= @user.confirmation_sent_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.confirmation_sent_at %> Uncomfirmed Email<%= @user.unconfirmed_email %>
Auth Token<%= @user.auth_token %> Token Created At<%= @user.token_created_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.token_created_at %>
Created At<%= @user.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.created_at %> Updated At<%= @user.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.updated_at %>
<% end %>
<%= link_to "Close", "#", onclick: "closeLargeModal();", class: "btn btn-primary pull-right" %> <%= clear_tag %>