Fix haml-lint `InstanceVariables` rule for auth/registrations/status (#27341)

pull/2444/head
Matt Jankowski 2023-10-11 10:20:26 -04:00 committed by GitHub
parent 0111e48893
commit f9abe700e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 13 deletions

View File

@ -1,6 +1,6 @@
# This configuration was generated by # This configuration was generated by
# `haml-lint --auto-gen-config` # `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 # The point is for the user to remove these configuration records
# one by one as the lints are removed from the code base. # one by one as the lints are removed from the code base.
# Note that changes in the inspected code, or installation of new # 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/admin/reports/show.html.haml'
- 'app/views/disputes/strikes/show.html.haml' - 'app/views/disputes/strikes/show.html.haml'
# Offense count: 11 # Offense count: 2
InstanceVariables: InstanceVariables:
exclude: exclude:
- 'app/views/auth/registrations/_status.html.haml'
- 'app/views/auth/sessions/two_factor/_otp_authentication_form.html.haml' - 'app/views/auth/sessions/two_factor/_otp_authentication_form.html.haml'
- 'app/views/relationships/_account.html.haml' - 'app/views/relationships/_account.html.haml'

View File

@ -1,30 +1,30 @@
- if !@user.confirmed? - if !user.confirmed?
.flash-message.warning .flash-message.warning
= t('auth.status.confirming') = t('auth.status.confirming')
= link_to t('auth.didnt_get_confirmation'), new_user_confirmation_path = link_to t('auth.didnt_get_confirmation'), new_user_confirmation_path
- elsif !@user.approved? - elsif !user.approved?
.flash-message.warning .flash-message.warning
= t('auth.status.pending') = t('auth.status.pending')
- elsif @user.account.moved_to_account_id.present? - elsif user.account.moved_to_account_id.present?
.flash-message.warning .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 = link_to t('migrations.cancel'), settings_migration_path
%h3= t('auth.status.account_status') %h3= t('auth.status.account_status')
%p.hint %p.hint
- if @user.account.suspended? - if user.account.suspended?
%span.negative-hint= t('user_mailer.warning.explanation.suspend') %span.negative-hint= t('user_mailer.warning.explanation.suspend')
- elsif @user.disabled? - elsif user.disabled?
%span.negative-hint= t('user_mailer.warning.explanation.disable') %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') %span.warning-hint= t('user_mailer.warning.explanation.silence')
- else - else
%span.positive-hint= t('auth.status.functional') %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/ %hr.spacer/
%p.muted-hint %p.muted-hint

View File

@ -1,7 +1,7 @@
- content_for :page_title do - content_for :page_title do
= t('settings.account_settings') = t('settings.account_settings')
= render 'status' = render partial: 'status', locals: { user: @user, strikes: @strikes }
%h3= t('auth.security') %h3= t('auth.security')