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

View File

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