mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Archive: show event authors username for clients
This commit is contained in:
parent
871e289973
commit
bb6afc7e87
3 changed files with 16 additions and 4 deletions
|
@ -10,4 +10,16 @@ module WhodunnitHelper
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def whodunnit_with_protocol(whodunnit)
|
||||||
|
return nil unless whodunnit
|
||||||
|
if whodunnit.include?('-EppUser')
|
||||||
|
user = EppUser.find(whodunnit)
|
||||||
|
return "#{user.username} (EPP)"
|
||||||
|
end
|
||||||
|
user = User.find(whodunnit)
|
||||||
|
return user.username
|
||||||
|
rescue ActiveRecord::RecordNotFound
|
||||||
|
return nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
- @versions.each do |x|
|
- @versions.each do |x|
|
||||||
%tr
|
%tr
|
||||||
%td= x.event
|
%td= x.event
|
||||||
%td= link_to_whodunnit(x.whodunnit)
|
%td= whodunnit_with_protocol(x.whodunnit)
|
||||||
%td= l(x.created_at, format: :short)
|
%td= l(x.created_at, format: :short)
|
||||||
%td= link_to(t('shared.contact'), client_contact_path(x.item_id))
|
%td= link_to(t('shared.contact'), client_contact_path(x.item_id))
|
||||||
%td= link_to(t('shared.details'), client_contact_version_path(x, event: x.event))
|
%td= link_to(t('shared.details'), client_contact_version_path(x, event: x.event))
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
= t('shared.whodunnit')
|
= t('shared.whodunnit')
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t('shared.created_at')
|
= t('shared.created_at')
|
||||||
%th{class: 'col-xs-1'}
|
-#%th{class: 'col-xs-1'}
|
||||||
= t('shared.item_id')
|
= t('shared.item_id')
|
||||||
=# sort_link(@q, 'email', t('shared.email'))
|
=# sort_link(@q, 'email', t('shared.email'))
|
||||||
%th{class: 'col-xs-1'}
|
%th{class: 'col-xs-1'}
|
||||||
|
@ -27,9 +27,9 @@
|
||||||
- @versions.each do |x|
|
- @versions.each do |x|
|
||||||
%tr
|
%tr
|
||||||
%td= x.event
|
%td= x.event
|
||||||
%td= link_to_whodunnit(x.whodunnit)
|
%td= whodunnit_with_protocol(x.whodunnit)
|
||||||
%td= l(x.created_at, format: :short)
|
%td= l(x.created_at, format: :short)
|
||||||
%td= link_to(t('shared.domain'), client_domain_path(x.item_id))
|
-#%td= link_to(t('shared.domain'), client_domain_path(x.item_id))
|
||||||
%td= link_to(t('shared.details'), client_domain_version_path(x, event: x.event))
|
%td= link_to(t('shared.details'), client_domain_version_path(x, event: x.event))
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue