UX: include a flag reason in the post-deleted-by-staff-because-of-flags message

This commit is contained in:
Neil Lalonde
2018-07-30 16:45:35 -04:00
parent c12a9279f6
commit fd29ecb91a
3 changed files with 11 additions and 2 deletions

View File

@@ -201,7 +201,10 @@ class PostDestroyer
:send_system_message,
user_id: @post.user.id,
message_type: :flags_agreed_and_post_deleted,
message_options: { url: @post.url }
message_options: {
url: @post.url,
flag_reason: I18n.t("flag_reasons.#{@post.active_flags.last.post_action_type.name_key}", locale: SiteSetting.default_locale)
}
)
end