[dev][Legacy] split sidebar Mustache and Less

Split out the sidebar in advance of significant Latest mode only
changes.

The Less split was made by adding a new Sidebar.less file that imports
the Legacy implementation.

The Mustache split was made by file copying the existing implementation
into a legacy/ subfolder. Both the Legacy and Latest implementations
were then stripped of templates not applicable to their modes.

These changes are aligned with the splits for JavaScript.

Bug: T246419
Change-Id: Ib82769ea16bfc09efe8a088220aab55bdde0d381
This commit is contained in:
Stephen Niedzielski 2020-05-14 18:58:21 -06:00 committed by Jdlrobson
parent 9d9ed35629
commit 0fac9045ac
6 changed files with 39 additions and 27 deletions

View file

@ -7,15 +7,9 @@
MenuDefinition data-portals-first MenuDefinition data-portals-first
MenuDefinition[] array-portals-rest MenuDefinition[] array-portals-rest
emphasized-sidebar-action data-emphasized-sidebar-action For displaying an emphasized action in the sidebar. emphasized-sidebar-action data-emphasized-sidebar-action For displaying an emphasized action in the sidebar.
@prop boolean has-logo whether to show a logo or not.
}} }}
<div id="mw-panel"> <div id="mw-panel">
{{#has-logo}}
<div id="p-logo" role="banner">
<a {{{html-logo-attributes}}}></a>
</div>
{{/has-logo}}
{{#data-portals-first}}{{>Menu}}{{/data-portals-first}} {{#data-portals-first}}{{>Menu}}{{/data-portals-first}}
{{#data-emphasized-sidebar-action}} {{#data-emphasized-sidebar-action}}
<div class="vector-emphasized-sidebar-action"> <div class="vector-emphasized-sidebar-action">

View file

@ -81,7 +81,7 @@
{{#data-search-box}}{{>SearchBox}}{{/data-search-box}} {{#data-search-box}}{{>SearchBox}}{{/data-search-box}}
</div> </div>
</div> </div>
{{#data-sidebar}}{{>Sidebar}}{{/data-sidebar}} {{#data-sidebar}}{{>legacy/Sidebar}}{{/data-sidebar}}
</div> </div>
{{#data-footer}}{{>Footer}}{{/data-footer}} {{#data-footer}}{{>Footer}}{{/data-footer}}
{{{html-printtail}}} {{{html-printtail}}}

View file

@ -0,0 +1,16 @@
{{!
string html-logo-attributes for site logo. Must be used inside tag e.g. `class="logo" lang="en-gb"`
MenuDefinition data-portals-first
MenuDefinition[] array-portals-rest
@prop boolean has-logo whether to show a logo or not.
}}
<div id="mw-panel">
{{#has-logo}}
<div id="p-logo" role="banner">
<a {{{html-logo-attributes}}}></a>
</div>
{{/has-logo}}
{{#data-portals-first}}{{>Menu}}{{/data-portals-first}}
{{#array-portals-rest}}{{>Menu}}{{/array-portals-rest}}
</div>

View file

@ -1,20 +1,2 @@
@import '../../variables.less'; @import '../../variables.less';
@import 'legacy/Sidebar.less';
/* Panel */
#mw-panel {
font-size: @font-size-nav-main;
.portal-first,
/* FIXME: For caching. Can be removed in a week from the git blame commit id of this line. */
#p-logo + .portal {
background-image: none;
h3 {
display: none;
}
.body {
margin-left: @margin-start-nav-main-body;
}
}
}

View file

@ -17,7 +17,7 @@
@import 'TabWatchstarLink.less'; @import 'TabWatchstarLink.less';
@import 'MenuDropdown.less'; @import 'MenuDropdown.less';
@import 'MenuPortal.less'; @import 'MenuPortal.less';
@import 'Sidebar.less'; @import 'legacy/Sidebar.less';
@import 'SidebarLogo.less'; @import 'SidebarLogo.less';
@import 'Footer.less'; @import 'Footer.less';
} }

View file

@ -0,0 +1,20 @@
@import '../../../variables.less';
/* Panel */
#mw-panel {
font-size: @font-size-nav-main;
.portal-first,
/* FIXME: For caching. Can be removed in a week from the git blame commit id of this line. */
#p-logo + .portal {
background-image: none;
h3 {
display: none;
}
.body {
margin-left: @margin-start-nav-main-body;
}
}
}