Use `size: ...` shorthand for width/height of square images

pull/32400/head
Matt Jankowski 2024-10-10 14:33:09 -04:00
parent 6f5eb22135
commit c6c43a7b1d
16 changed files with 19 additions and 19 deletions

View File

@ -28,7 +28,7 @@ module Admin::AccountModerationNotesHelper
def labeled_account_avatar(account)
safe_join(
[
image_tag(account.avatar.url, width: 15, height: 15, alt: '', class: 'avatar'),
image_tag(account.avatar.url, size: 15, alt: '', class: 'avatar'),
account_inline_text(account),
],
' '

View File

@ -13,7 +13,7 @@ module HomeHelper
section = if account.nil?
content_tag(:div, class: 'account__display-name') do
content_tag(:div, class: 'account__avatar-wrapper') do
image_tag(full_asset_url('avatars/original/missing.png', skip_pipeline: true), class: 'account__avatar')
image_tag(full_asset_url('avatars/original/missing.png', skip_pipeline: true), class: 'account__avatar', size: 46)
end +
content_tag(:span, class: 'display-name') do
content_tag(:strong, t('about.contact_missing')) +
@ -23,7 +23,7 @@ module HomeHelper
else
link_to(path || ActivityPub::TagManager.instance.url_for(account), class: 'account__display-name') do
content_tag(:div, class: 'account__avatar-wrapper') do
image_tag(full_asset_url(current_account&.user&.setting_auto_play_gif ? account.avatar_original_url : account.avatar_static_url), class: 'account__avatar', width: 46, height: 46)
image_tag(full_asset_url(current_account&.user&.setting_auto_play_gif ? account.avatar_original_url : account.avatar_static_url), class: 'account__avatar', size: 46)
end +
content_tag(:span, class: 'display-name') do
content_tag(:bdi) do

View File

@ -39,7 +39,7 @@ module SettingsHelper
return if account.nil?
link_to ActivityPub::TagManager.instance.url_for(account), class: 'name-tag', title: account.acct do
safe_join([image_tag(account.avatar.url, width: 15, height: 15, alt: '', class: 'avatar'), content_tag(:span, account.acct, class: 'username')], ' ')
safe_join([image_tag(account.avatar.url, size: 15, alt: '', class: 'avatar'), content_tag(:span, account.acct, class: 'username')], ' ')
end
end

View File

@ -1,7 +1,7 @@
.log-entry
.log-entry__header
.log-entry__avatar
= image_tag action_log.account.avatar.url(:original), alt: '', width: 40, height: 40, class: 'avatar'
= image_tag action_log.account.avatar.url(:original), alt: '', size: 40, class: 'avatar'
.log-entry__content
.log-entry__title
= t "admin.action_logs.actions.#{action_log.action}_#{action_log.target_type.underscore}_html",

View File

@ -1,7 +1,7 @@
= link_to disputes_strike_path(appeal.strike), class: ['log-entry', appeal.approved? && 'log-entry--inactive'] do
.log-entry__header
.log-entry__avatar
= image_tag appeal.account.avatar.url(:original), alt: '', width: 40, height: 40, class: 'avatar'
= image_tag appeal.account.avatar.url(:original), alt: '', size: 40, class: 'avatar'
.log-entry__content
.log-entry__title
= strike_action_label(appeal)

View File

@ -7,7 +7,7 @@
%td
.name-tag
= image_tag invite.user.account.avatar.url(:original), alt: '', width: 16, height: 16, class: 'avatar'
= image_tag invite.user.account.avatar.url(:original), alt: '', size: 16, class: 'avatar'
%span.username= invite.user.account.username
- if invite.valid_for_use?

View File

@ -8,7 +8,7 @@
= image_tag account.header.url, alt: ''
.card__bar
.avatar
= image_tag account.avatar.url, alt: '', width: 48, height: 48, class: 'u-photo'
= image_tag account.avatar.url, alt: '', size: 48, class: 'u-photo'
.display-name
%bdi

View File

@ -8,7 +8,7 @@
%table.email-account-banner-icon-table{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
%tr
%td
%img{ src: full_asset_url(account.avatar.url), width: 80, height: 80, alt: '' }
%img{ src: full_asset_url(account.avatar.url), size: 80, alt: '' }
%table.email-w-full.email-account-body-table{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
%tr
%td.email-account-body-td

View File

@ -11,12 +11,12 @@
%tr
%td.email-checklist-icons-checkbox-td
- if defined?(checked) && checked
= image_tag frontend_asset_url('images/mailer-new/welcome/checkbox-on.png'), alt: '', width: 20, height: 20
= image_tag frontend_asset_url('images/mailer-new/welcome/checkbox-on.png'), alt: '', size: 20
- else
= image_tag frontend_asset_url('images/mailer-new/welcome/checkbox-off.png'), alt: '', width: 20, height: 20
= image_tag frontend_asset_url('images/mailer-new/welcome/checkbox-off.png'), alt: '', size: 20
%td.email-checklist-icons-step-td
- if defined?(key)
= image_tag frontend_asset_url("images/mailer-new/welcome-icons/#{key}_step-#{checked ? 'on' : 'off'}.png"), alt: '', width: 40, height: 40
= image_tag frontend_asset_url("images/mailer-new/welcome-icons/#{key}_step-#{checked ? 'on' : 'off'}.png"), alt: '', size: 40
%td.email-checklist-text-td
.email-desktop-flex
/[if mso]

View File

@ -7,7 +7,7 @@
%table.email-w-full{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
%tr
%td.email-mini-follow-img-td
= image_tag full_asset_url(follow.account.avatar.url), alt: '', width: 40, height: 40
= image_tag full_asset_url(follow.account.avatar.url), alt: '', size: 40
%td.email-mini-follow-text-td
%h3= follow.account.display_name.presence || follow.account.username
%p @#{follow.account.pretty_acct}

View File

@ -15,6 +15,6 @@
%td.email-mini-hashtag-img-td
- accounts.each do |account|
%span.email-mini-hashtag-img-span
= image_tag full_asset_url(account.avatar.url), alt: '', width: 16, height: 16
= image_tag full_asset_url(account.avatar.url), alt: '', size: 16
%td
%p= recent_tag_usage(hashtag)

View File

@ -6,7 +6,7 @@
%tr
- if image_url
%td.email-header-heading-img-td
= image_tag image_url, alt: '', width: 56, height: 56
= image_tag image_url, alt: '', size: 56
%td.email-header-heading-txt-td
%h1= title
- if subtitle

View File

@ -20,7 +20,7 @@
.detailed-status__meta
= link_to ActivityPub::TagManager.instance.url_for(status.account), class: 'name-tag', target: '_blank', rel: 'noopener noreferrer' do
= image_tag(status.account.avatar.url, width: 15, height: 15, alt: '', class: 'avatar')
= image_tag(status.account.avatar.url, size: 15, alt: '', class: 'avatar')
.username= status.account.acct
·
= link_to ActivityPub::TagManager.instance.url_for(status), class: 'detailed-status__datetime', target: stream_link_target, rel: 'noopener noreferrer' do

View File

@ -75,7 +75,7 @@
%td.email-footer-td
%p.email-footer-p
= link_to root_url, class: 'email-footer-logo-a' do
= image_tag frontend_asset_url('images/mailer-new/common/logo-footer.png'), alt: 'Mastodon', width: 44, height: 44
= image_tag frontend_asset_url('images/mailer-new/common/logo-footer.png'), alt: 'Mastodon', size: 44
%p.email-footer-p
= t 'about.hosted_on', domain: site_hostname
%p.email-footer-p

View File

@ -1,7 +1,7 @@
%table.email-w-full{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
%tr
%td.email-status-header-img
= image_tag full_asset_url(status.account.avatar.url), alt: '', width: 48, height: 48
= image_tag full_asset_url(status.account.avatar.url), alt: '', size: 48
%td.email-status-header-text
%h2.email-status-header-name
= display_name(status.account)

View File

@ -51,7 +51,7 @@
%strong.status-card__title= t('author_attribution.example_title')
.more-from-author
= logo_as_symbol(:icon)
= t('author_attribution.more_from_html', name: link_to(root_url, class: 'story__details__shared__author-link') { image_tag(@account.avatar.url, class: 'account__avatar', width: 16, height: 16, alt: '') + tag.bdi(display_name(@account)) })
= t('author_attribution.more_from_html', name: link_to(root_url, class: 'story__details__shared__author-link') { image_tag(@account.avatar.url, class: 'account__avatar', size: 16, alt: '') + tag.bdi(display_name(@account)) })
%h4= t('verification.here_is_how')