diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-12-06 18:22:59 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-12-06 18:22:59 +0100 |
commit | f978b06dd188fef4c2ece5e787818579b663ddf8 (patch) | |
tree | 70a0969b208ac3b0393c5fb9e54b8bd222782e6f /app/controllers | |
parent | f406e01fcf7d69045cf3ad8ea8dea51acd85535b (diff) |
Add suspend account functionality to admin UI
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin/accounts_controller.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/controllers/admin/accounts_controller.rb b/app/controllers/admin/accounts_controller.rb index ff1989b52..55436d253 100644 --- a/app/controllers/admin/accounts_controller.rb +++ b/app/controllers/admin/accounts_controller.rb @@ -7,13 +7,14 @@ class Admin::AccountsController < ApplicationController layout 'public' def index - @accounts = Account.order('domain ASC, username ASC').paginate(page: params[:page], per_page: 40) + @accounts = Account.alphabetic.paginate(page: params[:page], per_page: 40) @accounts = @accounts.local if params[:local].present? @accounts = @accounts.remote if params[:remote].present? @accounts = @accounts.where(domain: params[:by_domain]) if params[:by_domain].present? - @accounts = @accounts.where(silenced: true) if params[:silenced].present? - @accounts = @accounts.reorder('id desc') if params[:recent].present? + @accounts = @accounts.silenced if params[:silenced].present? + @accounts = @accounts.recent if params[:recent].present? + @accounts = @accounts.suspended if params[:suspended].present? end def show; end @@ -26,6 +27,11 @@ class Admin::AccountsController < ApplicationController end end + def suspend + Admin::SuspensionWorker.perform_async(@account.id) + redirect_to admin_accounts_path + end + private def set_account |