about summary refs log tree commit diff
path: root/app/helpers/admin/action_logs_helper.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-01-24 17:28:22 +0100
committerGitHub <noreply@github.com>2020-01-24 17:28:22 +0100
commit0be67df4f0a64367d9e376b06bd3fd2fb9ca8195 (patch)
tree2eaa85c899033aab9bd1b2f9da2d727ce5788e16 /app/helpers/admin/action_logs_helper.rb
parenta8c109baca4d02cc8aed454e231518c1f8ec1844 (diff)
parentbdc1581556b86ba25a385c9309db714eeaba1ca1 (diff)
Merge pull request #1265 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/helpers/admin/action_logs_helper.rb')
-rw-r--r--app/helpers/admin/action_logs_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/admin/action_logs_helper.rb b/app/helpers/admin/action_logs_helper.rb
index 608a99dd5..6bc75aa56 100644
--- a/app/helpers/admin/action_logs_helper.rb
+++ b/app/helpers/admin/action_logs_helper.rb
@@ -22,6 +22,8 @@ module Admin::ActionLogsHelper
       log.recorded_changes.slice('severity', 'reject_media')
     elsif log.target_type == 'Status' && log.action == :update
       log.recorded_changes.slice('sensitive')
+    elsif log.target_type == 'Announcement' && log.action == :update
+      log.recorded_changes.slice('text', 'starts_at', 'ends_at', 'all_day')
     end
   end
 
@@ -52,6 +54,8 @@ module Admin::ActionLogsHelper
       'pencil'
     when 'AccountWarning'
       'warning'
+    when 'Announcement'
+      'bullhorn'
     end
   end
 
@@ -94,6 +98,8 @@ module Admin::ActionLogsHelper
       link_to record.account.acct, ActivityPub::TagManager.instance.url_for(record)
     when 'AccountWarning'
       link_to record.target_account.acct, admin_account_path(record.target_account_id)
+    when 'Announcement'
+      link_to "##{record.id}", edit_admin_announcement_path(record.id)
     end
   end
 
@@ -111,6 +117,8 @@ module Admin::ActionLogsHelper
       else
         I18n.t('admin.action_logs.deleted_status')
       end
+    when 'Announcement'
+      "##{attributes['id']}"
     end
   end
 end