mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 07:43:47 +00:00
34344adbf5
- Adds html-before-portlet to Menu.mustache
- Removes UserMenu.mustache and type def
- Factors out getCreateAccountHTML and getLoginHTML for generating HTML used in Menu
- Scopes UserLink template data under "data-vector-user-links"
Follow up to: 298f945983
Bug: T284584
Change-Id: I91104eb7c4fd12756e770561666f4c9a64da57d6
57 lines
1.3 KiB
JavaScript
57 lines
1.3 KiB
JavaScript
import mustache from 'mustache';
|
|
import { menuTemplate } from './Menu.stories.data';
|
|
import { PERSONAL_MENU_TEMPLATE_DATA, USER_LINKS_LOGGED_IN_TEMPLATE_DATA, USER_LINKS_LOGGED_OUT_TEMPLATE_DATA } from './UserLinks.stories.data';
|
|
import { userLinksTemplateLegacy, userLinksTemplate } from './UserLinks.stories.data';
|
|
import '../resources/skins.vector.styles.legacy/components/UserLinks.less';
|
|
import '../resources/skins.vector.styles/components/UserLinks.less';
|
|
|
|
export default {
|
|
title: 'UserLinks'
|
|
};
|
|
|
|
export const legacyLoggedOut = () => mustache.render(
|
|
userLinksTemplateLegacy,
|
|
{
|
|
'data-personal': PERSONAL_MENU_TEMPLATE_DATA.loggedOut
|
|
},
|
|
{
|
|
Menu: menuTemplate
|
|
}
|
|
);
|
|
|
|
export const legacyLoggedInWithEcho = () => mustache.render(
|
|
userLinksTemplateLegacy,
|
|
{
|
|
'data-personal': PERSONAL_MENU_TEMPLATE_DATA.loggedInWithEcho
|
|
},
|
|
{
|
|
Menu: menuTemplate
|
|
}
|
|
);
|
|
|
|
export const legacyLoggedInWithULS = () => mustache.render(
|
|
userLinksTemplateLegacy,
|
|
{
|
|
'data-personal': PERSONAL_MENU_TEMPLATE_DATA.loggedInWithULS
|
|
},
|
|
{
|
|
Menu: menuTemplate
|
|
}
|
|
);
|
|
|
|
export const loggedInUserLinks = () => mustache.render(
|
|
userLinksTemplate,
|
|
USER_LINKS_LOGGED_IN_TEMPLATE_DATA,
|
|
{
|
|
Menu: menuTemplate
|
|
}
|
|
);
|
|
|
|
export const loggedOutUserLinks = () => mustache.render(
|
|
userLinksTemplate,
|
|
USER_LINKS_LOGGED_OUT_TEMPLATE_DATA,
|
|
{
|
|
Menu: menuTemplate
|
|
}
|
|
);
|