Skip to content

Commit

Permalink
Merge commit '9a3d047f3e604e581e18346424569e28fc9c5b96' into glitch-s…
Browse files Browse the repository at this point in the history
…oc/merge-upstream
  • Loading branch information
ClearlyClaire committed Oct 25, 2023
2 parents 85d4846 + 9a3d047 commit 6262095
Show file tree
Hide file tree
Showing 41 changed files with 351 additions and 136 deletions.
54 changes: 2 additions & 52 deletions .haml-lint_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `haml-lint --auto-gen-config`
# on 2023-10-24 14:08:37 -0400 using Haml-Lint version 0.51.0.
# on 2023-10-25 08:29:48 -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
Expand All @@ -11,61 +11,11 @@ linters:
LineLength:
enabled: false

# Offense count: 22
UnnecessaryStringOutput:
exclude:
- 'app/views/accounts/show.html.haml'
- 'app/views/admin/custom_emojis/_custom_emoji.html.haml'
- 'app/views/admin/relays/_relay.html.haml'
- 'app/views/admin/rules/_rule.html.haml'
- 'app/views/admin/statuses/index.html.haml'
- 'app/views/auth/registrations/_session.html.haml'
- 'app/views/disputes/strikes/show.html.haml'
- 'app/views/notification_mailer/_status.html.haml'
- 'app/views/settings/two_factor_authentication_methods/index.html.haml'
- 'app/views/statuses/_detailed_status.html.haml'
- 'app/views/statuses/_poll.html.haml'
- 'app/views/statuses/_simple_status.html.haml'
- 'app/views/user_mailer/suspicious_sign_in.html.haml'
- 'app/views/user_mailer/webauthn_credential_added.html.haml'
- 'app/views/user_mailer/webauthn_credential_deleted.html.haml'
- 'app/views/user_mailer/welcome.html.haml'

# Offense count: 45
# Offense count: 10
RuboCop:
exclude:
- 'app/views/admin/accounts/_account.html.haml'
- 'app/views/admin/accounts/_buttons.html.haml'
- 'app/views/admin/accounts/_local_account.html.haml'
- 'app/views/admin/accounts/_remote_account.html.haml'
- 'app/views/admin/accounts/index.html.haml'
- 'app/views/admin/accounts/show.html.haml'
- 'app/views/admin/custom_emojis/index.html.haml'
- 'app/views/admin/dashboard/index.html.haml'
- 'app/views/admin/domain_blocks/confirm_suspension.html.haml'
- 'app/views/admin/follow_recommendations/show.html.haml'
- 'app/views/admin/invites/_invite.html.haml'
- 'app/views/admin/invites/index.html.haml'
- 'app/views/admin/ip_blocks/index.html.haml'
- 'app/views/admin/reports/_status.html.haml'
- 'app/views/admin/reports/show.html.haml'
- 'app/views/admin/roles/_form.html.haml'
- 'app/views/admin/software_updates/index.html.haml'
- 'app/views/admin/status_edits/_status_edit.html.haml'
- 'app/views/admin/statuses/index.html.haml'
- 'app/views/admin/tags/show.html.haml'
- 'app/views/admin/trends/tags/_tag.html.haml'
- 'app/views/auth/registrations/_session.html.haml'
- 'app/views/auth/registrations/new.html.haml'
- 'app/views/auth/sessions/two_factor.html.haml'
- 'app/views/auth/shared/_progress.html.haml'
- 'app/views/disputes/strikes/_card.html.haml'
- 'app/views/filters/statuses/index.html.haml'
- 'app/views/invites/_invite.html.haml'
- 'app/views/layouts/application.html.haml'
- 'app/views/layouts/error.html.haml'
- 'app/views/statuses/_detailed_status.html.haml'
- 'app/views/statuses/_og_image.html.haml'
- 'app/views/statuses/_simple_status.html.haml'
- 'app/views/statuses_cleanup/show.html.haml'
- 'app/views/user_mailer/warning.html.haml'
3 changes: 2 additions & 1 deletion app/javascript/mastodon/features/blocks/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { connect } from 'react-redux';

import { ReactComponent as BlockIcon } from '@material-symbols/svg-600/outlined/block-fill.svg';
import { debounce } from 'lodash';

import { fetchBlocks, expandBlocks } from '../../actions/blocks';
Expand Down Expand Up @@ -59,7 +60,7 @@ class Blocks extends ImmutablePureComponent {
const emptyMessage = <FormattedMessage id='empty_column.blocks' defaultMessage="You haven't blocked any users yet." />;

return (
<Column bindToDocument={!multiColumn} icon='ban' heading={intl.formatMessage(messages.heading)}>
<Column bindToDocument={!multiColumn} icon='ban' iconComponent={BlockIcon} heading={intl.formatMessage(messages.heading)}>
<ColumnBackButtonSlim />
<ScrollableList
scrollKey='blocks'
Expand Down
3 changes: 2 additions & 1 deletion app/javascript/mastodon/features/domain_blocks/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { connect } from 'react-redux';

import { ReactComponent as BlockIcon } from '@material-symbols/svg-600/outlined/block-fill.svg';
import { debounce } from 'lodash';

import { fetchDomainBlocks, expandDomainBlocks } from '../../actions/domain_blocks';
Expand Down Expand Up @@ -60,7 +61,7 @@ class Blocks extends ImmutablePureComponent {
const emptyMessage = <FormattedMessage id='empty_column.domain_blocks' defaultMessage='There are no blocked domains yet.' />;

return (
<Column bindToDocument={!multiColumn} icon='ban' heading={intl.formatMessage(messages.heading)}>
<Column bindToDocument={!multiColumn} icon='ban' iconComponent={BlockIcon} heading={intl.formatMessage(messages.heading)}>
<ColumnBackButtonSlim />

<ScrollableList
Expand Down
2 changes: 1 addition & 1 deletion app/lib/attachment_batch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def remove_files
end
when :fog
logger.debug { "Deleting #{attachment.path(style)}" }
attachment.directory.files.new(key: attachment.path(style)).destroy
attachment.send(:directory).files.new(key: attachment.path(style)).destroy
when :azure
logger.debug { "Deleting #{attachment.path(style)}" }
attachment.destroy
Expand Down
5 changes: 5 additions & 0 deletions app/views/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
inherit_from: ../../.rubocop.yml

# Disable for the `Rubocop` lints in haml-lint
Style/IfUnlessModifier:
Enabled: false
2 changes: 1 addition & 1 deletion app/views/accounts/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- content_for :page_title do
= "#{display_name(@account)} (#{acct(@account)})"
#{display_name(@account)} (#{acct(@account)})

- content_for :header_tags do
- if @account.user_prefers_noindex?
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/accounts/_account.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
\-
%br/
%samp.ellipsized-ip= relevant_account_ip(account, params[:ip])
- if !account.suspended? && account.user_pending? && account.user&.invite_request&.text&.present?
- if !account.suspended? && account.user_pending? && account.user&.invite_request&.text.present?
.batch-table__row__content__quote
%p= account.user&.invite_request&.text
2 changes: 1 addition & 1 deletion app/views/admin/accounts/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

%hr.spacer/

- if @account.user&.invite_request&.text&.present?
- if @account.user&.invite_request&.text.present?
.speech-bubble
.speech-bubble__bubble
= @account.user&.invite_request&.text
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/custom_emojis/_custom_emoji.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
= custom_emoji_tag(custom_emoji)

.batch-table__row__content__text
%samp= ":#{custom_emoji.shortcode}:"
%samp :#{custom_emoji.shortcode}:

- if custom_emoji.local?
%span.information-badge= custom_emoji.category&.name || t('admin.custom_emojis.uncategorized')
Expand Down
1 change: 0 additions & 1 deletion app/views/admin/domain_blocks/confirm_suspension.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
= t('.title', domain: Addressable::IDNA.to_unicode(@domain_block.domain))

= simple_form_for @domain_block, url: admin_domain_blocks_path, method: :post do |f|

%p.hint= t('.preamble_html', domain: Addressable::IDNA.to_unicode(@domain_block.domain))
%ul.hint
%li= t('.stop_communication')
Expand Down
6 changes: 3 additions & 3 deletions app/views/admin/relays/_relay.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
- if relay.accepted?
%span.positive-hint
= fa_icon('check')
= ' '
&nbsp;
= t 'admin.relays.enabled'
- elsif relay.pending?
= fa_icon('hourglass')
= ' '
&nbsp;
= t 'admin.relays.pending'
- else
%span.negative-hint
= fa_icon('times')
= ' '
&nbsp;
= t 'admin.relays.disabled'
%td
- if relay.accepted?
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/rules/_rule.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.announcements-list__item
= link_to edit_admin_rule_path(rule), class: 'announcements-list__item__title' do
= "#{rule_counter + 1}."
#{rule_counter + 1}.
= truncate(rule.text)

.announcements-list__item__action-bar
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/software_updates/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
%td= update.version
%td= t("admin.software_updates.types.#{update.type}")
- if update.urgent?
%td.critical= t("admin.software_updates.critical_update")
%td.critical= t('admin.software_updates.critical_update')
- else
%td
%td= table_link_to 'link', t('admin.software_updates.release_notes'), update.release_notes
2 changes: 1 addition & 1 deletion app/views/admin/statuses/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- content_for :page_title do
= t('admin.statuses.title')
\-
= "@#{@account.pretty_acct}"
@#{@account.pretty_acct}

.filters
.filter-subset
Expand Down
1 change: 0 additions & 1 deletion app/views/admin/tags/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
%span= t('admin.trends.tags.not_trendable')
= fa_icon 'lock fw'


= link_to admin_tag_path(@tag.id), class: ['dashboard__quick-access', @tag.listable? ? 'positive' : 'negative'] do
- if @tag.listable?
%span= t('admin.trends.tags.listable')
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/trends/tags/_tag.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

%br/

= link_to tag_path(tag), target: '_blank' do
= link_to tag_path(tag), target: '_blank', rel: 'noopener noreferrer' do
= t('admin.trends.tags.used_by_over_week', count: tag.history.reduce(0) { |sum, day| sum + day.accounts })

- if tag.trendable? && (rank = Trends.tags.rank(tag.id))
Expand Down
2 changes: 1 addition & 1 deletion app/views/auth/registrations/_session.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%td
%span{ title: session.user_agent }<
= fa_icon "#{session_device_icon(session)} fw", 'aria-label': session_device_icon(session)
= ' '
&nbsp;
= 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
Expand Down
1 change: 0 additions & 1 deletion app/views/auth/registrations/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
= f.simple_fields_for :invite_request, resource.invite_request || resource.build_invite_request do |invite_request_fields|
= invite_request_fields.input :text, as: :text, wrapper: :with_block_label, required: Setting.require_invite_text, label: false, hint: false


= hidden_field_tag :accept, params[:accept]
= f.input :invite_code, as: :hidden

Expand Down
4 changes: 2 additions & 2 deletions app/views/disputes/strikes/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
%p.hint
%span.positive-hint
= fa_icon 'check'
= ' '
&nbsp;
= t 'disputes.strikes.appeal_approved'
- elsif @appeal.persisted? && @appeal.rejected?
%p.hint
%span.negative-hint
= fa_icon 'times'
= ' '
&nbsp;
= t 'disputes.strikes.appeal_rejected'

.report-header
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/error.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!!!
%html{ lang: I18n.locale }
%head
%meta{ content: 'text/html; charset=UTF-8', 'http-equiv' => 'Content-Type' }/
%meta{ 'content' => 'text/html; charset=UTF-8', 'http-equiv' => 'Content-Type' }/
%meta{ charset: 'utf-8' }/
%title= safe_join([yield(:page_title), Setting.default_settings['site_title']], ' - ')
%meta{ content: 'width=device-width,initial-scale=1', name: 'viewport' }/
Expand Down
2 changes: 1 addition & 1 deletion app/views/notification_mailer/_status.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
= image_tag full_asset_url(status.account.avatar.url), alt: ''
%td{ align: 'left' }
%bdi= display_name(status.account)
= "@#{status.account.pretty_acct}"
@#{status.account.pretty_acct}

- if status.spoiler_text?
.auto-dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%p.hint
%span.positive-hint
= fa_icon 'check'
= ' '
&nbsp;
= t 'two_factor_authentication.enabled'

.table-wrapper
Expand Down
6 changes: 3 additions & 3 deletions app/views/statuses/_detailed_status.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@
- else
= fa_icon('reply-all')
%span.detailed-status__reblogs>= friendly_number_to_human status.replies_count
= ' '
&nbsp;
·
- if status.public_visibility? || status.unlisted_visibility?
%span.detailed-status__link
= fa_icon('retweet')
%span.detailed-status__reblogs>= friendly_number_to_human status.reblogs_count
= ' '
&nbsp;
·
%span.detailed-status__link
= fa_icon('star')
%span.detailed-status__favorites>= friendly_number_to_human status.favourites_count
= ' '
&nbsp;

- if user_signed_in?
·
Expand Down
2 changes: 1 addition & 1 deletion app/views/statuses/_poll.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- percent = total_votes_count.positive? ? 100 * option.votes_count / total_votes_count : 0
%label.poll__option><
%span.poll__number><
= "#{percent.round}%"
#{percent.round}%
%span.poll__option__text
= prerender_custom_emojis(h(option.title), status.emojis)
- if own_votes.include?(index)
Expand Down
2 changes: 1 addition & 1 deletion app/views/statuses/_simple_status.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
%span.display-name
%bdi
%strong.display-name__html.p-name.emojify= display_name(status.account, custom_emojify: true, autoplay: prefers_autoplay?)
= ' '
&nbsp;
%span.display-name__account
= acct(status.account)
= fa_icon('lock') if status.account.locked?
Expand Down
1 change: 0 additions & 1 deletion app/views/statuses_cleanup/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
= button_tag t('generic.save_changes'), class: 'button', form: 'edit_policy'

= simple_form_for @policy, url: statuses_cleanup_path, method: :put, html: { id: 'edit_policy' } do |f|

.fields-row
.fields-row__column.fields-row__column-6.fields-group
= f.input :enabled, as: :boolean, wrapper: :with_label, label: t('statuses_cleanup.enabled'), hint: t('statuses_cleanup.enabled_hint')
Expand Down
4 changes: 2 additions & 2 deletions app/views/user_mailer/suspicious_sign_in.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
%tr
%td.column-cell.text-center
%p
%strong= "#{t('sessions.ip')}:"
%strong #{t('sessions.ip')}:
= @remote_ip
%br/
%strong= "#{t('sessions.browser')}:"
%strong #{t('sessions.browser')}:
%span{ title: @user_agent }= t 'sessions.description', browser: t("sessions.browsers.#{@detection.id}", default: @detection.id.to_s), platform: t("sessions.platforms.#{@detection.platform.id}", default: @detection.platform.id.to_s)
%br/
= l(@timestamp.in_time_zone(@resource.time_zone.presence), format: :with_time_zone)
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_mailer/webauthn_credential_added.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
= image_tag full_pack_url('media/images/mailer/icon_lock_open.png'), alt: ''

%h1= t 'devise.mailer.webauthn_credential.added.title'
%p.lead= "#{t('devise.mailer.webauthn_credential.added.explanation')}:"
%p.lead #{t('devise.mailer.webauthn_credential.added.explanation')}:
%p.lead= @webauthn_credential.nickname

%table.email-table{ cellspacing: 0, cellpadding: 0 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
= image_tag full_pack_url('media/images/mailer/icon_lock_open.png'), alt: ''

%h1= t 'devise.mailer.webauthn_credential.deleted.title'
%p.lead= "#{t('devise.mailer.webauthn_credential.deleted.explanation')}:"
%p.lead #{t('devise.mailer.webauthn_credential.deleted.explanation')}:
%p.lead= @webauthn_credential.nickname

%table.email-table{ cellspacing: 0, cellpadding: 0 }
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_mailer/welcome.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
%table.input{ align: 'center', cellspacing: 0, cellpadding: 0 }
%tbody
%tr
%td= "@#{@resource.account.username}@#{@instance}"
%td @#{@resource.account.username}@#{@instance}
.col-3
%table.column{ cellspacing: 0, cellpadding: 0 }
%tbody
Expand Down
Loading

0 comments on commit 6262095

Please sign in to comment.