]> cat aescling's git repositories - mastodon.git/commitdiff
Fix error on account relationships page in admin UI (#17444)
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 5 Feb 2022 04:06:34 +0000 (05:06 +0100)
committerGitHub <noreply@github.com>
Sat, 5 Feb 2022 04:06:34 +0000 (05:06 +0100)
app/controllers/admin/relationships_controller.rb
app/views/admin/relationships/index.html.haml

index f8a95cfc8f0f00c318d09d9b6caf71d13cc09264..085ded21c03e13391a3e889b2023d50cf2135df6 100644 (file)
@@ -9,7 +9,8 @@ module Admin
     def index
       authorize :account, :index?
 
-      @accounts = RelationshipFilter.new(@account, filter_params).results.page(params[:page]).per(PER_PAGE)
+      @accounts = RelationshipFilter.new(@account, filter_params).results.includes(:account_stat, user: [:ips, :invite_request]).page(params[:page]).per(PER_PAGE)
+      @form     = Form::AccountBatch.new
     end
 
     private
index 907477f246ccf8d69b316fb2975913eb3cc46a40..60b9b5b256f6115b7efe7b029380d96a8aabed1f 100644 (file)
 
 %hr.spacer/
 
-.table-wrapper
-  %table.table
-    %thead
-      %tr
-        %th= t('admin.accounts.username')
-        %th= t('admin.accounts.role')
-        %th= t('admin.accounts.most_recent_ip')
-        %th= t('admin.accounts.most_recent_activity')
-        %th
-    %tbody
-      = render partial: 'admin/accounts/account', collection: @accounts
+= form_for(@form, url: batch_admin_accounts_path) do |f|
+  .batch-table
+    .batch-table__toolbar
+      %label.batch-table__toolbar__select.batch-checkbox-all
+        = check_box_tag :batch_checkbox_all, nil, false
+      .batch-table__toolbar__actions
+        = f.button safe_join([fa_icon('lock'), t('admin.accounts.perform_full_suspension')]), name: :suspend, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
+    .batch-table__body
+      - if @accounts.empty?
+        = nothing_here 'nothing-here--under-tabs'
+      - else
+        = render partial: 'admin/accounts/account', collection: @accounts, locals: { f: f }
 
 = paginate @accounts