<%= 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 }) %>
<% 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) %>