0
0
Fork 0

Add suspend account functionality to admin UI

This commit is contained in:
Eugen Rochko 2016-12-06 18:22:59 +01:00
parent f406e01fcf
commit f978b06dd1
7 changed files with 56 additions and 13 deletions

View file

@ -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