mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-23 23:33:54 +00:00
Rename data-user-menu prefix to data-user-links, matching the template and component naming convention, create UserLinksDropdown.mustache
Change-Id: I6f0de836e39ba6bdcd5a8ff832e951164d69e586
This commit is contained in:
parent
422f5b0741
commit
fcc3d3c9a9
|
@ -124,8 +124,8 @@ class VectorComponentUserLinks implements VectorComponent {
|
|||
return $additionalData + [
|
||||
'is-temp-user' => $user->isTemp(),
|
||||
'is-wide' => count( $overflowMenu ) > 3,
|
||||
'data-user-menu-overflow' => $overflowMenu->getTemplateData(),
|
||||
'data-user-menu-dropdown' => $userMenuDropdown->getTemplateData(),
|
||||
'data-user-links-overflow-menu' => $overflowMenu->getTemplateData(),
|
||||
'data-user-links-dropdown' => $userMenuDropdown->getTemplateData(),
|
||||
'data-dropdown-menu' => $userMenu->getTemplateData(),
|
||||
'data-account-links' => $this->accountMenu->getTemplateData(),
|
||||
];
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
<nav class="vector-user-links{{#is-wide}} vector-user-links-wide{{/is-wide}}" aria-label="{{msg-personaltools}}" role="navigation" >
|
||||
{{#data-user-menu-overflow}}{{>Menu}}{{/data-user-menu-overflow}}
|
||||
{{#data-user-menu-dropdown}}
|
||||
{{>Dropdown/Open}}
|
||||
{{#is-anon}}
|
||||
{{#is-temp-user}}
|
||||
{{>UserLinks__templogin}}
|
||||
{{/is-temp-user}}
|
||||
{{^is-temp-user}}
|
||||
{{>UserLinks__login}}
|
||||
{{/is-temp-user}}
|
||||
{{/is-anon}}
|
||||
{{#data-dropdown-menu}}{{>MenuContents}}{{/data-dropdown-menu}}
|
||||
{{^is-anon}}
|
||||
{{!-- The #pt-logout ID is required for the AJAX enabled logout in mediawiki.page.ready to work.}}
|
||||
{{#data-account-links}}{{>MenuContents}}{{/data-account-links}}
|
||||
{{/is-anon}}
|
||||
{{>Dropdown/Close}}
|
||||
{{/data-user-menu-dropdown}}
|
||||
{{#data-user-links-overflow-menu}}{{>Menu}}{{/data-user-links-overflow-menu}}
|
||||
{{>UserLinksDropdown}}
|
||||
</nav>
|
||||
|
|
15
includes/templates/UserLinksDropdown.mustache
Normal file
15
includes/templates/UserLinksDropdown.mustache
Normal file
|
@ -0,0 +1,15 @@
|
|||
{{#data-user-links-dropdown}}{{>Dropdown/Open}}{{/data-user-links-dropdown}}
|
||||
{{#is-anon}}
|
||||
{{#is-temp-user}}
|
||||
{{>UserLinks__templogin}}
|
||||
{{/is-temp-user}}
|
||||
{{^is-temp-user}}
|
||||
{{>UserLinks__login}}
|
||||
{{/is-temp-user}}
|
||||
{{/is-anon}}
|
||||
{{#data-dropdown-menu}}{{>MenuContents}}{{/data-dropdown-menu}}
|
||||
{{^is-anon}}
|
||||
{{!-- The #pt-logout ID is required for the AJAX enabled logout in mediawiki.page.ready to work.}}
|
||||
{{#data-account-links}}{{>MenuContents}}{{/data-account-links}}
|
||||
{{/is-anon}}
|
||||
{{#data-user-links-dropdown}}{{>Dropdown/Close}}{{/data-user-links-dropdown}}
|
|
@ -2,6 +2,7 @@ const mustache = require( 'mustache' );
|
|||
const fs = require( 'fs' );
|
||||
const menuContents = fs.readFileSync( 'includes/templates/MenuContents.mustache', 'utf8' );
|
||||
const userLinksTemplate = fs.readFileSync( 'includes/templates/UserLinks.mustache', 'utf8' );
|
||||
const userLinksDropdownTemplate = fs.readFileSync( 'includes/templates/UserLinksDropdown.mustache', 'utf8' );
|
||||
const dropdownOpenTemplate = fs.readFileSync( 'includes/templates/Dropdown/Open.mustache', 'utf8' );
|
||||
const dropdownCloseTemplate = fs.readFileSync( 'includes/templates/Dropdown/Close.mustache', 'utf8' );
|
||||
const pinnedContainerOpenTemplate = fs.readFileSync( 'includes/templates/PinnableContainer/Pinned/Open.mustache', 'utf8' );
|
||||
|
@ -16,7 +17,7 @@ const MenuListItem = fs.readFileSync( 'includes/templates/MenuListItem.mustache'
|
|||
|
||||
const templateData = {
|
||||
'is-wide': false,
|
||||
'data-user-menu-overflow': {
|
||||
'data-user-links-overflow-menu': {
|
||||
id: 'p-personal-more',
|
||||
class: 'mw-portlet mw-portlet-vector-user-menu-overflow vector-user-menu-overflow',
|
||||
label: 'Toggle sidebar',
|
||||
|
@ -28,7 +29,7 @@ const templateData = {
|
|||
<li id="pt-watchlist-2" class="user-links-collapsible-item mw-list-item"><a href="/wiki/Special:Watchlist" class="mw-ui-button mw-ui-quiet mw-ui-icon mw-ui-icon-element mw-ui-icon-watchlist mw-ui-icon-wikimedia-watchlist" title="A list of pages you are monitoring for changes [⌃⌥l]" accesskey="l"><span>Watchlist</span></a></li>
|
||||
`
|
||||
},
|
||||
'data-user-menu-dropdown': {
|
||||
'data-user-links-dropdown': {
|
||||
id: 'p-personal',
|
||||
class: 'mw-portlet mw-portlet-personal vector-user-menu vector-user-menu-logged-in vector-menu-dropdown',
|
||||
label: 'Personal tools'
|
||||
|
@ -61,6 +62,7 @@ const templateData = {
|
|||
};
|
||||
|
||||
const dropdownPartials = {
|
||||
UserLinksDropdown: userLinksDropdownTemplate,
|
||||
'Dropdown/Open': dropdownOpenTemplate,
|
||||
'Dropdown/Close': dropdownCloseTemplate,
|
||||
'PinnableContainer/Pinned/Open': pinnedContainerOpenTemplate,
|
||||
|
|
Loading…
Reference in a new issue