Show last user activity in admin ordergroups too
This commit is contained in:
parent
8b8693df5a
commit
d56828fa4d
2 changed files with 15 additions and 4 deletions
10
app/helpers/admin/ordergroups_helper.rb
Normal file
10
app/helpers/admin/ordergroups_helper.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
module Admin::OrdergroupsHelper
|
||||
def ordergroup_members_title(ordergroup)
|
||||
s = ''
|
||||
s += ordergroup.users.map(&:name).join(', ') if ordergroup.users.any?
|
||||
if ordergroup.contact_person.present?
|
||||
s += "\n" + Ordergroup.human_attribute_name(:contact) + ": " + ordergroup.contact_person
|
||||
end
|
||||
s
|
||||
end
|
||||
end
|
|
@ -5,17 +5,18 @@
|
|||
%thead
|
||||
%tr
|
||||
%th= heading_helper Ordergroup, :name
|
||||
%th= heading_helper Ordergroup, :contact
|
||||
%th= heading_helper Ordergroup, :contact_address
|
||||
%th= heading_helper Ordergroup, :user_tokens
|
||||
%th= heading_helper Ordergroup, :contact_address
|
||||
%th= heading_helper Ordergroup, :last_user_activity
|
||||
%th= t 'ui.actions'
|
||||
%tbody
|
||||
- for ordergroup in @ordergroups
|
||||
%tr{:class => cycle('even','odd', :name => 'groups')}
|
||||
%td= link_to ordergroup.name, [:admin, ordergroup]
|
||||
%td= ordergroup.contact
|
||||
%td{title: ordergroup_members_title(ordergroup)}
|
||||
%abbr{title: ordergroup_members_title(ordergroup)}= ordergroup.users.size
|
||||
%td= link_to_gmaps ordergroup.contact_address
|
||||
%td= ordergroup.users.size
|
||||
%td= format_date ordergroup.last_user_activity
|
||||
%td
|
||||
= link_to t('ui.edit'), edit_admin_ordergroup_path(ordergroup), class: 'btn btn-mini'
|
||||
= link_to t('ui.delete'), [:admin, ordergroup], :data => {:confirm => t('admin.confirm', name: ordergroup.name)},
|
||||
|
|
Loading…
Reference in a new issue