summaryrefslogtreecommitdiffstats
path: root/app/views/admin
diff options
context:
space:
mode:
authorMatt Jankowski <matt@jankowski.online>2024-03-15 07:19:00 -0400
committerGitHub <noreply@github.com>2024-03-15 11:19:00 +0000
commitf445d33fd6aa492df319f4cc4efbd255d7a84f0e (patch)
tree8431fba178f4fa268ed86bf4f9b26755aa0c3793 /app/views/admin
parent7720c684c5bf54e73e8815defe15473777d1c201 (diff)
Fix haml-lint `LineLength` cops in app/views/admin (#28680)
Diffstat (limited to 'app/views/admin')
-rw-r--r--app/views/admin/account_actions/new.html.haml33
-rw-r--r--app/views/admin/accounts/index.html.haml33
-rw-r--r--app/views/admin/announcements/edit.html.haml25
-rw-r--r--app/views/admin/announcements/new.html.haml29
-rw-r--r--app/views/admin/custom_emojis/index.html.haml11
-rw-r--r--app/views/admin/custom_emojis/new.html.haml14
-rw-r--r--app/views/admin/domain_blocks/edit.html.haml49
-rw-r--r--app/views/admin/domain_blocks/new.html.haml47
-rw-r--r--app/views/admin/email_domain_blocks/index.html.haml6
-rw-r--r--app/views/admin/email_domain_blocks/new.html.haml16
-rw-r--r--app/views/admin/export_domain_allows/new.html.haml5
-rw-r--r--app/views/admin/export_domain_blocks/import.html.haml6
-rw-r--r--app/views/admin/export_domain_blocks/new.html.haml5
-rw-r--r--app/views/admin/follow_recommendations/show.html.haml14
-rw-r--r--app/views/admin/ip_blocks/index.html.haml6
-rw-r--r--app/views/admin/ip_blocks/new.html.haml22
-rw-r--r--app/views/admin/relationships/index.html.haml6
-rw-r--r--app/views/admin/reports/_status.html.haml4
-rw-r--r--app/views/admin/reports/show.html.haml4
-rw-r--r--app/views/admin/roles/_form.html.haml27
-rw-r--r--app/views/admin/settings/about/show.html.haml30
-rw-r--r--app/views/admin/settings/appearance/show.html.haml15
-rw-r--r--app/views/admin/settings/branding/show.html.haml18
-rw-r--r--app/views/admin/settings/content_retention/show.html.haml14
-rw-r--r--app/views/admin/settings/discovery/show.html.haml49
-rw-r--r--app/views/admin/settings/registrations/show.html.haml23
-rw-r--r--app/views/admin/statuses/index.html.haml6
-rw-r--r--app/views/admin/trends/links/index.html.haml28
-rw-r--r--app/views/admin/trends/links/preview_card_providers/index.html.haml12
-rw-r--r--app/views/admin/trends/statuses/_status.html.haml4
-rw-r--r--app/views/admin/trends/statuses/index.html.haml24
-rw-r--r--app/views/admin/trends/tags/index.html.haml12
-rw-r--r--app/views/admin/users/roles/show.html.haml10
-rw-r--r--app/views/admin/webhooks/_form.html.haml17
34 files changed, 505 insertions, 119 deletions
diff --git a/app/views/admin/account_actions/new.html.haml b/app/views/admin/account_actions/new.html.haml
index 4cb4401c705..bce1c31760d 100644
--- a/app/views/admin/account_actions/new.html.haml
+++ b/app/views/admin/account_actions/new.html.haml
@@ -2,29 +2,48 @@
= t('admin.account_actions.title', acct: @account.pretty_acct)
= simple_form_for @account_action, url: admin_account_action_path(@account.id) do |f|
- = f.input :report_id, as: :hidden
+ = f.input :report_id,
+ as: :hidden
.fields-group
- = f.input :type, as: :radio_buttons, collection: Admin::AccountAction.types_for_account(@account), include_blank: false, wrapper: :with_block_label, label_method: ->(type) { account_action_type_label(type) }, hint: t('simple_form.hints.admin_account_action.type_html', acct: @account.pretty_acct)
+ = f.input :type,
+ as: :radio_buttons,
+ collection: Admin::AccountAction.types_for_account(@account),
+ hint: t('simple_form.hints.admin_account_action.type_html', acct: @account.pretty_acct),
+ include_blank: false,
+ label_method: ->(type) { account_action_type_label(type) },
+ wrapper: :with_block_label
- if @account.local?
%hr.spacer/
.fields-group
- = f.input :send_email_notification, as: :boolean, wrapper: :with_label
+ = f.input :send_email_notification,
+ as: :boolean,
+ wrapper: :with_label
- if params[:report_id].present?
.fields-group
- = f.input :include_statuses, as: :boolean, wrapper: :with_label
+ = f.input :include_statuses,
+ as: :boolean,
+ wrapper: :with_label
%hr.spacer/
- unless @warning_presets.empty?
.fields-group
- = f.input :warning_preset_id, collection: @warning_presets, label_method: ->(warning_preset) { [warning_preset.title.presence, truncate(warning_preset.text)].compact.join(' - ') }, wrapper: :with_block_label
+ = f.input :warning_preset_id,
+ collection: @warning_presets,
+ label_method: ->(warning_preset) { [warning_preset.title.presence, truncate(warning_preset.text)].compact.join(' - ') },
+ wrapper: :with_block_label
.fields-group
- = f.input :text, as: :text, wrapper: :with_block_label, hint: t('simple_form.hints.admin_account_action.text_html', path: admin_warning_presets_path)
+ = f.input :text,
+ as: :text,
+ hint: t('simple_form.hints.admin_account_action.text_html', path: admin_warning_presets_path),
+ wrapper: :with_block_label
.actions
- = f.button :button, t('admin.account_actions.action'), type: :submit
+ = f.button :button,
+ t('admin.account_actions.action'),
+ type: :submit
diff --git a/app/views/admin/accounts/index.html.haml b/app/views/admin/accounts/index.html.haml
index 8354441895d..0ca457f39ee 100644
--- a/app/views/admin/accounts/index.html.haml
+++ b/app/views/admin/accounts/index.html.haml
@@ -6,19 +6,26 @@
.filter-subset.filter-subset--with-select
%strong= t('admin.accounts.location.title')
.input.select.optional
- = select_tag :origin, options_for_select([[t('admin.accounts.location.local'), 'local'], [t('admin.accounts.location.remote'), 'remote']], params[:origin]), prompt: I18n.t('generic.all')
+ = select_tag :origin,
+ options_for_select([[t('admin.accounts.location.local'), 'local'], [t('admin.accounts.location.remote'), 'remote']], params[:origin]),
+ prompt: I18n.t('generic.all')
.filter-subset.filter-subset--with-select
%strong= t('admin.accounts.moderation.title')
.input.select.optional
- = select_tag :status, options_for_select(admin_accounts_moderation_options, params[:status]), prompt: I18n.t('generic.all')
+ = select_tag :status,
+ options_for_select(admin_accounts_moderation_options, params[:status]),
+ prompt: I18n.t('generic.all')
.filter-subset.filter-subset--with-select
%strong= t('admin.accounts.role')
.input.select.optional
- = select_tag :role_ids, options_from_collection_for_select(UserRole.assignable, :id, :name, params[:role_ids]), prompt: I18n.t('admin.accounts.moderation.all')
+ = select_tag :role_ids,
+ options_from_collection_for_select(UserRole.assignable, :id, :name, params[:role_ids]),
+ prompt: I18n.t('admin.accounts.moderation.all')
.filter-subset.filter-subset--with-select
%strong= t 'generic.order_by'
.input.select
- = select_tag :order, options_for_select([[t('relationships.most_recent'), 'recent'], [t('relationships.last_active'), 'active']], params[:order])
+ = select_tag :order,
+ options_for_select([[t('relationships.most_recent'), 'recent'], [t('relationships.last_active'), 'active']], params[:order])
.fields-group
- %i(username by_domain display_name email ip).each do |key|
@@ -46,11 +53,23 @@
= check_box_tag :batch_checkbox_all, nil, false
.batch-table__toolbar__actions
- if @accounts.any?(&:user_pending?)
- = f.button safe_join([fa_icon('check'), t('admin.accounts.approve')]), name: :approve, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
+ = f.button safe_join([fa_icon('check'), t('admin.accounts.approve')]),
+ class: 'table-action-link',
+ data: { confirm: t('admin.reports.are_you_sure') },
+ name: :approve,
+ type: :submit
- = f.button safe_join([fa_icon('times'), t('admin.accounts.reject')]), name: :reject, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
+ = f.button safe_join([fa_icon('times'), t('admin.accounts.reject')]),
+ class: 'table-action-link',
+ data: { confirm: t('admin.reports.are_you_sure') },
+ name: :reject,
+ type: :submit
- = f.button safe_join([fa_icon('lock'), t('admin.accounts.perform_full_suspension')]), name: :suspend, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
+ = f.button safe_join([fa_icon('lock'), t('admin.accounts.perform_full_suspension')]),
+ class: 'table-action-link',
+ data: { confirm: t('admin.reports.are_you_sure') },
+ name: :suspend,
+ type: :submit
- if @accounts.total_count > @accounts.size
.batch-table__select-all
.not-selected.active
diff --git a/app/views/admin/announcements/edit.html.haml b/app/views/admin/announcements/edit.html.haml
index 150d98272fc..23c568a885d 100644
--- a/app/views/admin/announcements/edit.html.haml
+++ b/app/views/admin/announcements/edit.html.haml
@@ -5,18 +5,33 @@
= render 'shared/error_messages', object: @announcement
.fields-group
- = f.input :starts_at, include_blank: true, wrapper: :with_block_label, html5: true, input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder }
- = f.input :ends_at, include_blank: true, wrapper: :with_block_label, html5: true, input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder }
+ = f.input :starts_at,
+ html5: true,
+ include_blank: true,
+ input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
+ wrapper: :with_block_label
+ = f.input :ends_at,
+ html5: true,
+ include_blank: true,
+ input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
+ wrapper: :with_block_label
.fields-group
- = f.input :all_day, as: :boolean, wrapper: :with_label
+ = f.input :all_day,
+ as: :boolean,
+ wrapper: :with_label
.fields-group
- = f.input :text, wrapper: :with_block_label
+ = f.input :text,
+ wrapper: :with_block_label
- unless @announcement.published?
.fields-group
- = f.input :scheduled_at, include_blank: true, wrapper: :with_block_label, html5: true, input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder }
+ = f.input :scheduled_at,
+ html5: true,
+ include_blank: true,
+ input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
+ wrapper: :with_block_label
.actions
= f.button :button, t('generic.save_changes'), type: :submit
diff --git a/app/views/admin/announcements/new.html.haml b/app/views/admin/announcements/new.html.haml
index 0123632ff47..a681ed789ec 100644
--- a/app/views/admin/announcements/new.html.haml
+++ b/app/views/admin/announcements/new.html.haml
@@ -5,17 +5,34 @@
= render 'shared/error_messages', object: @announcement
.fields-group
- = f.input :starts_at, include_blank: true, wrapper: :with_block_label, html5: true, input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder }
- = f.input :ends_at, include_blank: true, wrapper: :with_block_label, html5: true, input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder }
+ = f.input :starts_at,
+ html5: true,
+ include_blank: true,
+ input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
+ wrapper: :with_block_label
+ = f.input :ends_at,
+ html5: true,
+ include_blank: true,
+ input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
+ wrapper: :with_block_label
.fields-group
- = f.input :all_day, as: :boolean, wrapper: :with_label
+ = f.input :all_day,
+ as: :boolean,
+ wrapper: :with_label
.fields-group
- = f.input :text, wrapper: :with_block_label
+ = f.input :text,
+ wrapper: :with_block_label
.fields-group
- = f.input :scheduled_at, include_blank: true, wrapper: :with_block_label, html5: true, input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder }
+ = f.input :scheduled_at,
+ html5: true,
+ include_blank: true,
+ input_html: { pattern: datetime_pattern, placeholder: datetime_placeholder },
+ wrapper: :with_block_label
.actions
- = f.button :button, t('.create'), type: :submit
+ = f.button :button,
+ t('.create'),
+ type: :submit
diff --git a/app/views/admin/custom_emojis/index.html.haml b/app/views/admin/custom_emojis/index.html.haml
index 8b4e93ac359..bea6a7cd21e 100644
--- a/app/views/admin/custom_emojis/index.html.haml
+++ b/app/views/admin/custom_emojis/index.html.haml
@@ -68,12 +68,19 @@
.fields-group.fields-row__column.fields-row__column-6
.input.select.optional
.label_input
- = f.select :category_id, options_from_collection_for_select(CustomEmojiCategory.all, 'id', 'name'), prompt: t('admin.custom_emojis.assign_category'), class: 'select optional', 'aria-label': t('admin.custom_emojis.assign_category')
+ = f.select :category_id,
+ options_from_collection_for_select(CustomEmojiCategory.all, 'id', 'name'),
+ 'aria-label': t('admin.custom_emojis.assign_category'),
+ class: 'select optional',
+ prompt: t('admin.custom_emojis.assign_category')
.fields-group.fields-row__column.fields-row__column-6
.input.string.optional
.label_input
- = f.text_field :category_name, class: 'string optional', placeholder: t('admin.custom_emojis.create_new_category'), 'aria-label': t('admin.custom_emojis.create_new_category')
+ = f.text_field :category_name,
+ 'aria-label': t('admin.custom_emojis.create_new_category'),
+ class: 'string optional',
+ placeholder: t('admin.custom_emojis.create_new_category')
.batch-table__body
- if @custom_emojis.empty?
diff --git a/app/views/admin/custom_emojis/new.html.haml b/app/views/admin/custom_emojis/new.html.haml
index a03676b001c..e59ae02b3bc 100644
--- a/app/views/admin/custom_emojis/new.html.haml
+++ b/app/views/admin/custom_emojis/new.html.haml
@@ -5,9 +5,17 @@
= render 'shared/error_messages', object: @custom_emoji
.fields-group
- = f.input :shortcode, wrapper: :with_label, label: t('admin.custom_emojis.shortcode'), hint: t('admin.custom_emojis.shortcode_hint')
+ = f.input :shortcode,
+ wrapper: :with_label,
+ label: t('admin.custom_emojis.shortcode'),
+ hint: t('admin.custom_emojis.shortcode_hint')
.fields-group
- = f.input :image, wrapper: :with_label, input_html: { accept: CustomEmoji::IMAGE_MIME_TYPES.join(',') }, hint: t('admin.custom_emojis.image_hint', size: number_to_human_size(CustomEmoji::LIMIT))
+ = f.input :image,
+ wrapper: :with_label,
+ input_html: { accept: CustomEmoji::IMAGE_MIME_TYPES.join(',') },
+ hint: t('admin.custom_emojis.image_hint', size: number_to_human_size(CustomEmoji::LIMIT))
.actions
- = f.button :button, t('admin.custom_emojis.upload'), type: :submit
+ = f.button :button,
+ t('admin.custom_emojis.upload'),
+ type: :submit
diff --git a/app/views/admin/domain_blocks/edit.html.haml b/app/views/admin/domain_blocks/edit.html.haml
index ae76b6777a2..7c0a9823a0e 100644
--- a/app/views/admin/domain_blocks/edit.html.haml
+++ b/app/views/admin/domain_blocks/edit.html.haml
@@ -6,25 +6,58 @@
.fields-row
.fields-row__column.fields-row__column-6.fields-group
- = f.input :domain, wrapper: :with_label, label: t('admin.domain_blocks.domain'), hint: t('admin.domain_blocks.new.hint'), required: true, readonly: true, disabled: true
+ = f.input :domain,
+ disabled: true,
+ hint: t('admin.domain_blocks.new.hint'),
+ label: t('admin.domain_blocks.domain'),
+ readonly: true,
+ required: true,
+ wrapper: :with_label
.fields-row__column.fields-row__column-6.fields-group
- = f.input :severity, collection: DomainBlock.severities.keys, wrapper: :with_label, include_blank: false, label_method: ->(type) { t("admin.domain_blocks.new.severity.#{type}") }, hint: t('admin.domain_blocks.new.severity.desc_html')
+ = f.input :severity,
+ collection: DomainBlock.severities.keys,
+ hint: t('admin.domain_blocks.new.severity.desc_html'),
+ include_blank: false,
+ label_method: ->(type) { t("admin.domain_blocks.new.severity.#{type}") },
+ wrapper: :with_label
.fields-group
- = f.input :reject_media, as: :boolean, wrapper: :with_label, label: I18n.t('admin.domain_blocks.reject_media'), hint: I18n.t('admin.domain_blocks.reject_media_hint')
+ = f.input :reject_media,
+ as: :boolean,
+ hint: I18n.t('admin.domain_blocks.reject_media_hint'),
+ label: I18n.t('admin.domain_blocks.reject_media'),
+ wrapper: :with_label
.fields-group
- = f.input :reject_reports, as: :boolean, wrapper: :with_label, label: I18n.t('admin.domain_blocks.reject_reports'), hint: I18n.t('admin.domain_blocks.reject_reports_hint')
+ = f.input :reject_reports,
+ as: :boolean,
+ hint: I18n.t('admin.domain_blocks.reject_reports_hint'),
+ label: I18n.t('admin.domain_blocks.reject_reports'),
+ wrapper: :with_label
.fields-group
- = f.input :obfuscate, as: :boolean, wrapper: :with_label, label: I18n.t('admin.domain_blocks.obfuscate'), hint: I18n.t('admin.domain_blocks.obfuscate_hint')
+ = f.input :obfuscate,
+ as: :boolean,
+ hint: I18n.t('admin.domain_blocks.obfuscate_hint'),
+ label: I18n.t('admin.domain_blocks.obfuscate'),
+ wrapper: :with_label
.field-group
- = f.input :private_comment, wrapper: :with_label, label: I18n.t('admin.domain_blocks.private_comment'), hint: t('admin.domain_blocks.private_comment_hint'), as: :string
+ = f.input :private_comment,
+ as: :string,
+ hint: t('admin.domain_blocks.private_comment_hint'),
+ label: I18n.t('admin.domain_blocks.private_comment'),
+ wrapper: :with_label
.field-group
- = f.input :public_comment, wrapper: :with_label, label: I18n.t('admin.domain_blocks.public_comment'), hint: t('admin.domain_blocks.public_comment_hint'), as: :string
+ = f.input :public_comment,
+ as: :string,
+