From 66becf9a1e8d44c5579e777a546421a54d15dbb0 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 11 Oct 2023 09:58:33 -0400 Subject: [PATCH] Fix haml-lint `InstanceVariables` rule for admin/reports/actions (#27339) --- .haml-lint_todo.yml | 7 +++---- app/views/admin/reports/_actions.html.haml | 8 ++++---- app/views/admin/reports/show.html.haml | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index 69937c4c4..4a141b2e1 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -1,13 +1,13 @@ # This configuration was generated by # `haml-lint --auto-gen-config` -# on 2023-10-03 08:32:28 -0400 using Haml-Lint version 0.51.0. +# on 2023-10-09 10:24:59 -0400 using Haml-Lint version 0.51.0. # The point is for the user to remove these configuration records # one by one as the lints are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of Haml-Lint, may require this file to be generated again. linters: - # Offense count: 944 + # Offense count: 945 LineLength: enabled: false @@ -26,10 +26,9 @@ linters: - 'app/views/admin/reports/show.html.haml' - 'app/views/disputes/strikes/show.html.haml' - # Offense count: 15 + # Offense count: 11 InstanceVariables: exclude: - - 'app/views/admin/reports/_actions.html.haml' - 'app/views/auth/registrations/_status.html.haml' - 'app/views/auth/sessions/two_factor/_otp_authentication_form.html.haml' - 'app/views/relationships/_account.html.haml' diff --git a/app/views/admin/reports/_actions.html.haml b/app/views/admin/reports/_actions.html.haml index aad441625..da9ac8931 100644 --- a/app/views/admin/reports/_actions.html.haml +++ b/app/views/admin/reports/_actions.html.haml @@ -1,11 +1,11 @@ -= form_tag preview_admin_report_actions_path(@report), method: :post do += form_tag preview_admin_report_actions_path(report), method: :post do .report-actions .report-actions__item .report-actions__item__button - = link_to t('admin.reports.mark_as_resolved'), resolve_admin_report_path(@report), method: :post, class: 'button' + = link_to t('admin.reports.mark_as_resolved'), resolve_admin_report_path(report), method: :post, class: 'button' .report-actions__item__description = t('admin.reports.actions.resolve_description_html') - - if @statuses.any? { |status| (status.with_media? || status.with_preview_card?) && !status.discarded? } + - if statuses.any? { |status| (status.with_media? || status.with_preview_card?) && !status.discarded? } .report-actions__item .report-actions__item__button = button_tag t('admin.reports.mark_as_sensitive'), name: :mark_as_sensitive, class: 'button' @@ -28,6 +28,6 @@ = t('admin.reports.actions.suspend_description_html') .report-actions__item .report-actions__item__button - = link_to t('admin.accounts.custom'), new_admin_account_action_path(@report.target_account_id, report_id: @report.id), class: 'button' + = link_to t('admin.accounts.custom'), new_admin_account_action_path(report.target_account_id, report_id: report.id), class: 'button' .report-actions__item__description = t('admin.reports.actions.other_description_html') diff --git a/app/views/admin/reports/show.html.haml b/app/views/admin/reports/show.html.haml index 2508bc2b5..41ce73cfc 100644 --- a/app/views/admin/reports/show.html.haml +++ b/app/views/admin/reports/show.html.haml @@ -179,7 +179,7 @@ %p#actions= t(@report.target_account.local? ? 'admin.reports.actions_description_html' : 'admin.reports.actions_description_remote_html') - = render partial: 'admin/reports/actions' + = render partial: 'admin/reports/actions', locals: { report: @report, statuses: @statuses } - unless @action_logs.empty? %hr.spacer/