U4-10348 Show readonly user profile information on user editor
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
<div ng-controller="Umbraco.Editors.Users.UserController as vm" class="clearfix">
|
||||
|
||||
<umb-load-indicator
|
||||
ng-if="vm.loading">
|
||||
</umb-load-indicator>
|
||||
|
||||
<form name="editUserForm" novalidate val-form-manager>
|
||||
|
||||
<umb-editor-view>
|
||||
@@ -17,6 +13,10 @@
|
||||
|
||||
<umb-editor-container>
|
||||
|
||||
<umb-load-indicator
|
||||
ng-if="vm.loading">
|
||||
</umb-load-indicator>
|
||||
|
||||
<div ng-if="!vm.loading" class="umb-packages-view-wrapper" style="padding: 0;">
|
||||
|
||||
<div class="umb-package-details">
|
||||
@@ -164,6 +164,7 @@
|
||||
|
||||
<div class="umb-package-details__section">
|
||||
|
||||
<!-- Avatar -->
|
||||
<div style="margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #d8d7d9;">
|
||||
<ng-form name="avatarForm" class="flex flex-column justify-center items-center">
|
||||
|
||||
@@ -209,27 +210,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="umb-package-details__information-item">
|
||||
<div class="umb-package-details__information-item-label">
|
||||
<localize key="general_status">Status</localize>:</div>
|
||||
<div class="umb-package-details__information-item-content">
|
||||
<umb-badge style="margin-top: 4px;" size="s" color="{{vm.user.userDisplayState.color}}">
|
||||
{{vm.user.userDisplayState.name}}
|
||||
</umb-badge>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="umb-package-details__information-item">
|
||||
<div class="umb-package-details__information-item-label">
|
||||
<localize key="user_lastLogin">Last login</localize>:
|
||||
</div>
|
||||
<div class="umb-package-details__information-item-content">
|
||||
<span ng-if="vm.user.lastLoginDate">{{ vm.user.formattedLastLogin }}</span>
|
||||
<span ng-if="!vm.user.lastLoginDate">{{ vm.user.name }} <localize key="user_noLogin">has not logged in yet</localize></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 20px;">
|
||||
<!-- Actions -->
|
||||
<div style="margin-bottom: 20px;">
|
||||
|
||||
<div style="margin-bottom: 10px;">
|
||||
<umb-button
|
||||
@@ -304,6 +286,79 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!-- User stats -->
|
||||
<div class="umb-package-details__information-item">
|
||||
<div class="umb-package-details__information-item-label">
|
||||
<localize key="general_status">Status</localize>:
|
||||
</div>
|
||||
<div class="umb-package-details__information-item-content">
|
||||
<umb-badge style="margin-top: 4px;" size="s" color="{{vm.user.userDisplayState.color}}">
|
||||
{{vm.user.userDisplayState.name}}
|
||||
</umb-badge>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="umb-package-details__information-item">
|
||||
<div class="umb-package-details__information-item-label">
|
||||
<localize key="user_lastLogin">Last login</localize>:
|
||||
</div>
|
||||
<div class="umb-package-details__information-item-content">
|
||||
<span ng-if="vm.user.lastLoginDate">{{ vm.user.formattedLastLogin }}</span>
|
||||
<span ng-if="!vm.user.lastLoginDate">{{ vm.user.name | umbWordLimit:1 }} <localize key="user_noLogin">has not logged in yet</localize></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="umb-package-details__information-item">
|
||||
<div class="umb-package-details__information-item-label">
|
||||
<localize key="user_failedPasswordAttempts">Failed login attempts</localize>:
|
||||
</div>
|
||||
<div class="umb-package-details__information-item-content">
|
||||
{{ vm.user.failedPasswordAttempts }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="umb-package-details__information-item">
|
||||
<div class="umb-package-details__information-item-label">
|
||||
<localize key="user_lastLockoutDate">Last lockout date</localize>:
|
||||
</div>
|
||||
<div class="umb-package-details__information-item-content">
|
||||
<span ng-if="vm.user.lastLockoutDate === '0001-01-01T00:00:00'">
|
||||
{{ vm.user.name | umbWordLimit:1 }} <localize key="user_noLockouts">hasn't been locked out</localize>
|
||||
</span>
|
||||
<span ng-if="vm.user.lastLockoutDate !== '0001-01-01T00:00:00'">{{ vm.user.formattedLastLockoutDate }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="umb-package-details__information-item">
|
||||
<div class="umb-package-details__information-item-label">
|
||||
<localize key="user_lastPasswordChangeDate">Password is last changed</localize>:
|
||||
</div>
|
||||
<div class="umb-package-details__information-item-content">
|
||||
<span ng-if="vm.user.lastPasswordChangeDate === '0001-01-01T00:00:00'">
|
||||
<localize key="user_noPasswordChange">The password hasn't been changed</localize>
|
||||
</span>
|
||||
<span ng-if="vm.user.lastPasswordChangeDate !== '0001-01-01T00:00:00'">{{ vm.user.formattedLastPasswordChangeDate }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="umb-package-details__information-item">
|
||||
<div class="umb-package-details__information-item-label">
|
||||
<localize key="user_createDate">User is created</localize>:
|
||||
</div>
|
||||
<div class="umb-package-details__information-item-content">
|
||||
{{ vm.user.formattedCreateDate }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="umb-package-details__information-item">
|
||||
<div class="umb-package-details__information-item-label">
|
||||
<localize key="user_updateDate">User is last updated</localize>:
|
||||
</div>
|
||||
<div class="umb-package-details__information-item-content">
|
||||
{{ vm.user.formattedUpdateDate }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -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">
|
||||
</umb-button>
|
||||
|
||||
<umb-button
|
||||
@@ -342,7 +398,8 @@
|
||||
button-style="success"
|
||||
shortcut="ctrl+s"
|
||||
label="Save"
|
||||
label-key="buttons_save">
|
||||
label-key="buttons_save"
|
||||
disabled="vm.loading">
|
||||
</umb-button>
|
||||
|
||||
</umb-editor-footer-content-right>
|
||||
|
||||
@@ -1588,9 +1588,12 @@ To manage your website, simply open the Umbraco back office and start adding con
|
||||
<key alias="access">Access</key>
|
||||
<key alias="administrators">Administrator</key>
|
||||
<key alias="categoryField">Category field</key>
|
||||
<key alias="createDate">User is created</key>
|
||||
<key alias="changePassword">Change Your Password</key>
|
||||
<key alias="changePhoto">Change photo</key>
|
||||
<key alias="newPassword">New password</key>
|
||||
<key alias="noLockouts">hasn't been locked out</key>
|
||||
<key alias="noPasswordChange">The password hasn't been changed</key>
|
||||
<key alias="confirmNewPassword">Confirm new password</key>
|
||||
<key alias="changePasswordDescription">You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button</key>
|
||||
<key alias="contentChannel">Content Channel</key>
|
||||
@@ -1601,13 +1604,16 @@ To manage your website, simply open the Umbraco back office and start adding con
|
||||
<key alias="documentType">Document Type</key>
|
||||
<key alias="editors">Editor</key>
|
||||
<key alias="excerptField">Excerpt field</key>
|
||||
<key alias="failedPasswordAttempts">Failed login attempts</key>
|
||||
<key alias="goToProfile">Go to user profile</key>
|
||||
<key alias="groupsHelp">Add groups to assign access and permissions</key>
|
||||
<key alias="inviteAnotherUser">Invite another user</key>
|
||||
<key alias="inviteUserHelp">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.</key>
|
||||
<key alias="language">Language</key>
|
||||
<key alias="languageHelp">Set the language you will see in menus and dialogs</key>
|
||||
<key alias="lastLockoutDate">Last lockout date</key>
|
||||
<key alias="lastLogin">Last login</key>
|
||||
<key alias="lastPasswordChangeDate">Password is last changed</key>
|
||||
<key alias="loginname">Login</key>
|
||||
<key alias="mediastartnode">Media start node</key>
|
||||
<key alias="mediastartnodehelp">Limit the media library to a specific start node</key>
|
||||
@@ -1643,6 +1649,7 @@ To manage your website, simply open the Umbraco back office and start adding con
|
||||
<key alias="startnodehelp">Limit the content tree to a specific start node</key>
|
||||
<key alias="startnodes">Content start nodes</key>
|
||||
<key alias="startnodeshelp">Limit the content tree to specific start nodes</key>
|
||||
<key alias="updateDate">User is last updated</key>
|
||||
<key alias="userCreated">has been created</key>
|
||||
<key alias="userCreatedSuccessHelp">The new user has successfully been created. To log in to Umbraco use the password below.</key>
|
||||
<key alias="username">Name</key>
|
||||
|
||||
Reference in New Issue
Block a user