OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/cells/users/table_cell.rb

28 lines
626 B

module Users
class TableCell < ::TableCell
options :current_user # adds this option to those of the base class
columns :login, :firstname, :lastname, :mail, :admin, :created_at, :last_login_on
def initial_sort
%i[id asc]
end
def headers
columns.map do |name|
[name.to_s, header_options(name)]
end
end
def header_options(name)
options = { caption: User.human_attribute_name(name) }
options[:default_order] = 'desc' if desc_by_default.include? name
options
end
def desc_by_default
%i[admin created_at last_login_on]
end
end
end