diff --git a/src/Umbraco.Web.UI.Client/src/views/users/user.controller.js b/src/Umbraco.Web.UI.Client/src/views/users/user.controller.js index a9b17998d5..89b1334baf 100644 --- a/src/Umbraco.Web.UI.Client/src/views/users/user.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/users/user.controller.js @@ -66,11 +66,7 @@ vm.user = user; makeBreadcrumbs(vm.user); setUserDisplayState(); - - // format dates to local - if(vm.user.lastLoginDate) { - vm.user.formattedLastLogin = getLocalDate(vm.user.lastLoginDate, "MMMM Do YYYY, HH:mm"); - } + formatDatesToLocal(vm.user); vm.emailIsUsername = user.email === user.username; @@ -89,18 +85,20 @@ } function getLocalDate(date, format) { - var dateVal; - var serverOffset = Umbraco.Sys.ServerVariables.application.serverTimeOffset; - var localOffset = new Date().getTimezoneOffset(); - var serverTimeNeedsOffsetting = (-serverOffset !== localOffset); + if(date) { + var dateVal; + var serverOffset = Umbraco.Sys.ServerVariables.application.serverTimeOffset; + var localOffset = new Date().getTimezoneOffset(); + var serverTimeNeedsOffsetting = (-serverOffset !== localOffset); - if(serverTimeNeedsOffsetting) { - dateVal = dateHelper.convertToLocalMomentTime(date, serverOffset); - } else { - dateVal = moment(date, "YYYY-MM-DD HH:mm:ss"); + if(serverTimeNeedsOffsetting) { + dateVal = dateHelper.convertToLocalMomentTime(date, serverOffset); + } else { + dateVal = moment(date, "YYYY-MM-DD HH:mm:ss"); + } + + return dateVal.format(format); } - - return dateVal.format(format); } function toggleChangePassword() { @@ -128,6 +126,7 @@ vm.user = saved; setUserDisplayState(); + formatDatesToLocal(vm.user); vm.changePasswordModel.isChanging = false; vm.page.saveButtonState = "success"; @@ -380,6 +379,14 @@ vm.user.userDisplayState = usersHelper.getUserStateFromValue(vm.user.userState); } + function formatDatesToLocal(user) { + user.formattedLastLogin = getLocalDate(user.lastLoginDate, "MMMM Do YYYY, HH:mm"); + user.formattedLastLockoutDate = getLocalDate(user.lastLockoutDate, "MMMM Do YYYY, HH:mm"); + user.formattedCreateDate = getLocalDate(user.createDate, "MMMM Do YYYY, HH:mm"); + user.formattedUpdateDate = getLocalDate(user.updateDate, "MMMM Do YYYY, HH:mm"); + user.formattedLastPasswordChangeDate = getLocalDate(user.lastPasswordChangeDate, "MMMM Do YYYY, HH:mm"); + } + init(); } angular.module("umbraco").controller("Umbraco.Editors.Users.UserController", UserEditController); diff --git a/src/Umbraco.Web.UI.Client/src/views/users/user.html b/src/Umbraco.Web.UI.Client/src/views/users/user.html index 88ae4bf46e..99cfcf348f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/users/user.html +++ b/src/Umbraco.Web.UI.Client/src/views/users/user.html @@ -1,9 +1,5 @@
- - -
@@ -17,6 +13,10 @@ + + +
@@ -164,6 +164,7 @@
+
@@ -209,27 +210,8 @@
-
-
- Status:
-
- - {{vm.user.userDisplayState.name}} - -
-
- -
-
- Last login: -
-
- {{ vm.user.formattedLastLogin }} - {{ vm.user.name }} has not logged in yet -
-
- -
+ +
+ +
+
+ Status: +
+
+ + {{vm.user.userDisplayState.name}} + +
+
+ +
+
+ Last login: +
+
+ {{ vm.user.formattedLastLogin }} + {{ vm.user.name | umbWordLimit:1 }} has not logged in yet +
+
+ +
+
+ Failed login attempts: +
+
+ {{ vm.user.failedPasswordAttempts }} +
+
+ +
+
+ Last lockout date: +
+
+ + {{ vm.user.name | umbWordLimit:1 }} hasn't been locked out + + {{ vm.user.formattedLastLockoutDate }} +
+
+ +
+
+ Password is last changed: +
+
+ + The password hasn't been changed + + {{ vm.user.formattedLastPasswordChangeDate }} +
+
+ +
+
+ User is created: +
+
+ {{ vm.user.formattedCreateDate }} +
+
+ +
+
+ User is last updated: +
+
+ {{ vm.user.formattedUpdateDate }} +
+
+
@@ -332,7 +387,8 @@ type="button" action="vm.goToPage(vm.breadcrumbs[0])" label="Return to list" - label-key="buttons_returnToList"> + label-key="buttons_returnToList" + disabled="vm.loading"> + label-key="buttons_save" + disabled="vm.loading"> diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml index e312368270..91d2e42574 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -1588,9 +1588,12 @@ To manage your website, simply open the Umbraco back office and start adding con Access Administrator Category field + User is created Change Your Password Change photo New password + hasn't been locked out + The password hasn't been changed Confirm new password You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button Content Channel @@ -1601,13 +1604,16 @@ To manage your website, simply open the Umbraco back office and start adding con Document Type Editor Excerpt field + Failed login attempts Go to user profile Add groups to assign access and permissions Invite another user Invite new users to give them access to Umbraco. An invite email will be sent to the user with information on how to log in to Umbraco. Language Set the language you will see in menus and dialogs + Last lockout date Last login + Password is last changed Login Media start node Limit the media library to a specific start node @@ -1643,6 +1649,7 @@ To manage your website, simply open the Umbraco back office and start adding con Limit the content tree to a specific start node Content start nodes Limit the content tree to specific start nodes + User is last updated has been created The new user has successfully been created. To log in to Umbraco use the password below. Name