Skip to content

Commit e7ad3d8

Browse files
committed
Load main content for pages migrated to page layouts
Widgets in page layouts are already lazily loaded, so loading the page itself twice provides little benefit. This commit prevents the INIT block from running twice, which should enhance performance.
1 parent 1f38e9d commit e7ad3d8

File tree

6 files changed

+7
-3
lines changed

6 files changed

+7
-3
lines changed

share/html/Asset/Create.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
%# those contributions and any derivatives thereof.
4646
%#
4747
%# END BPS TAGGED BLOCK }}}
48-
<& /Elements/Header, Title => loc("Create a new asset in catalog [_1]", $catalog->Name), &>
48+
<& /Elements/Header, Title => loc("Create a new asset in catalog [_1]", $catalog->Name), LoadMainContent => 1, &>
4949
<& /Elements/Tabs &>
5050

5151
<& /Elements/ListActions, actions => \@results &>

share/html/Asset/Display.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
Title => loc("Asset #[_1]: [_2]", $asset->id, $asset->Name),
5050
TitleTrigger => 'assetNameChanged from:body',
5151
TitleSource => RT->Config->Get('WebPath') . '/Views/Asset/Title?id=' . $asset->Id,
52+
LoadMainContent => 1,
5253
&>
5354
<& /Elements/Tabs &>
5455

share/html/Elements/Header

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
<div id="main-navigation" tabindex="-1"><& /Elements/Menu, menu => Menu(), id => 'app-nav' &></div>
107107
% }
108108

109-
% if ( $ShowMenu
109+
% if ( !$LoadMainContent && $ShowMenu
110110
% && RT::Interface::Web->ModernClient()
111111
% && ( $DECODED_ARGS->{ModernClient} // 1 )
112112
% && !RT::Interface::Web::RequestENV('HTTP_HX_REQUEST')
@@ -247,4 +247,5 @@ $BodyClass => undef
247247
$MainContainerClass => undef
248248
$TitleTrigger => ''
249249
$TitleSource => ''
250+
$LoadMainContent => undef
250251
</%ARGS>

share/html/Ticket/Create.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
%# END BPS TAGGED BLOCK }}}
4848
<& /Elements/Header,
4949
Title => $title,
50+
LoadMainContent => 1,
5051
&>
5152
<& /Elements/Tabs &>
5253

share/html/Ticket/Display.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
Title => $title,
5050
TitleTrigger => 'ticketSubjectChanged from:body',
5151
TitleSource => RT->Config->Get('WebPath') . '/Views/Ticket/Title?id=' . $TicketObj->Id,
52+
LoadMainContent => 1,
5253
LinkRel => \%link_rel &>
5354
<& /Elements/Tabs &>
5455

share/html/Ticket/Update.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
%# those contributions and any derivatives thereof.
4646
%#
4747
%# END BPS TAGGED BLOCK }}}
48-
<& /Elements/Header, Title => $title &>
48+
<& /Elements/Header, Title => $title, LoadMainContent => 1, &>
4949
<& /Elements/Tabs &>
5050

5151
% $m->callback(CallbackName => 'BeforeActionList', ARGSRef => \%ARGS, Ticket => $TicketObj, results => \@results);

0 commit comments

Comments
 (0)