2017-11-23 20:05:53 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Admin::ActionLogsHelper
|
|
|
|
def log_target(log)
|
2022-08-25 14:39:40 -04:00
|
|
|
case log.target_type
|
2019-03-15 11:57:23 -04:00
|
|
|
when 'Account'
|
2022-08-25 14:39:40 -04:00
|
|
|
link_to log.human_identifier, admin_account_path(log.target_id)
|
2019-03-15 11:57:23 -04:00
|
|
|
when 'User'
|
2022-08-25 14:39:40 -04:00
|
|
|
link_to log.human_identifier, admin_account_path(log.route_param)
|
|
|
|
when 'UserRole'
|
|
|
|
link_to log.human_identifier, admin_roles_path(log.target_id)
|
2019-03-15 11:57:23 -04:00
|
|
|
when 'CustomEmoji'
|
2022-08-25 14:39:40 -04:00
|
|
|
log.human_identifier
|
2019-03-15 11:57:23 -04:00
|
|
|
when 'Report'
|
2022-08-25 14:39:40 -04:00
|
|
|
link_to "##{log.human_identifier}", admin_report_path(log.target_id)
|
2021-05-05 17:39:02 -04:00
|
|
|
when 'DomainBlock', 'DomainAllow', 'EmailDomainBlock', 'UnavailableDomain'
|
2022-08-25 14:39:40 -04:00
|
|
|
link_to log.human_identifier, "https://#{log.human_identifier}"
|
2019-03-15 11:57:23 -04:00
|
|
|
when 'Status'
|
2022-08-25 14:39:40 -04:00
|
|
|
link_to log.human_identifier, log.permalink
|
2019-03-15 11:57:23 -04:00
|
|
|
when 'AccountWarning'
|
2022-08-25 14:39:40 -04:00
|
|
|
link_to log.human_identifier, admin_account_path(log.target_id)
|
2020-01-23 16:00:13 -05:00
|
|
|
when 'Announcement'
|
2022-08-25 14:39:40 -04:00
|
|
|
link_to truncate(log.human_identifier), edit_admin_announcement_path(log.target_id)
|
2020-10-12 10:33:49 -04:00
|
|
|
when 'IpBlock'
|
2022-08-25 14:39:40 -04:00
|
|
|
log.human_identifier
|
2021-12-17 17:01:21 -05:00
|
|
|
when 'Instance'
|
2022-08-25 14:39:40 -04:00
|
|
|
log.human_identifier
|
2022-02-14 15:27:53 -05:00
|
|
|
when 'Appeal'
|
2022-08-25 14:39:40 -04:00
|
|
|
link_to log.human_identifier, disputes_strike_path(log.route_param)
|
2019-03-15 11:57:23 -04:00
|
|
|
end
|
|
|
|
end
|
2017-11-23 20:05:53 -05:00
|
|
|
end
|