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
953 B
Text
24 lines
953 B
Text
- if Ordergroup.count > 20
|
|
= items_per_page
|
|
= pagination_links_remote @ordergroups
|
|
|
|
%table.table.table-striped
|
|
%thead
|
|
%tr
|
|
%th= sort_link_helper heading_helper(Ordergroup, :name), "name"
|
|
%th= heading_helper Ordergroup, :user_tokens
|
|
%th= heading_helper Ordergroup, :break
|
|
%th= sort_link_helper heading_helper(Ordergroup, :last_user_activity), "last_user_activity"
|
|
%th= sort_link_helper heading_helper(Ordergroup, :last_order), "last_order"
|
|
|
|
%tbody
|
|
- for ordergroup in @ordergroups
|
|
%tr
|
|
%td= ordergroup.name
|
|
%td=h ordergroup.users.collect { |u| show_user(u) }.join(", ")
|
|
- if ordergroup.break_start? or ordergroup.break_end?
|
|
%td= raw t '.break', start: format_date(ordergroup.break_start), end: format_date(ordergroup.break_end)
|
|
- else
|
|
%td
|
|
%td= format_date ordergroup.last_user_activity
|
|
%td= format_date ordergroup.last_order.try(:starts)
|