Fix haml-lint `InstanceVariables` rule for auth/registrations/edit (#26061)

local
Matt Jankowski 10 months ago committed by GitHub
parent f6dda59e5d
commit 6657695ec6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      .haml-lint_todo.yml
  2. 16
      app/views/auth/registrations/_session.html.haml
  3. 19
      app/views/auth/registrations/_sessions.html.haml
  4. 2
      app/views/auth/registrations/edit.html.haml

@ -1,6 +1,6 @@
# This configuration was generated by
# `haml-lint --auto-gen-config`
# on 2023-07-18 11:29:47 -0400 using Haml-Lint version 0.48.0.
# on 2023-07-18 11:56:05 -0400 using Haml-Lint version 0.48.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,13 +26,12 @@ linters:
- 'app/views/admin/reports/show.html.haml'
- 'app/views/disputes/strikes/show.html.haml'
# Offense count: 41
# Offense count: 40
InstanceVariables:
exclude:
- 'app/views/admin/reports/_actions.html.haml'
- 'app/views/admin/roles/_form.html.haml'
- 'app/views/admin/webhooks/_form.html.haml'
- 'app/views/auth/registrations/_sessions.html.haml'
- 'app/views/auth/registrations/_status.html.haml'
- 'app/views/auth/sessions/two_factor/_otp_authentication_form.html.haml'
- 'app/views/authorize_interactions/_post_follow_actions.html.haml'

@ -0,0 +1,16 @@
%tr
%td
%span{ title: session.user_agent }<
= fa_icon "#{session_device_icon(session)} fw", 'aria-label': session_device_icon(session)
= ' '
= t 'sessions.description', browser: t("sessions.browsers.#{session.browser}", default: session.browser.to_s), platform: t("sessions.platforms.#{session.platform}", default: session.platform.to_s)
%td
%samp= session.ip
%td
- if current_session.session_id == session.session_id
= t 'sessions.current_session'
- else
%time.time-ago{ datetime: session.updated_at.iso8601, title: l(session.updated_at) }= l(session.updated_at)
%td
- if current_session.session_id != session.session_id && !current_account.suspended?
= table_link_to 'times', t('sessions.revoke'), settings_session_path(session), method: :delete

@ -14,21 +14,4 @@
%th= t 'sessions.activity'
%th
%tbody
- @sessions.each do |session|
%tr
%td
%span{ title: session.user_agent }<
= fa_icon "#{session_device_icon(session)} fw", 'aria-label': session_device_icon(session)
= ' '
= t 'sessions.description', browser: t("sessions.browsers.#{session.browser}", default: session.browser.to_s), platform: t("sessions.platforms.#{session.platform}", default: session.platform.to_s)
%td
%samp= session.ip
%td
- if current_session.session_id == session.session_id
= t 'sessions.current_session'
- else
%time.time-ago{ datetime: session.updated_at.iso8601, title: l(session.updated_at) }= l(session.updated_at)
%td
- if current_session.session_id != session.session_id && !current_account.suspended?
= table_link_to 'times', t('sessions.revoke'), settings_session_path(session), method: :delete
= render partial: 'session', collection: sessions

@ -30,7 +30,7 @@
%hr.spacer/
= render 'sessions'
= render partial: 'sessions', object: @sessions
- unless current_account.suspended?
%hr.spacer/

Loading…
Cancel
Save