Sha256: 2e31e2483d639c51781bdeaa290aa62cd3da87fa4ac3dab7692a42eace562f42

Contents?: true

Size: 1.04 KB

Versions: 79

Compression:

Stored size: 1.04 KB

Contents

json.records do
  json.array!(@users) do |user|
    unless user.is_super_admin? && !current_user.is_super_admin?
      json.extract!(user, :id, :email)
      json.roles user.roles.map(&:title).to_sentence
      json.created_at user.created_at.strftime('%B %e, %Y')
      if user.last_sign_in_at
        json.last_login user.last_sign_in_at.strftime('%B %e, %Y')
      else
        json.last_login "Never"
      end

      unless user == current_user
        json.approval_link action_link(user.approved? ? "Unapprove" : "Approve", approve_user_path(user), :icon => user.approved? ? "thumbdown" : "thumbup", :class => "approve", :confirm => user.approved? ? "Are you sure you want to unapprove this user?" : "Are you sure? The user will be notified by email.") if can?(:edit, user)
      end

      json.edit_path edit_user_path(user)
      json.edit_link edit_link(user)
      json.delete_link delete_link(user)
    end
  end
end

json.pagination do
  json.currentPage @users.current_page
  json.totalPages @users.total_pages
  json.totalEntries @users.total_entries
end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
tenon-1.1.4 app/views/tenon/users/index.json.jbuilder
tenon-1.1.3 app/views/tenon/users/index.json.jbuilder
tenon-1.1.2 app/views/tenon/users/index.json.jbuilder
tenon-1.1.1 app/views/tenon/users/index.json.jbuilder
tenon-1.0.76 app/views/tenon/users/index.json.jbuilder
tenon-1.0.75 app/views/tenon/users/index.json.jbuilder
tenon-1.0.74 app/views/tenon/users/index.json.jbuilder
tenon-1.0.73 app/views/tenon/users/index.json.jbuilder
tenon-1.0.72 app/views/tenon/users/index.json.jbuilder
tenon-1.0.71 app/views/tenon/users/index.json.jbuilder
tenon-1.0.70 app/views/tenon/users/index.json.jbuilder
tenon-1.0.69 app/views/tenon/users/index.json.jbuilder
tenon-1.0.68 app/views/tenon/users/index.json.jbuilder
tenon-1.0.67 app/views/tenon/users/index.json.jbuilder
tenon-1.0.66 app/views/tenon/users/index.json.jbuilder
tenon-1.0.65 app/views/tenon/users/index.json.jbuilder
tenon-1.0.64 app/views/tenon/users/index.json.jbuilder
tenon-1.0.63 app/views/tenon/users/index.json.jbuilder
tenon-1.0.62 app/views/tenon/users/index.json.jbuilder
tenon-1.0.61 app/views/tenon/users/index.json.jbuilder