Migrate form_tag to form_with in admin and auth views (#30692)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
= form_tag preview_admin_report_actions_path(report), method: :post do
|
||||
= form_with url: preview_admin_report_actions_path(report) do |form|
|
||||
.report-actions
|
||||
.report-actions__item
|
||||
.report-actions__item__button
|
||||
@@ -8,26 +8,36 @@
|
||||
- if statuses.any? { |status| (status.with_media? || status.with_preview_card?) && !status.discarded? }
|
||||
.report-actions__item
|
||||
.report-actions__item__button
|
||||
= button_tag t('admin.reports.mark_as_sensitive'), name: :mark_as_sensitive, class: 'button'
|
||||
= form.button t('admin.reports.mark_as_sensitive'),
|
||||
name: :mark_as_sensitive,
|
||||
class: 'button'
|
||||
.report-actions__item__description
|
||||
= t('admin.reports.actions.mark_as_sensitive_description_html')
|
||||
.report-actions__item
|
||||
.report-actions__item__button
|
||||
= button_tag t('admin.reports.delete_and_resolve'), name: :delete, class: 'button button--destructive'
|
||||
= form.button t('admin.reports.delete_and_resolve'),
|
||||
name: :delete,
|
||||
class: 'button button--destructive'
|
||||
.report-actions__item__description
|
||||
= t('admin.reports.actions.delete_description_html')
|
||||
.report-actions__item
|
||||
.report-actions__item__button
|
||||
= button_tag t('admin.accounts.silence'), name: :silence, class: 'button button--destructive'
|
||||
= form.button t('admin.accounts.silence'),
|
||||
name: :silence,
|
||||
class: 'button button--destructive'
|
||||
.report-actions__item__description
|
||||
= t('admin.reports.actions.silence_description_html')
|
||||
.report-actions__item
|
||||
.report-actions__item__button
|
||||
= button_tag t('admin.accounts.suspend'), name: :suspend, class: 'button button--destructive'
|
||||
= form.button t('admin.accounts.suspend'),
|
||||
name: :suspend,
|
||||
class: 'button button--destructive'
|
||||
.report-actions__item__description
|
||||
= t('admin.reports.actions.suspend_description_html')
|
||||
.report-actions__item
|
||||
.report-actions__item__button
|
||||
= link_to t('admin.accounts.custom'), new_admin_account_action_path(report.target_account_id, report_id: report.id), class: 'button'
|
||||
= link_to t('admin.accounts.custom'),
|
||||
new_admin_account_action_path(report.target_account_id, report_id: report.id),
|
||||
class: 'button'
|
||||
.report-actions__item__description
|
||||
= t('admin.reports.actions.other_description_html')
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
- content_for :page_title do
|
||||
= t('admin.reports.confirm_action', acct: target_acct)
|
||||
|
||||
= form_tag admin_report_actions_path(@report), class: 'simple_form', method: :post do
|
||||
= hidden_field_tag :moderation_action, @moderation_action
|
||||
= form_with url: admin_report_actions_path(@report), class: :simple_form do |form|
|
||||
= form.hidden_field :moderation_action, value: @moderation_action
|
||||
|
||||
%p.hint= t("admin.reports.summary.action_preambles.#{@moderation_action}_html", acct: target_acct)
|
||||
%ul.hint
|
||||
@@ -30,7 +30,9 @@
|
||||
%p= t "user_mailer.warning.explanation.#{warning_action}", instance: Rails.configuration.x.local_domain
|
||||
|
||||
.fields-group
|
||||
= text_area_tag :text, nil, placeholder: t('admin.reports.summary.warning_placeholder')
|
||||
= form.text_area :text,
|
||||
value: nil,
|
||||
placeholder: t('admin.reports.summary.warning_placeholder')
|
||||
|
||||
- unless @report.other?
|
||||
%p
|
||||
@@ -75,4 +77,7 @@
|
||||
|
||||
.actions
|
||||
= link_to t('admin.reports.cancel'), admin_report_path(@report), class: 'button button-tertiary'
|
||||
= button_tag t('admin.reports.confirm'), name: :confirm, class: 'button', type: :submit
|
||||
= form.button t('admin.reports.confirm'),
|
||||
name: :confirm,
|
||||
class: 'button',
|
||||
type: :submit
|
||||
|
||||
@@ -14,14 +14,17 @@
|
||||
%li= filter_link_to t('admin.accounts.location.local'), target_origin: 'local'
|
||||
%li= filter_link_to t('admin.accounts.location.remote'), target_origin: 'remote'
|
||||
|
||||
= form_tag admin_reports_url, method: 'GET', class: 'simple_form' do
|
||||
= form_with url: admin_reports_url, method: :get, class: :simple_form do |form|
|
||||
.fields-group
|
||||
- ReportFilter::KEYS.each do |key|
|
||||
= hidden_field_tag key, params[key] if params[key].present?
|
||||
= form.hidden_field key, value: params[key] if params[key].present?
|
||||
|
||||
- %i(by_target_domain).each do |key|
|
||||
.input.string.optional
|
||||
= text_field_tag key, params[key], class: 'string optional', placeholder: I18n.t("admin.reports.#{key}")
|
||||
= form.text_field key,
|
||||
value: params[key],
|
||||
class: 'string optional',
|
||||
placeholder: I18n.t("admin.reports.#{key}")
|
||||
|
||||
.actions
|
||||
%button.button= t('admin.accounts.search')
|
||||
|
||||
Reference in New Issue
Block a user