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 57d944b57a..da11e4361c 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 4c78797c13..c4929cc422 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 c6c47586a0..df1ac455fb 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 57b7d5e0c6..cb39672e16 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 eb41563ee6..8b4e93ac35 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 ab7cb9de65..3597152e09 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 602414550e..7f04dd40fb 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 249a961cee..85ab7e4644 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 1d28ba1579..e0e55e70f3 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 66bc0e241a..ae76b6777a 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 5c28508cfa..86e519f451 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 b073e87162..9f16e0d5c3 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 524b699688..fa1d950ad2 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 804e61199e..01add232d1 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 ebc4a2c6b8..dc65a72135 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 189dddcd29..7e43b4c538 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 3e4c41f737..46b5c301b5 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 675c0aaad0..a48e4791a3 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 2dd93d028c..2508bc2b5b 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 7b1b907ee2..1237c20fa8 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 1e73ab0a24..ed61774c9b 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 74a6fadf98..aee7306892 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 de34b5ee3c..5a67016148 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 759bbdcebe..c48e0fdc62 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 e06385bc81..168f109757 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 d3d7cc160b..9163dee795 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 4631e97f16..e070e5872b 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 104190b588..71bce0c0cb 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 7b5122cf1c..e6ed9d95f6 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 025270c128..d9ad12fc96 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 a42d60b009..bf04772f22 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 1ea34c9e3f..4730d20c18 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 886de58fa0..eaa39e170f 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 e7a163c92a..d725e65aa9 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