From 9974163776b3e65e7cfa41e6293876909a1635b7 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 24 Aug 2023 03:56:23 -0400 Subject: [PATCH] Consolidate inclusion of `admin` js pack link (#26628) --- app/views/admin/accounts/index.html.haml | 3 --- app/views/admin/action_logs/index.html.haml | 3 --- app/views/admin/announcements/edit.html.haml | 3 --- app/views/admin/announcements/new.html.haml | 3 --- app/views/admin/custom_emojis/index.html.haml | 3 --- app/views/admin/dashboard/index.html.haml | 3 --- app/views/admin/disputes/appeals/index.html.haml | 3 --- app/views/admin/domain_allows/new.html.haml | 3 --- app/views/admin/domain_blocks/confirm_suspension.html.haml | 3 --- app/views/admin/domain_blocks/edit.html.haml | 3 --- app/views/admin/domain_blocks/new.html.haml | 3 --- app/views/admin/email_domain_blocks/index.html.haml | 3 --- app/views/admin/email_domain_blocks/new.html.haml | 3 --- app/views/admin/export_domain_blocks/import.html.haml | 3 --- app/views/admin/follow_recommendations/show.html.haml | 3 --- app/views/admin/instances/index.html.haml | 3 --- app/views/admin/instances/show.html.haml | 3 --- app/views/admin/ip_blocks/index.html.haml | 3 --- app/views/admin/reports/show.html.haml | 4 ---- app/views/admin/settings/about/show.html.haml | 3 --- app/views/admin/settings/appearance/show.html.haml | 3 --- app/views/admin/settings/branding/show.html.haml | 3 --- app/views/admin/settings/content_retention/show.html.haml | 3 --- app/views/admin/settings/discovery/show.html.haml | 3 --- app/views/admin/settings/registrations/show.html.haml | 3 --- app/views/admin/statuses/index.html.haml | 3 --- app/views/admin/statuses/show.html.haml | 3 --- app/views/admin/tags/show.html.haml | 3 --- app/views/admin/trends/links/index.html.haml | 3 --- .../admin/trends/links/preview_card_providers/index.html.haml | 3 --- app/views/admin/trends/statuses/index.html.haml | 3 --- app/views/admin/trends/tags/index.html.haml | 3 --- app/views/filters/statuses/index.html.haml | 3 --- app/views/layouts/admin.html.haml | 1 + 34 files changed, 1 insertion(+), 100 deletions(-) diff --git a/app/views/admin/accounts/index.html.haml b/app/views/admin/accounts/index.html.haml index 57d944b57a4ffbc3ffa367da47b4e1842e82dde4..da11e4361c2d13bbf58ed93f08809adbe6aa09b8 100644 --- a/app/views/admin/accounts/index.html.haml +++ b/app/views/admin/accounts/index.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('admin.accounts.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - = form_tag admin_accounts_url, method: 'GET', class: 'simple_form' do .filters .filter-subset.filter-subset--with-select diff --git a/app/views/admin/action_logs/index.html.haml b/app/views/admin/action_logs/index.html.haml index 4c78797c13ff36607988074e46c6af5bd06abecd..c4929cc422d79b9ed1002b2032b520a00723f3b0 100644 --- a/app/views/admin/action_logs/index.html.haml +++ b/app/views/admin/action_logs/index.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('admin.action_logs.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - = form_tag admin_action_logs_url, method: 'GET', class: 'simple_form' do = hidden_field_tag :target_account_id, params[:target_account_id] if params[:target_account_id].present? diff --git a/app/views/admin/announcements/edit.html.haml b/app/views/admin/announcements/edit.html.haml index c6c47586a0d8d0d4f93251f3cdccf637b057b07d..df1ac455fb839052523b7a812646b18727349f90 100644 --- a/app/views/admin/announcements/edit.html.haml +++ b/app/views/admin/announcements/edit.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - = simple_form_for @announcement, url: admin_announcement_path(@announcement), html: { novalidate: false } do |f| = render 'shared/error_messages', object: @announcement diff --git a/app/views/admin/announcements/new.html.haml b/app/views/admin/announcements/new.html.haml index 57b7d5e0c6fc62cf0f33d0f329a5a50a4a9efa33..cb39672e1659fdc39ed6b2b25c525ac662c3162b 100644 --- a/app/views/admin/announcements/new.html.haml +++ b/app/views/admin/announcements/new.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - = simple_form_for @announcement, url: admin_announcements_path, html: { novalidate: false } do |f| = render 'shared/error_messages', object: @announcement diff --git a/app/views/admin/custom_emojis/index.html.haml b/app/views/admin/custom_emojis/index.html.haml index eb41563ee631ef225abb80401a050b8a969cba97..8b4e93ac3594ff5ccd8c4c253755ffeaefb19fcf 100644 --- a/app/views/admin/custom_emojis/index.html.haml +++ b/app/views/admin/custom_emojis/index.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('admin.custom_emojis.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - if can?(:create, :custom_emoji) - content_for :heading_actions do = link_to t('admin.custom_emojis.upload'), new_admin_custom_emoji_path, class: 'button' diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index ab7cb9de6523a7dc6d502b0ac5ee0c403402d0ab..3597152e09ed4996574655682b7afb64825ac0ee 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('admin.dashboard.title') diff --git a/app/views/admin/disputes/appeals/index.html.haml b/app/views/admin/disputes/appeals/index.html.haml index 602414550e803436cdcabababb074e56ef239cf1..7f04dd40fb5f919ce005fe738174b3c8121eb602 100644 --- a/app/views/admin/disputes/appeals/index.html.haml +++ b/app/views/admin/disputes/appeals/index.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('admin.disputes.appeals.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - .filters .filter-subset %strong= t('admin.tags.review') diff --git a/app/views/admin/domain_allows/new.html.haml b/app/views/admin/domain_allows/new.html.haml index 249a961cee85bb0ec58bbb618a69044f247e1192..85ab7e46441eb8d53eedf176a7ad99940beb1e46 100644 --- a/app/views/admin/domain_allows/new.html.haml +++ b/app/views/admin/domain_allows/new.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('admin.domain_allows.add_new') diff --git a/app/views/admin/domain_blocks/confirm_suspension.html.haml b/app/views/admin/domain_blocks/confirm_suspension.html.haml index 1d28ba1579fd39702a3281cae5f579b693093185..e0e55e70f39cf47aea53f1ef07be1654857f32f2 100644 --- a/app/views/admin/domain_blocks/confirm_suspension.html.haml +++ b/app/views/admin/domain_blocks/confirm_suspension.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('.title', domain: Addressable::IDNA.to_unicode(@domain_block.domain)) diff --git a/app/views/admin/domain_blocks/edit.html.haml b/app/views/admin/domain_blocks/edit.html.haml index 66bc0e241a4cb7036e3bd815f27f8ea46e9199f6..ae76b6777a22ca4521a5ef34914ad3b00242cf44 100644 --- a/app/views/admin/domain_blocks/edit.html.haml +++ b/app/views/admin/domain_blocks/edit.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('admin.domain_blocks.edit') diff --git a/app/views/admin/domain_blocks/new.html.haml b/app/views/admin/domain_blocks/new.html.haml index 5c28508cfa79119dc47d6a20b88184d5a8949fa7..86e519f451bdffb2980beb7930ee68c41f896110 100644 --- a/app/views/admin/domain_blocks/new.html.haml +++ b/app/views/admin/domain_blocks/new.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('.title') diff --git a/app/views/admin/email_domain_blocks/index.html.haml b/app/views/admin/email_domain_blocks/index.html.haml index b073e87162c0a362cea65a26952280bd8b77e67b..9f16e0d5c36460a68edaec4767dd54abb3a70d2c 100644 --- a/app/views/admin/email_domain_blocks/index.html.haml +++ b/app/views/admin/email_domain_blocks/index.html.haml @@ -4,9 +4,6 @@ - content_for :heading_actions do = link_to t('admin.email_domain_blocks.add_new'), new_admin_email_domain_block_path, class: 'button' -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - = form_for(@form, url: batch_admin_email_domain_blocks_path) do |f| = hidden_field_tag :page, params[:page] || 1 diff --git a/app/views/admin/email_domain_blocks/new.html.haml b/app/views/admin/email_domain_blocks/new.html.haml index 524b6996884f05bb5e6d67b84442109eba0c00ee..fa1d950ad2b3336f8fb4132ea1769da3d0fd6833 100644 --- a/app/views/admin/email_domain_blocks/new.html.haml +++ b/app/views/admin/email_domain_blocks/new.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - = simple_form_for @email_domain_block, url: admin_email_domain_blocks_path do |f| = render 'shared/error_messages', object: @email_domain_block diff --git a/app/views/admin/export_domain_blocks/import.html.haml b/app/views/admin/export_domain_blocks/import.html.haml index 804e61199e9de682f5c218cbc85f02ff9dd92c64..01add232d16d1d8ced2f64b385082e9703767826 100644 --- a/app/views/admin/export_domain_blocks/import.html.haml +++ b/app/views/admin/export_domain_blocks/import.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('admin.export_domain_blocks.import.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - %p= t('admin.export_domain_blocks.import.description_html') - if defined?(@global_private_comment) && @global_private_comment.present? diff --git a/app/views/admin/follow_recommendations/show.html.haml b/app/views/admin/follow_recommendations/show.html.haml index ebc4a2c6b8644ce9ee051b36d5bb4616a6514eef..dc65a72135bf5b6d203419e32bd65cbd0c53c420 100644 --- a/app/views/admin/follow_recommendations/show.html.haml +++ b/app/views/admin/follow_recommendations/show.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('admin.follow_recommendations.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - %p= t('admin.follow_recommendations.description_html') %hr.spacer/ diff --git a/app/views/admin/instances/index.html.haml b/app/views/admin/instances/index.html.haml index 189dddcd2927193c0048c23cb7267f4ea9ca54c7..7e43b4c538642931dcfe6ff66cfb5baf200f8926 100644 --- a/app/views/admin/instances/index.html.haml +++ b/app/views/admin/instances/index.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('admin.instances.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :heading_actions do - if limited_federation_mode? = link_to t('admin.domain_allows.add_new'), new_admin_domain_allow_path, class: 'button', id: 'add-instance-button' diff --git a/app/views/admin/instances/show.html.haml b/app/views/admin/instances/show.html.haml index 3e4c41f737d9ee27381d0b37f929c39a4493456b..46b5c301b53db66b6fae4e4656f918aa6365c635 100644 --- a/app/views/admin/instances/show.html.haml +++ b/app/views/admin/instances/show.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = @instance.domain -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - if current_user.can?(:view_dashboard) - content_for :heading_actions do = l(@time_period.first) diff --git a/app/views/admin/ip_blocks/index.html.haml b/app/views/admin/ip_blocks/index.html.haml index 675c0aaad0e86d26ef59d961588a99f3b8f8e87e..a48e4791a3634482042e43c3c85d5266a58e433d 100644 --- a/app/views/admin/ip_blocks/index.html.haml +++ b/app/views/admin/ip_blocks/index.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('admin.ip_blocks.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - if can?(:create, :ip_block) - content_for :heading_actions do = link_to t('admin.ip_blocks.add_new'), new_admin_ip_block_path, class: 'button' diff --git a/app/views/admin/reports/show.html.haml b/app/views/admin/reports/show.html.haml index 2dd93d028c73a5f09bcca754dff6455d358b66c5..2508bc2b5b5673ea0b8c3c4a357811b6a389431b 100644 --- a/app/views/admin/reports/show.html.haml +++ b/app/views/admin/reports/show.html.haml @@ -1,7 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - = javascript_pack_tag 'public', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('admin.reports.report', id: @report.id) diff --git a/app/views/admin/settings/about/show.html.haml b/app/views/admin/settings/about/show.html.haml index 7b1b907ee2b9c1eee61e7d866f156ad98398c743..1237c20fa8e36b58f0f2a37e999adfdffde26efb 100644 --- a/app/views/admin/settings/about/show.html.haml +++ b/app/views/admin/settings/about/show.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('admin.settings.about.title') diff --git a/app/views/admin/settings/appearance/show.html.haml b/app/views/admin/settings/appearance/show.html.haml index 1e73ab0a24812a1a45ad7c4b67d2a03499ccc2cb..ed61774c9b0379614e28ccd7a10a4cd7e5dbac5c 100644 --- a/app/views/admin/settings/appearance/show.html.haml +++ b/app/views/admin/settings/appearance/show.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('admin.settings.appearance.title') diff --git a/app/views/admin/settings/branding/show.html.haml b/app/views/admin/settings/branding/show.html.haml index 74a6fadf98010c95342839aa0072f18015136d24..aee730689227e9df355589ec7392593165ba32a0 100644 --- a/app/views/admin/settings/branding/show.html.haml +++ b/app/views/admin/settings/branding/show.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('admin.settings.branding.title') diff --git a/app/views/admin/settings/content_retention/show.html.haml b/app/views/admin/settings/content_retention/show.html.haml index de34b5ee3c0d261f0edbb7194801639884be0329..5a67016148d021fcf22d70445246a2c20756b26d 100644 --- a/app/views/admin/settings/content_retention/show.html.haml +++ b/app/views/admin/settings/content_retention/show.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('admin.settings.content_retention.title') diff --git a/app/views/admin/settings/discovery/show.html.haml b/app/views/admin/settings/discovery/show.html.haml index 759bbdcebe4b0c9fbd0fee685638488238d54f1d..c48e0fdc62bb88894443eab28de1b67f0e4911fb 100644 --- a/app/views/admin/settings/discovery/show.html.haml +++ b/app/views/admin/settings/discovery/show.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('admin.settings.discovery.title') diff --git a/app/views/admin/settings/registrations/show.html.haml b/app/views/admin/settings/registrations/show.html.haml index e06385bc8182d2e176b458b1fa0bedf35d9b77e0..168f1097570772989bd481cb37bc212c8a3e5b56 100644 --- a/app/views/admin/settings/registrations/show.html.haml +++ b/app/views/admin/settings/registrations/show.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('admin.settings.registrations.title') diff --git a/app/views/admin/statuses/index.html.haml b/app/views/admin/statuses/index.html.haml index d3d7cc160b93ea01856aaa8ac09da5b94fe52dcc..9163dee795fc1ffdcaac43ebdafc9cbf7e28e0d5 100644 --- a/app/views/admin/statuses/index.html.haml +++ b/app/views/admin/statuses/index.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('admin.statuses.title') \- diff --git a/app/views/admin/statuses/show.html.haml b/app/views/admin/statuses/show.html.haml index 4631e97f1613977d2295332a938c616ffb9ca69c..e070e5872bd8692f501f07225e3209fc2cb1774f 100644 --- a/app/views/admin/statuses/show.html.haml +++ b/app/views/admin/statuses/show.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('statuses.title', name: display_name(@account), quote: truncate(@status.spoiler_text.presence || @status.text, length: 50, omission: '…', escape: false)) diff --git a/app/views/admin/tags/show.html.haml b/app/views/admin/tags/show.html.haml index 104190b5885eda5ff1e2f2b464de548f6c0160a3..71bce0c0cb20442a62fbca10f9d68c2f5083f5f7 100644 --- a/app/views/admin/tags/show.html.haml +++ b/app/views/admin/tags/show.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = "##{@tag.display_name}" diff --git a/app/views/admin/trends/links/index.html.haml b/app/views/admin/trends/links/index.html.haml index 7b5122cf1c13a8ee798c90eafd5f190c5a806cc2..e6ed9d95f6601bc47832b7acdb541c4fc85a4412 100644 --- a/app/views/admin/trends/links/index.html.haml +++ b/app/views/admin/trends/links/index.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('admin.trends.links.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - %p= t('admin.trends.links.description_html') %hr.spacer/ 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 025270c128fbc9b18286b1ab671c0e1ca189e7ac..d9ad12fc966ac4eb22f2a9a246f40342e1d841cd 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 @@ -1,9 +1,6 @@ - content_for :page_title do = t('admin.trends.preview_card_providers.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - %p= t('admin.trends.preview_card_providers.description_html') %hr.spacer/ diff --git a/app/views/admin/trends/statuses/index.html.haml b/app/views/admin/trends/statuses/index.html.haml index a42d60b0095543dfc3913a7e3faba8ca1a1078da..bf04772f2280c2bc77c42a7c4ac4f4d2d5b59f3c 100644 --- a/app/views/admin/trends/statuses/index.html.haml +++ b/app/views/admin/trends/statuses/index.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('admin.trends.statuses.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - %p= t('admin.trends.statuses.description_html') %hr.spacer/ diff --git a/app/views/admin/trends/tags/index.html.haml b/app/views/admin/trends/tags/index.html.haml index 1ea34c9e3f04055b0e088a50da9d81c9039baa2c..4730d20c180af0bf164503c54b3022a13f61c4c8 100644 --- a/app/views/admin/trends/tags/index.html.haml +++ b/app/views/admin/trends/tags/index.html.haml @@ -1,9 +1,6 @@ - content_for :page_title do = t('admin.trends.tags.title') -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - %p= t('admin.trends.tags.description_html') %hr.spacer/ diff --git a/app/views/filters/statuses/index.html.haml b/app/views/filters/statuses/index.html.haml index 886de58fa06c0d2194546dcf9caa4875dbb704a7..eaa39e170ff51d90193ca1e502df0f029f0fe3b3 100644 --- a/app/views/filters/statuses/index.html.haml +++ b/app/views/filters/statuses/index.html.haml @@ -1,6 +1,3 @@ -- content_for :header_tags do - = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - - content_for :page_title do = t('filters.statuses.index.title') \- diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index e7a163c92aa973ed893c10a20a9cbca115b21036..d725e65aa9f1edfb81b5d7ef3bfa9dc48f1e8396 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -1,6 +1,7 @@ - content_for :header_tags do = render_initial_state = javascript_pack_tag 'public', crossorigin: 'anonymous' + = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous' - content_for :content do .admin-wrapper