diff --git a/src/scripts/librarymenu.js b/src/scripts/librarymenu.js index 8ba696ee25..a8c9d99be5 100644 --- a/src/scripts/librarymenu.js +++ b/src/scripts/librarymenu.js @@ -88,9 +88,47 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", " function refreshLibraryInfoInDrawer(user, drawer) { var html = ""; - html += '
', html += '' + globalize.translate("ButtonHome") + "", html += '
', html += '

', html += globalize.translate("sharedcomponents#HeaderMyDownloads"), html += "

", html += '' + globalize.translate("sharedcomponents#Browse") + "", html += '' + globalize.translate("sharedcomponents#Manage") + "", html += "
", html += '
', html += "
"; + html += '
'; + html += '' + globalize.translate("ButtonHome") + ""; + html += '
'; + html += '

'; + html += globalize.translate("sharedcomponents#HeaderMyDownloads"); + html += "

"; + html += '' + globalize.translate("sharedcomponents#Browse") + ""; + html += '' + globalize.translate("sharedcomponents#Manage") + ""; + html += "
"; + html += '
'; + html += "
"; + var localUser = user.localUser; - localUser && localUser.Policy.IsAdministrator && (html += '
', html += '

', html += globalize.translate("HeaderAdmin"), html += "

", html += '' + globalize.translate("ButtonManageServer") + "", html += '' + globalize.translate("MetadataManager") + "", html += "
"), html += '
', user.localUser && (html += '' + globalize.translate("ButtonSettings") + ""), html += '' + globalize.translate("sharedcomponents#Sync") + "", AppInfo.isNativeApp && (html += '' + globalize.translate("ButtonSelectServer") + ""), /* TODO cvium user is always localUser I think */!user.localUser || user.localUser.EnableAutoLogin || (html += '' + globalize.translate("ButtonSignOut") + ""), html += "
", navDrawerScrollContainer.innerHTML = html; + if (localUser && localUser.Policy.IsAdministrator) { + html += '
'; + html += '

'; + html += globalize.translate("HeaderAdmin"); + html += "

"; + html += '' + globalize.translate("ButtonManageServer") + ""; + html += '' + globalize.translate("MetadataManager") + ""; + html += "
" + } + + html += '
'; + if (user.localUser) { + html += '' + globalize.translate("ButtonSettings") + ""; + } + html += '' + globalize.translate("sharedcomponents#Sync") + ""; + if (AppInfo.isNativeApp) { + html += '' + globalize.translate("ButtonSelectServer") + ""; + } + // null check for local user might not be required + if (user.localUser && user.localUser.EnableAutoLogin) { + html += '' + globalize.translate("ButtonSignOut") + ""; + } + html += "
"; + + // add buttons to navigation drawer + navDrawerScrollContainer.innerHTML = html; + + // bind logout button click to method var btnLogout = navDrawerScrollContainer.querySelector(".btnLogout"); btnLogout && btnLogout.addEventListener("click", onLogoutClick) }