0a6345c60b
This commit implements the sort functionality for the user lists (by name, email, last_activity) and ordergroup lists (by name). It is a first attempt addressing issue #560.
24 lines
1.1 KiB
Text
24 lines
1.1 KiB
Text
- if User.undeleted.count > 20
|
|
= items_per_page
|
|
= pagination_links_remote @users
|
|
%table.table.table-striped
|
|
%thead
|
|
%tr
|
|
- if FoodsoftConfig[:use_nick]
|
|
%th= sort_link_helper heading_helper(User, :nick), "nick"
|
|
%th= sort_link_helper heading_helper(User, :name), "name"
|
|
%th= sort_link_helper heading_helper(User, :email), "email"
|
|
%th= sort_link_helper heading_helper(User, :phone), "phone"
|
|
%th= sort_link_helper heading_helper(User, :ordergroup), "ordergroup"
|
|
%th= heading_helper User, :workgroup, count: 3
|
|
%tbody
|
|
- for user in @users
|
|
%tr
|
|
- if FoodsoftConfig[:use_nick]
|
|
%td= show_user user
|
|
%td= user.name if @current_user.role_admin? || user.settings.profile["name_is_public"] || !FoodsoftConfig[:use_nick]
|
|
%td= user.email if @current_user.role_admin? || user.settings.profile["email_is_public"]
|
|
%td= user.phone if @current_user.role_admin? || user.settings.profile["phone_is_public"]
|
|
%td= user.ordergroup_name
|
|
%td= user.workgroups.collect(&:name).join(', ')
|
|
|