<% status_hash = {approved: "success", pending: "default", suspended: "danger"} %>
<%= 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 }) %>
<%= 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) %>
Username<%= @user.username %> Email<%= @user.email %>
Phone<%= @user.phone %> Designation<%= @user.designation %>
Super Admim?<%= @user.super_admin %> Status<%= @user.status.titleize %>
<%= clear_tag(20) %>
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 %>
<%= link_to "Close", "#", onclick: "closeLargeModal();", class: "btn btn-primary pull-right" %> <%= clear_tag %>