const mustache = require( 'mustache' );
const fs = require( 'fs' );
const userLinksTemplate = fs.readFileSync( 'includes/templates/UserLinks.mustache', 'utf8' );
const menuTemplate = fs.readFileSync( 'includes/templates/Menu.mustache', 'utf8' );
const templateData = {
'is-wide': false,
'data-user-menu-overflow': {
id: 'p-personal-more',
class: 'mw-portlet mw-portlet-vector-user-menu-overflow vector-user-menu-overflow',
label: 'Toggle sidebar',
'html-items': `
English
Admin
Alerts (0)
Notices (0)
Watchlist
`
},
'data-user-menu': {
id: 'p-personal',
class: 'mw-portlet mw-portlet-personal vector-user-menu vector-user-menu-logged-in vector-menu-dropdown',
label: 'Personal tools',
'html-items': `
Admin
Talk
Sandbox
Preferences
Beta
Watchlist
Uploads
Contributions
Gadget added item
`
}
};
const renderedHTML = mustache.render( userLinksTemplate, templateData, {
Menu: menuTemplate
} );
module.exports = {
userLinksHTML: renderedHTML
};