about summary refs log tree commit diff
path: root/app/controllers/admin
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-01-02 13:45:18 +0100
committerThibaut Girka <thib@sitedethib.com>2019-01-02 15:36:53 +0100
commit571d219bb917cefcca7419a0ad4e3889689d5f6a (patch)
tree6ab91adcb2c164fd027708e58f5fb96c52474007 /app/controllers/admin
parentb300948526d967aaf5608c93546ee0d54940c0ef (diff)
parent66436d08959998be20c6c6bf631177d8c1f3e0d1 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts manually resolved:
- app/services/post_status_service.rb
- config/locales/simple_form.pl.yml
- config/routes.rb
- config/webpack/loaders/sass.js
- config/webpack/shared.js
- package.json
- yarn.lock
Diffstat (limited to 'app/controllers/admin')
-rw-r--r--app/controllers/admin/account_actions_controller.rb2
-rw-r--r--app/controllers/admin/accounts_controller.rb5
-rw-r--r--app/controllers/admin/followers_controller.rb22
3 files changed, 25 insertions, 4 deletions
diff --git a/app/controllers/admin/account_actions_controller.rb b/app/controllers/admin/account_actions_controller.rb
index e847495f1..a2cea461e 100644
--- a/app/controllers/admin/account_actions_controller.rb
+++ b/app/controllers/admin/account_actions_controller.rb
@@ -17,7 +17,7 @@ module Admin
       account_action.save!
 
       if account_action.with_report?
-        redirect_to admin_report_path(account_action.report)
+        redirect_to admin_reports_path
       else
         redirect_to admin_account_path(@account.id)
       end
diff --git a/app/controllers/admin/accounts_controller.rb b/app/controllers/admin/accounts_controller.rb
index f5e5f7ed5..562fba996 100644
--- a/app/controllers/admin/accounts_controller.rb
+++ b/app/controllers/admin/accounts_controller.rb
@@ -62,9 +62,8 @@ module Admin
     def redownload
       authorize @account, :redownload?
 
-      @account.reset_avatar!
-      @account.reset_header!
-      @account.save!
+      @account.update!(last_webfingered_at: nil)
+      ResolveAccountService.new.call(@account)
 
       redirect_to admin_account_path(@account.id)
     end
diff --git a/app/controllers/admin/followers_controller.rb b/app/controllers/admin/followers_controller.rb
new file mode 100644
index 000000000..819628b20
--- /dev/null
+++ b/app/controllers/admin/followers_controller.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+module Admin
+  class FollowersController < BaseController
+    before_action :set_account
+
+    PER_PAGE = 40
+
+    def index
+      authorize :account, :index?
+      @followers = followers.recent.page(params[:page]).per(PER_PAGE)
+    end
+
+    def set_account
+      @account = Account.find(params[:account_id])
+    end
+
+    def followers
+      Follow.includes(:account).where(target_account: @account)
+    end
+  end
+end