mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 23:55:53 +00:00
Merge "Separate opt out data from sidebar"
This commit is contained in:
commit
3ead4e0aa0
|
@ -139,7 +139,7 @@ class SkinVector extends SkinMustache {
|
|||
|
||||
if ( $skin->getUser()->isLoggedIn() ) {
|
||||
// Note: This data is also passed to legacy template where it is unused.
|
||||
$commonSkinData['data-sidebar']['data-emphasized-sidebar-action'] = [
|
||||
$commonSkinData['data-emphasized-sidebar-action'] = [
|
||||
'href' => SpecialPage::getTitleFor(
|
||||
'Preferences',
|
||||
false,
|
||||
|
|
|
@ -15,23 +15,17 @@ export const SIDEBAR_TEMPLATE_PARTIALS = {
|
|||
Menu: vectorMenuTemplate
|
||||
};
|
||||
|
||||
export const SIDEBAR_DATA = {
|
||||
withNoPortals: {
|
||||
'array-portals-rest': [],
|
||||
'html-logo-attributes': HTML_LOGO_ATTRIBUTES
|
||||
},
|
||||
withPortalsAndOptOut: {
|
||||
'data-portals-first': PORTALS.navigation,
|
||||
export const OPT_OUT_DATA = {
|
||||
'data-emphasized-sidebar-action': {
|
||||
href: '#',
|
||||
'msg-vector-opt-out': 'Switch to old look',
|
||||
'msg-vector-opt-out-tooltip': 'Change your settings to go back to the old look of the skin (legacy Vector)'
|
||||
},
|
||||
'array-portals-rest': [
|
||||
PORTALS.toolbox,
|
||||
PORTALS.otherProjects
|
||||
],
|
||||
'data-portals-languages': PORTALS.langlinks,
|
||||
}
|
||||
};
|
||||
|
||||
export const SIDEBAR_DATA = {
|
||||
withNoPortals: {
|
||||
'array-portals-rest': [],
|
||||
'html-logo-attributes': HTML_LOGO_ATTRIBUTES
|
||||
},
|
||||
withPortals: {
|
||||
|
|
|
@ -11,23 +11,23 @@ import { PERSONAL_MENU_TEMPLATE_DATA, menuTemplate } from './Menu.stories.data';
|
|||
import { pageActionsData, namespaceTabsData } from './MenuTabs.stories.data';
|
||||
import { vectorMenuTemplate, moreData, variantsData } from './MenuDropdown.stories.data';
|
||||
import { searchBoxData, searchBoxTemplate } from './SearchBox.stories.data';
|
||||
import { SIDEBAR_DATA, SIDEBAR_TEMPLATE_PARTIALS,
|
||||
import { SIDEBAR_DATA, SIDEBAR_TEMPLATE_PARTIALS, OPT_OUT_DATA,
|
||||
sidebarLegacyTemplate, sidebarTemplate } from './Sidebar.stories.data';
|
||||
import { FOOTER_TEMPLATE_DATA, FOOTER_TEMPLATE_PARTIALS,
|
||||
footerTemplate } from './Footer.stories.data';
|
||||
import { logoTemplate } from './Logo.stories.data';
|
||||
|
||||
export const NAVIGATION_TEMPLATE_DATA = {
|
||||
loggedInWithVariantsAndOptOut: {
|
||||
loggedInWithVariantsAndOptOut: Object.assign( {}, {
|
||||
'data-personal-menu': PERSONAL_MENU_TEMPLATE_DATA.loggedInWithEcho,
|
||||
'data-namespace-tabs': namespaceTabsData,
|
||||
'data-page-actions': pageActionsData,
|
||||
'data-variants': variantsData,
|
||||
'data-search-box': searchBoxData,
|
||||
'data-sidebar': SIDEBAR_DATA.withPortalsAndOptOut,
|
||||
'data-sidebar': SIDEBAR_DATA.withPortals,
|
||||
'msg-navigation-heading': 'Navigation menu',
|
||||
'html-logo-attributes': `class="mw-wiki-logo" href="/wiki/Main_Page" title="Visit the main page"`
|
||||
},
|
||||
}, OPT_OUT_DATA ),
|
||||
loggedOutWithVariants: {
|
||||
'data-personal-menu': PERSONAL_MENU_TEMPLATE_DATA.loggedOut,
|
||||
'data-namespace-tabs': namespaceTabsData,
|
||||
|
|
Loading…
Reference in a new issue