From b5d1d4826656db3103711a200a04cb1f2fa7da83 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 14 Jun 2024 05:54:22 -0400 Subject: [PATCH] Convert `form_for` -> `form_with` in views (#30700) --- app/views/admin/accounts/index.html.haml | 2 +- app/views/admin/custom_emojis/index.html.haml | 2 +- app/views/admin/email_domain_blocks/index.html.haml | 2 +- app/views/admin/export_domain_blocks/import.html.haml | 2 +- app/views/admin/follow_recommendations/show.html.haml | 2 +- app/views/admin/ip_blocks/index.html.haml | 2 +- app/views/admin/relationships/index.html.haml | 2 +- app/views/admin/reports/show.html.haml | 2 +- app/views/admin/statuses/index.html.haml | 2 +- app/views/admin/trends/links/index.html.haml | 2 +- .../admin/trends/links/preview_card_providers/index.html.haml | 2 +- app/views/admin/trends/statuses/index.html.haml | 2 +- app/views/admin/trends/tags/index.html.haml | 2 +- app/views/filters/statuses/index.html.haml | 2 +- app/views/relationships/show.html.haml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/views/admin/accounts/index.html.haml b/app/views/admin/accounts/index.html.haml index f32a4ac813..9dd4f0e4e4 100644 --- a/app/views/admin/accounts/index.html.haml +++ b/app/views/admin/accounts/index.html.haml @@ -43,7 +43,7 @@ %hr.spacer/ -= form_for(@form, url: batch_admin_accounts_path) do |f| += form_with model: @form, url: batch_admin_accounts_path do |f| = hidden_field_tag :page, params[:page] || 1 = hidden_field_tag :select_all_matching, '0' diff --git a/app/views/admin/custom_emojis/index.html.haml b/app/views/admin/custom_emojis/index.html.haml index d76726a735..82fec554b0 100644 --- a/app/views/admin/custom_emojis/index.html.haml +++ b/app/views/admin/custom_emojis/index.html.haml @@ -37,7 +37,7 @@ %button.button= t('admin.accounts.search') = link_to t('admin.accounts.reset'), admin_custom_emojis_path, class: 'button negative' -= form_for(@form, url: batch_admin_custom_emojis_path) do |f| += form_with model: @form, url: batch_admin_custom_emojis_path do |f| = hidden_field_tag :page, params[:page] || 1 - CustomEmojiFilter::KEYS.each do |key| diff --git a/app/views/admin/email_domain_blocks/index.html.haml b/app/views/admin/email_domain_blocks/index.html.haml index 684735c207..4fae6557a5 100644 --- a/app/views/admin/email_domain_blocks/index.html.haml +++ b/app/views/admin/email_domain_blocks/index.html.haml @@ -4,7 +4,7 @@ - content_for :heading_actions do = link_to t('admin.email_domain_blocks.add_new'), new_admin_email_domain_block_path, class: 'button' -= form_for(@form, url: batch_admin_email_domain_blocks_path) do |f| += form_with model: @form, url: batch_admin_email_domain_blocks_path do |f| = hidden_field_tag :page, params[:page] || 1 .batch-table diff --git a/app/views/admin/export_domain_blocks/import.html.haml b/app/views/admin/export_domain_blocks/import.html.haml index 52ffc3d465..2b0d2c5eb3 100644 --- a/app/views/admin/export_domain_blocks/import.html.haml +++ b/app/views/admin/export_domain_blocks/import.html.haml @@ -6,7 +6,7 @@ - if defined?(@global_private_comment) && @global_private_comment.present? %p= t('admin.export_domain_blocks.import.private_comment_description_html', comment: @global_private_comment) -= form_for(@form, url: batch_admin_domain_blocks_path) do |f| += form_with model: @form, url: batch_admin_domain_blocks_path do |f| .batch-table .batch-table__toolbar %label.batch-table__toolbar__select.batch-checkbox-all diff --git a/app/views/admin/follow_recommendations/show.html.haml b/app/views/admin/follow_recommendations/show.html.haml index 7d787152b3..62cd315725 100644 --- a/app/views/admin/follow_recommendations/show.html.haml +++ b/app/views/admin/follow_recommendations/show.html.haml @@ -21,7 +21,7 @@ %li= filter_link_to t('admin.accounts.moderation.active'), status: nil %li= filter_link_to t('admin.follow_recommendations.suppressed'), status: 'suppressed' -= form_for(@form, url: admin_follow_recommendations_path, method: :patch) do |f| += form_with model: @form, url: admin_follow_recommendations_path, method: :patch do |f| - RelationshipFilter::KEYS.each do |key| = hidden_field_tag key, params[key] if params[key].present? diff --git a/app/views/admin/ip_blocks/index.html.haml b/app/views/admin/ip_blocks/index.html.haml index 9eba6c68ff..207d23aeeb 100644 --- a/app/views/admin/ip_blocks/index.html.haml +++ b/app/views/admin/ip_blocks/index.html.haml @@ -5,7 +5,7 @@ - content_for :heading_actions do = link_to t('admin.ip_blocks.add_new'), new_admin_ip_block_path, class: 'button' -= form_for(@form, url: batch_admin_ip_blocks_path) do |f| += form_with model: @form, url: batch_admin_ip_blocks_path do |f| = hidden_field_tag :page, params[:page] || 1 .batch-table diff --git a/app/views/admin/relationships/index.html.haml b/app/views/admin/relationships/index.html.haml index c2daefb424..83ffd139de 100644 --- a/app/views/admin/relationships/index.html.haml +++ b/app/views/admin/relationships/index.html.haml @@ -24,7 +24,7 @@ %hr.spacer/ -= form_for(@form, url: batch_admin_accounts_path) do |f| += form_with model: @form, url: batch_admin_accounts_path do |f| .batch-table .batch-table__toolbar %label.batch-table__toolbar__select.batch-checkbox-all diff --git a/app/views/admin/reports/show.html.haml b/app/views/admin/reports/show.html.haml index 842aa51597..ca1edea0fe 100644 --- a/app/views/admin/reports/show.html.haml +++ b/app/views/admin/reports/show.html.haml @@ -45,7 +45,7 @@ admin_account_statuses_path(@report.target_account_id, report_id: @report.id), class: 'table-action-link' -= form_for(@form, url: batch_admin_account_statuses_path(@report.target_account_id, report_id: @report.id)) do |f| += form_with model: @form, url: batch_admin_account_statuses_path(@report.target_account_id, report_id: @report.id) do |f| .batch-table .batch-table__toolbar %label.batch-table__toolbar__select.batch-checkbox-all diff --git a/app/views/admin/statuses/index.html.haml b/app/views/admin/statuses/index.html.haml index a41a6332dd..770d972d93 100644 --- a/app/views/admin/statuses/index.html.haml +++ b/app/views/admin/statuses/index.html.haml @@ -21,7 +21,7 @@ %hr.spacer/ -= form_for(@status_batch_action, url: batch_admin_account_statuses_path(@account.id)) do |f| += form_with model: @status_batch_action, url: batch_admin_account_statuses_path(@account.id) do |f| = hidden_field_tag :page, params[:page] || 1 - Admin::StatusFilter::KEYS.each do |key| diff --git a/app/views/admin/trends/links/index.html.haml b/app/views/admin/trends/links/index.html.haml index 20d8ecf851..647c24b1e9 100644 --- a/app/views/admin/trends/links/index.html.haml +++ b/app/views/admin/trends/links/index.html.haml @@ -26,7 +26,7 @@ = t('admin.trends.preview_card_providers.title') = material_symbol 'chevron_right' -= form_for(@form, url: batch_admin_trends_links_path) do |f| += form_with model: @form, url: batch_admin_trends_links_path do |f| = hidden_field_tag :page, params[:page] || 1 - Trends::PreviewCardFilter::KEYS.each do |key| diff --git a/app/views/admin/trends/links/preview_card_providers/index.html.haml b/app/views/admin/trends/links/preview_card_providers/index.html.haml index 706c607010..b43b8dfff9 100644 --- a/app/views/admin/trends/links/preview_card_providers/index.html.haml +++ b/app/views/admin/trends/links/preview_card_providers/index.html.haml @@ -20,7 +20,7 @@ %hr.spacer/ -= form_for(@form, url: batch_admin_trends_links_preview_card_providers_path) do |f| += form_with model: @form, url: batch_admin_trends_links_preview_card_providers_path do |f| = hidden_field_tag :page, params[:page] || 1 - Trends::PreviewCardProviderFilter::KEYS.each do |key| diff --git a/app/views/admin/trends/statuses/index.html.haml b/app/views/admin/trends/statuses/index.html.haml index 8fbc0ba5b5..4713f8c2ae 100644 --- a/app/views/admin/trends/statuses/index.html.haml +++ b/app/views/admin/trends/statuses/index.html.haml @@ -22,7 +22,7 @@ %li= filter_link_to t('generic.all'), trending: nil %li= filter_link_to t('admin.trends.only_allowed'), trending: 'allowed' -= form_for(@form, url: batch_admin_trends_statuses_path) do |f| += form_with model: @form, url: batch_admin_trends_statuses_path do |f| = hidden_field_tag :page, params[:page] || 1 - Trends::StatusFilter::KEYS.each do |key| diff --git a/app/views/admin/trends/tags/index.html.haml b/app/views/admin/trends/tags/index.html.haml index 655955f7f6..3a44cf3a70 100644 --- a/app/views/admin/trends/tags/index.html.haml +++ b/app/views/admin/trends/tags/index.html.haml @@ -14,7 +14,7 @@ %li= filter_link_to t('admin.trends.rejected'), status: 'rejected' %li= filter_link_to safe_join([t('admin.accounts.moderation.pending'), "(#{Tag.pending_review.count})"], ' '), status: 'pending_review' -= form_for(@form, url: batch_admin_trends_tags_path) do |f| += form_with model: @form, url: batch_admin_trends_tags_path do |f| = hidden_field_tag :page, params[:page] || 1 - Trends::TagFilter::KEYS.each do |key| diff --git a/app/views/filters/statuses/index.html.haml b/app/views/filters/statuses/index.html.haml index eaa39e170f..915ec59caf 100644 --- a/app/views/filters/statuses/index.html.haml +++ b/app/views/filters/statuses/index.html.haml @@ -13,7 +13,7 @@ %hr.spacer/ -= form_for(@status_filter_batch_action, url: batch_filter_statuses_path(@filter.id)) do |f| += form_with model: @status_filter_batch_action, url: batch_filter_statuses_path(@filter.id) do |f| = hidden_field_tag :page, params[:page] || 1 - Admin::StatusFilter::KEYS.each do |key| diff --git a/app/views/relationships/show.html.haml b/app/views/relationships/show.html.haml index 97ba49eb52..6a866b13f8 100644 --- a/app/views/relationships/show.html.haml +++ b/app/views/relationships/show.html.haml @@ -31,7 +31,7 @@ %li= filter_link_to t('relationships.most_recent'), order: nil %li= filter_link_to t('relationships.last_active'), order: 'active' -= form_for(@form, url: relationships_path, method: :patch) do |f| += form_with model: @form, url: relationships_path, method: :patch do |f| = hidden_field_tag :page, params[:page] || 1 - RelationshipFilter::KEYS.each do |key|