diff --git a/dashboard-ui/css/card.css b/dashboard-ui/css/card.css index f14ff89890..b2b4433955 100644 --- a/dashboard-ui/css/card.css +++ b/dashboard-ui/css/card.css @@ -48,6 +48,12 @@ margin: 4px; } +.grayscale { + -webkit-filter: grayscale(100%); + -moz-filter: grayscale(100%); + filter: grayscale(100%); +} + @media all and (max-width: 800px) { .cardBox { @@ -486,7 +492,7 @@ .detailPageSquareCard { - width: 33.33%; + width: 33.33%; } @media all and (min-width: 540px) { @@ -722,4 +728,4 @@ .homePageSmallBackdropCard { width: 12.5%; } -} \ No newline at end of file +} diff --git a/dashboard-ui/css/fonts/gotham-book.woff b/dashboard-ui/css/fonts/gotham-book.woff new file mode 100644 index 0000000000..9b7e60f4c3 Binary files /dev/null and b/dashboard-ui/css/fonts/gotham-book.woff differ diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index a1e2063726..4fe5844dc1 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -566,6 +566,7 @@ a.itemTag:hover { .libraryPanelHeader { margin: 5px 0 15px 0; font-size: 15px; + font-family: Gotham; } .libraryPanelHeader a { diff --git a/dashboard-ui/css/librarymenu.css b/dashboard-ui/css/librarymenu.css index 4955491e1b..2b44988f82 100644 --- a/dashboard-ui/css/librarymenu.css +++ b/dashboard-ui/css/librarymenu.css @@ -135,6 +135,7 @@ padding-left: 0 !important; margin-left: -8px; cursor: default; + font-family: Gotham; } .viewMenuBar { diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index f7829efd56..5aed1f4409 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -61,6 +61,13 @@ src: local('Roboto Bold'), local('Roboto-Bold'), url(fonts/RobotoBold.woff) format('woff'); } +@font-face { + font-family: 'Gotham'; + font-style: normal; + font-weight: 300; + src: local('Gotham'), url(fonts/gotham-book.woff) format('woff'); +} + * { text-shadow: none !important; } @@ -345,7 +352,6 @@ h1 .imageLink { } .page > .ui-content { - /* Need this so that the audio player doesn't cover content, but also for unveil lazy loading. */ padding-bottom: 160px; } diff --git a/dashboard-ui/scripts/useredit.js b/dashboard-ui/scripts/useredit.js index 5bf8147e34..2c201cf939 100644 --- a/dashboard-ui/scripts/useredit.js +++ b/dashboard-ui/scripts/useredit.js @@ -1,6 +1,10 @@ (function ($, window, document) { - function loadUser(page, user, loggedInUser) { + var currentConnectInfo; + + function loadUser(page, user, loggedInUser, connectInfo) { + + currentConnectInfo = connectInfo; if (!loggedInUser.Configuration.IsAdministrator) { @@ -16,6 +20,12 @@ $('.lnkEditUserPreferencesContainer', page).show(); } + if (user.Id && loggedInUser.Configuration.IsAdministrator) { + $('#fldConnectInfo', page).show(); + } else { + $('#fldConnectInfo', page).hide(); + } + if (!loggedInUser.Configuration.IsAdministrator || !user.Id) { $('.lnkEditUserPreferencesContainer', page).hide(); @@ -29,6 +39,7 @@ Dashboard.setPageTitle(user.Name || Globalize.translate('AddUser')); $('#txtUserName', page).val(user.Name); + $('#txtConnectUserName', page).val(connectInfo.Username); $('#chkIsAdmin', page).checked(user.Configuration.IsAdministrator || false).checkboxradio("refresh"); $('#chkBlockNotRated', page).checked(user.Configuration.BlockNotRated || false).checkboxradio("refresh"); @@ -45,19 +56,78 @@ Dashboard.hideLoadingMsg(); } - function onSaveComplete(page) { + function onSaveComplete(page, user) { Dashboard.hideLoadingMsg(); var userId = getParameterByName("userId"); if (userId) { - Dashboard.alert(Globalize.translate('SettingsSaved')); + + var currentConnectUsername = currentConnectInfo.Username || ''; + var enteredConnectUsername = $('#txtConnectUserName', page).val(); + + if (currentConnectUsername == enteredConnectUsername) { + Dashboard.alert(Globalize.translate('SettingsSaved')); + } else { + updateConnectInfo(page, user); + } } else { Dashboard.navigate("userprofiles.html"); } } + function updateConnectInfo(page, user) { + + var currentConnectUsername = currentConnectInfo.Username || ''; + var enteredConnectUsername = $('#txtConnectUserName', page).val(); + + var linkUrl = ApiClient.getUrl('Users/' + user.Id + '/Connect/Link'); + + if (currentConnectUsername && !enteredConnectUsername) { + + // Remove connect info + // Add/Update connect info + ApiClient.ajax({ + + type: "DELETE", + url: linkUrl + + }).done(function () { + + Dashboard.alert(Globalize.translate('SettingsSaved')); + loadData(page); + }); + + } + else if (currentConnectUsername != enteredConnectUsername) { + + // Add/Update connect info + ApiClient.ajax({ + + type: "POST", + url: linkUrl, + data: { + ConnectUsername: enteredConnectUsername + } + + }).done(function () { + + Dashboard.alert({ + + message: Globalize.translate('MessageMediaBrowserAccontAdded'), + title: Globalize.translate('HeaderMediaBrowserAccountAdded'), + + callback: function () { + + loadData(page); + } + + }); + }); + } + } + function saveUser(user, page) { user.Name = $('#txtUserName', page).val(); @@ -78,11 +148,11 @@ if (userId) { ApiClient.updateUser(user).done(function () { - onSaveComplete(page); + onSaveComplete(page, user); }); } else { ApiClient.createUser(user).done(function () { - onSaveComplete(page); + onSaveComplete(page, user); }); } } @@ -97,23 +167,70 @@ Dashboard.showLoadingMsg(); - var userId = getParameterByName("userId"); - - if (!userId) { - saveUser({ - Configuration: {} - }, page); - } else { - ApiClient.getUser(userId).done(function (result) { - saveUser(result, page); - }); - } + getUser().done(function (result) { + saveUser(result, page); + }); // Disable default form submission return false; }; } + function getUser() { + + var userId = getParameterByName("userId"); + + if (userId) { + + return ApiClient.getUser(userId); + } + + var deferred = $.Deferred(); + + deferred.resolveWith(null, [{ + Configuration: { + IsAdministrator: false, + EnableLiveTvManagement: true, + EnableLiveTvAccess: true, + EnableRemoteControlOfOtherUsers: true, + EnableMediaPlayback: true + } + }]); + + return deferred.promise(); + } + + function getConnectUserInfo() { + + var userId = getParameterByName("userId"); + + if (userId) { + + return ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Connect/Info')); + } + + var deferred = $.Deferred(); + + deferred.resolveWith(null, [[{}]]); + + return deferred.promise(); + } + + function loadData(page) { + + Dashboard.showLoadingMsg(); + + var promise1 = getUser(); + var promise2 = Dashboard.getCurrentUser(); + var promise3 = getConnectUserInfo(); + + $.when(promise1, promise2, promise3).done(function (response1, response2, response3) { + + loadUser(page, response1[0] || response1, response2[0], response3[0]); + + }); + } + window.EditUserPage = new editUserPage(); $(document).on('pagebeforeshow', "#editUserPage", function () { @@ -141,39 +258,7 @@ var page = this; - Dashboard.showLoadingMsg(); - - var userId = getParameterByName("userId"); - - var promise1; - - if (!userId) { - - var deferred = $.Deferred(); - - deferred.resolveWith(null, [{ - Configuration: { - IsAdministrator: true, - EnableLiveTvManagement: true, - EnableLiveTvAccess: true, - EnableRemoteControlOfOtherUsers: true, - EnableMediaPlayback: true - } - }]); - - promise1 = deferred.promise(); - } else { - - promise1 = ApiClient.getUser(userId); - } - - var promise2 = Dashboard.getCurrentUser(); - - $.when(promise1, promise2).done(function (response1, response2) { - - loadUser(page, response1[0] || response1, response2[0]); - - }); + loadData(page); $("form input:first", page).focus(); }); diff --git a/dashboard-ui/scripts/userprofilespage.js b/dashboard-ui/scripts/userprofilespage.js index 2729d40102..53bb8e8e7a 100644 --- a/dashboard-ui/scripts/userprofilespage.js +++ b/dashboard-ui/scripts/userprofilespage.js @@ -1,19 +1,63 @@ (function (document, window, $) { - function deleteUser(page, id, name) { + function deleteUser(page, id) { - var msg = Globalize.translate('DeleteUserConfirmation').replace('{0}', name); + $('.userMenu', page).on("popupafterclose.deleteuser", function() { - Dashboard.confirm(msg, Globalize.translate('DeleteUser'), function (result) { + $(this).off('popupafterclose.deleteuser'); - if (result) { - Dashboard.showLoadingMsg(); + var msg = Globalize.translate('DeleteUserConfirmation'); - ApiClient.deleteUser(id).done(function () { + Dashboard.confirm(msg, Globalize.translate('DeleteUser'), function (result) { - loadUsers(page); - }); - } + if (result) { + Dashboard.showLoadingMsg(); + + ApiClient.deleteUser(id).done(function () { + + loadUsers(page); + }); + } + }); + + }).popup('close'); + } + + function closeUserMenu(page) { + $('.userMenu', page).popup('close').remove(); + } + + function showUserMenu(elem) { + + var card = $(elem).parents('.card'); + var page = $(elem).parents('.page'); + var userId = card.attr('data-userid'); + + $('.userMenu', page).popup("close").remove(); + + var html = '
";
- //if (user.HasConfiguredPassword) html += '';
- //if (user.Configuration.IsAdministrator) html += '
';
-
- //html += "