From 7f26135e064f01e693356d12e3d6d7a0d925a3e8 Mon Sep 17 00:00:00 2001 From: KMY Date: Fri, 17 Mar 2023 08:52:10 +0900 Subject: [PATCH] Add action_log when moderate status --- app/controllers/admin/statuses_controller.rb | 5 +++++ config/locales/en.yml | 5 +++++ config/locales/ja.yml | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/app/controllers/admin/statuses_controller.rb b/app/controllers/admin/statuses_controller.rb index 00c4a792c3..bb313b241b 100644 --- a/app/controllers/admin/statuses_controller.rb +++ b/app/controllers/admin/statuses_controller.rb @@ -36,6 +36,7 @@ module Admin @account.id, no_history: true ) + log_action(:remove_history, @status) redirect_to admin_account_status_path end @@ -47,6 +48,7 @@ module Admin media_ids: [], media_attributes: [] ) + log_action(:remove_media, @status) redirect_to admin_account_status_path end @@ -57,6 +59,7 @@ module Admin @account.id, sensitive: true ) + log_action(:force_sensitive, @status) redirect_to admin_account_status_path end @@ -67,6 +70,7 @@ module Admin @account.id, spoiler_text: 'CW' ) + log_action(:force_cw, @status) redirect_to admin_account_status_path end @@ -76,6 +80,7 @@ module Admin StatusPin.find_by(status: @status)&.destroy @status.account.statuses_count = @status.account.statuses_count - 1 RemovalWorker.perform_async(@status.id, { 'redraft' => false }) + log_action(:remove_status, @status) redirect_to admin_account_path end diff --git a/config/locales/en.yml b/config/locales/en.yml index 956072c5be..a9c4d96c79 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -264,11 +264,16 @@ en: enable_custom_emoji_html: "%{name} enabled emoji %{target}" enable_sign_in_token_auth_user_html: "%{name} enabled e-mail token authentication for %{target}" enable_user_html: "%{name} enabled login for user %{target}" + force_cw_status_html: "%{name} turned post by %{target} cw" + force_sensitive_status_html: "%{name} turned post by %{target} sensitive" memorialize_account_html: "%{name} turned %{target}'s account into a memoriam page" promote_user_html: "%{name} promoted user %{target}" reject_appeal_html: "%{name} rejected moderation decision appeal from %{target}" reject_user_html: "%{name} rejected sign-up from %{target}" remove_avatar_user_html: "%{name} removed %{target}'s avatar" + remove_history_status_html: "%{name} removed post edit histories by %{target}" + remove_media_status_html: "%{name} removed post medias by %{target}" + remove_status_status_html: "%{name} removed post by %{target}" reopen_report_html: "%{name} reopened report %{target}" resend_user_html: "%{name} resent confirmation e-mail for %{target}" reset_password_user_html: "%{name} reset password of user %{target}" diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 19e8312c28..62c102c47b 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -261,11 +261,16 @@ ja: enable_custom_emoji_html: "%{name}さんがカスタム絵文字 %{target}を有効化しました" enable_sign_in_token_auth_user_html: "%{name}さんが%{target}さんのメールトークン認証を有効にしました" enable_user_html: "%{name}さんが%{target}さんのログインを有効化しました" + force_cw_status_html: "%{name}さんが%{target}さんの投稿を強制的にCWにしました" + force_sensitive_status_html: "%{name}さんが%{target}さんの投稿を強制的に閲覧注意にしました" memorialize_account_html: "%{name}さんが%{target}さんを追悼アカウントページに登録しました" promote_user_html: "%{name}さんが%{target}さんを昇格しました" reject_appeal_html: "%{name}さんが%{target}からの抗議を却下しました" reject_user_html: "%{name}さんが%{target}さんからの登録を拒否しました" remove_avatar_user_html: "%{name}さんが%{target}さんのアイコンを削除しました" + remove_history_status_html: "%{name}さんが%{target}さんの投稿の編集履歴を削除しました" + remove_media_status_html: "%{name}さんが%{target}さんの投稿のメディアを削除しました" + remove_status_status_html: "%{name}さんが%{target}さんの投稿を削除しました" reopen_report_html: "%{name}さんが通報 %{target}を未解決に戻しました" resend_user_html: "%{name}さんが%{target}の確認メールを再送信しました" reset_password_user_html: "%{name}さんが%{target}さんのパスワードをリセットしました"