From 3c033c4352f8b156887cd7157b4a89c23a545838 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 22 Dec 2018 20:02:09 +0100 Subject: Add moderation warnings (#9519) * Add moderation warnings Replace individual routes for disabling, silencing, and suspending a user, as well as the report update route, with a unified account action controller that allows you to select an action (none, disable, silence, suspend) as well as whether it should generate an e-mail notification with optional custom text. That notification, with the optional custom text, is saved as a warning. Additionally, there are warning presets you can configure to save time when performing the above. * Use Account#local_username_and_domain --- config/routes.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'config/routes.rb') diff --git a/config/routes.rb b/config/routes.rb index 0aba433e2..7723a08af 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -139,6 +139,7 @@ Rails.application.routes.draw do resources :domain_blocks, only: [:index, :new, :create, :show, :destroy] resources :email_domain_blocks, only: [:index, :new, :create, :destroy] resources :action_logs, only: [:index] + resources :warning_presets, except: [:new] resource :settings, only: [:edit, :update] resources :invites, only: [:index, :create, :destroy] do @@ -160,7 +161,14 @@ Rails.application.routes.draw do end end - resources :reports, only: [:index, :show, :update] do + resources :reports, only: [:index, :show] do + member do + post :assign_to_self + post :unassign + post :reopen + post :resolve + end + resources :reported_statuses, only: [:create] end @@ -171,7 +179,8 @@ Rails.application.routes.draw do post :subscribe post :unsubscribe post :enable - post :disable + post :unsilence + post :unsuspend post :redownload post :remove_avatar post :remove_header @@ -180,8 +189,7 @@ Rails.application.routes.draw do resource :change_email, only: [:show, :update] resource :reset, only: [:create] - resource :silence, only: [:create, :destroy] - resource :suspension, only: [:new, :create, :destroy] + resource :action, only: [:new, :create], controller: 'account_actions' resources :statuses, only: [:index, :create, :update, :destroy] resource :confirmation, only: [:create] do -- cgit