mediawiki-skins-Vector/includes/templates/Sidebar.mustache
jdlrobson e84809c44b Cleanup: Standardise msg keys
Keys prefixed with msg- should relate to i18n keys. Fix the existing
template variables where that's not the case.

Change-Id: I33587a09a9803a3667eaeea95ce3e1753439f413
2020-06-01 21:05:56 +00:00

45 lines
1.5 KiB
Plaintext

{{!
@typedef object emphasized-sidebar-action
@prop string href
@prop string text
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
emphasized-sidebar-action data-emphasized-sidebar-action For displaying an emphasized action in the sidebar.
string msg-vector-action-toggle-sidebar The label used by the sidebar button.
boolean sidebar-visible For users that want to see the sidebar on initial render, this should be
true.
}}
<input
type="checkbox"
id="mw-sidebar-checkbox"
class="mw-checkbox-hack-checkbox"
role="button"
{{#sidebar-visible}}checked{{/sidebar-visible}}
aria-labelledby="mw-sidebar-button"
aria-controls="mw-panel">
<label
id="mw-sidebar-button"
class="
mw-checkbox-hack-button
mw-ui-icon
mw-ui-icon-element
{{#sidebar-visible}}mw-ui-icon-wikimedia-collapseHorizontal-base20{{/sidebar-visible}}
{{^sidebar-visible}}mw-ui-icon-wikimedia-menu-base20{{/sidebar-visible}}
"
for="mw-sidebar-checkbox"
data-event-name="ui.sidebar">
{{msg-vector-action-toggle-sidebar}}
</label>
<div id="mw-panel" class="mw-sidebar mw-checkbox-hack-target">
{{#data-portals-first}}{{>Menu}}{{/data-portals-first}}
{{#data-emphasized-sidebar-action}}
<div class="mw-sidebar-action">
<a class="mw-sidebar-action-link" title="{{title}}" href="{{href}}">{{text}}</a>
</div>
{{/data-emphasized-sidebar-action}}
{{#array-portals-rest}}{{>Menu}}{{/array-portals-rest}}
</div>