From f9abe700e73df76963aa0f74a87e518ddc5c4584 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 11 Oct 2023 10:20:26 -0400 Subject: [PATCH] Fix haml-lint `InstanceVariables` rule for auth/registrations/status (#27341) --- .haml-lint_todo.yml | 5 ++--- app/views/auth/registrations/_status.html.haml | 18 +++++++++--------- app/views/auth/registrations/edit.html.haml | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index 4a141b2e1d..cfa39a24e2 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `haml-lint --auto-gen-config` -# on 2023-10-09 10:24:59 -0400 using Haml-Lint version 0.51.0. +# on 2023-10-11 10:00:39 -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 @@ -26,10 +26,9 @@ linters: - 'app/views/admin/reports/show.html.haml' - 'app/views/disputes/strikes/show.html.haml' - # Offense count: 11 + # Offense count: 2 InstanceVariables: exclude: - - '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/auth/registrations/_status.html.haml b/app/views/auth/registrations/_status.html.haml index 759bbc41c0..8f44eee015 100644 --- a/app/views/auth/registrations/_status.html.haml +++ b/app/views/auth/registrations/_status.html.haml @@ -1,30 +1,30 @@ -- if !@user.confirmed? +- if !user.confirmed? .flash-message.warning = t('auth.status.confirming') = link_to t('auth.didnt_get_confirmation'), new_user_confirmation_path -- elsif !@user.approved? +- elsif !user.approved? .flash-message.warning = t('auth.status.pending') -- elsif @user.account.moved_to_account_id.present? +- elsif user.account.moved_to_account_id.present? .flash-message.warning - = t('auth.status.redirecting_to', acct: @user.account.moved_to_account.pretty_acct) + = t('auth.status.redirecting_to', acct: user.account.moved_to_account.pretty_acct) = link_to t('migrations.cancel'), settings_migration_path %h3= t('auth.status.account_status') %p.hint - - if @user.account.suspended? + - if user.account.suspended? %span.negative-hint= t('user_mailer.warning.explanation.suspend') - - elsif @user.disabled? + - elsif user.disabled? %span.negative-hint= t('user_mailer.warning.explanation.disable') - - elsif @user.account.silenced? + - elsif user.account.silenced? %span.warning-hint= t('user_mailer.warning.explanation.silence') - else %span.positive-hint= t('auth.status.functional') -= render partial: 'account_warning', collection: @strikes += render partial: 'account_warning', collection: strikes -- if @user.account.strikes.exists? +- if user.account.strikes.exists? %hr.spacer/ %p.muted-hint diff --git a/app/views/auth/registrations/edit.html.haml b/app/views/auth/registrations/edit.html.haml index 3e9b0cb6bd..908119a21a 100644 --- a/app/views/auth/registrations/edit.html.haml +++ b/app/views/auth/registrations/edit.html.haml @@ -1,7 +1,7 @@ - content_for :page_title do = t('settings.account_settings') -= render 'status' += render partial: 'status', locals: { user: @user, strikes: @strikes } %h3= t('auth.security')