Simplify logo generation

Use a template variable only for html attributes of the logo
Move static HTML into Navigation.mustache

Change-Id: If37015b9ce4f37e264b6f25956e4d0ca35e8cdff
This commit is contained in:
jdlrobson 2020-01-27 22:42:03 +08:00 committed by Jdlrobson
parent 0cdf0c238a
commit 12e2287894
2 changed files with 9 additions and 6 deletions

View File

@ -131,11 +131,12 @@ class VectorTemplate extends BaseTemplate {
'html-personal-menu' => $this->renderNavigation( [ 'PERSONAL' ] ),
'html-navigation-left-tabs' => $this->renderNavigation( [ 'NAMESPACES', 'VARIANTS' ] ),
'html-navigation-right-tabs' => $this->renderNavigation( [ 'VIEWS', 'ACTIONS', 'SEARCH' ] ),
'html-logo' => '<div id="p-logo" role="banner"><a class="mw-wiki-logo" href="' .
htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) .
'"' .
Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) ) .
'></a></div>',
'html-logo-attributes' => Xml::expandAttributes(
Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) + [
'class' => 'mw-wiki-logo',
'href' => Skin::makeMainPageUrl(),
]
),
'html-portals' => $this->renderPortals( $this->data['sidebar'] ),
] ),
];

View File

@ -19,7 +19,9 @@
</div>
</div>
<div id="mw-panel">
{{{html-logo}}}
<div id="p-logo" role="banner">
<a {{{html-logo-attributes}}}></a>
</div>
{{{html-portals}}}
</div>
</div>