<% edit_link = edit_user_path(id: user.id) %> <% delete_link = user_path(id: user.id) %> <% if i < 0 %> <% else %> <%= i + 1 + (@per_page.to_i * (@current_page.to_i - 1)) %> <% end %> <%= link_to(user_path(user), remote: true) do %> <%= display_image(user, "profile_picture.image.small.url", width: "120", height: "auto", class: "img-rectangle", alt: user.display_name) %> <% end %> <%= link_to user.name, user_path(user), remote: true %> <%= link_to user.username, user_path(user), remote: true %> <%= link_to user.email, user_path(user), remote: true, class: "email" %> <% if @current_user.super_admin? %> <% if user.super_admin? %> Super Admin <% else %> <% user.roles.collect(&:name).each do |r| %> <%= r %> <% end %> <% end %> <% else %> <% user.roles.collect(&:name).each do |r| %> <%= r %> <% end %> <% end %> <% if user.pending? %> Pending <% elsif user.approved? %> Approved <% elsif user.suspended? %> Suspended <% end %> <% if display_manage_links? %> <%= link_to raw(" Edit User"), edit_link, :remote=>true, class: "edit" if user.can_be_edited? && display_edit_links? %> <%= link_to raw(" Delete"), delete_link, method: :delete, role: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" if user.can_be_deleted? && (@current_user != user) && display_delete_links? %> <% end %> <% if display_edit_links? %> <%= link_to raw(" Approve"), update_status_user_path(:id =>user.id, :status =>'approved'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1" 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" 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" if user.can_be_suspended? && (@current_user != user) %> <% end %>