From 201d54d18a5f6858f5dd9aefdf3d686d774b2300 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Wed, 13 Sep 2017 15:05:28 +0800 Subject: [PATCH] feat(users): show invited_by user info in account status center and admin manage page --- modules/core/client/app/trans-string-en.js | 1 + modules/core/client/app/trans-string-zh.js | 1 + .../controllers/userinfo/userinfo.client.controller.js | 2 +- .../users/client/views/admin/view-user.client.view.html | 8 ++++++++ .../users/client/views/status/account.client.view.html | 8 ++++++++ .../users/client/views/userinfo/userinfo.client.view.html | 8 ++++++++ .../users/server/controllers/admin.server.controller.js | 4 +--- 7 files changed, 28 insertions(+), 4 deletions(-) diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 210dbdb3..6efc3226 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -437,6 +437,7 @@ FIRST_NAME: 'First name', LAST_NAME: 'Last name', DISPLAY_NAME: 'Display name', + INVITED_BY: 'Invited by', EMAIL: 'Email', PASSKEY: 'Passkey', ROLE: 'Role', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index c29d29d0..206d206f 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -437,6 +437,7 @@ FIRST_NAME: '姓', LAST_NAME: '名', DISPLAY_NAME: '显示昵称', + INVITED_BY: '邀请发送人', EMAIL: '邮箱', PASSKEY: 'Passkey', ROLE: '用户角色', diff --git a/modules/users/client/controllers/userinfo/userinfo.client.controller.js b/modules/users/client/controllers/userinfo/userinfo.client.controller.js index 7c484914..e1ce656c 100644 --- a/modules/users/client/controllers/userinfo/userinfo.client.controller.js +++ b/modules/users/client/controllers/userinfo/userinfo.client.controller.js @@ -6,7 +6,7 @@ .controller('UserInfoController', UserInfoController); UserInfoController.$inject = ['$scope', '$state', 'Authentication', 'userResolve', 'ScoreLevelService', '$timeout', 'MeanTorrentConfig', - 'DebugConsoleService']; + 'DebugConsoleService']; function UserInfoController($scope, $state, Authentication, user, ScoreLevelService, $timeout, MeanTorrentConfig, mtDebug) { var vm = this; diff --git a/modules/users/client/views/admin/view-user.client.view.html b/modules/users/client/views/admin/view-user.client.view.html index 5560b388..26462730 100644 --- a/modules/users/client/views/admin/view-user.client.view.html +++ b/modules/users/client/views/admin/view-user.client.view.html @@ -39,6 +39,14 @@
{{ 'STATUS_FIELD.DISPLAY_NAME' | translate}}:
{{ vm.user.displayName }}
+
+
{{ 'STATUS_FIELD.INVITED_BY' | translate}}:
+
+ + +
+
+
{{ 'STATUS_FIELD.EMAIL' | translate}}:
{{ vm.user.email }}
diff --git a/modules/users/client/views/status/account.client.view.html b/modules/users/client/views/status/account.client.view.html index 150efa87..18f81d1d 100644 --- a/modules/users/client/views/status/account.client.view.html +++ b/modules/users/client/views/status/account.client.view.html @@ -24,6 +24,14 @@
{{ 'STATUS_FIELD.DISPLAY_NAME' | translate}}:
{{ vm.user.displayName }}
+
+
{{ 'STATUS_FIELD.INVITED_BY' | translate}}:
+
+ + +
+
+
{{ 'STATUS_FIELD.EMAIL' | translate}}:
{{ vm.user.email }}
diff --git a/modules/users/client/views/userinfo/userinfo.client.view.html b/modules/users/client/views/userinfo/userinfo.client.view.html index c993fe8a..eadd1402 100644 --- a/modules/users/client/views/userinfo/userinfo.client.view.html +++ b/modules/users/client/views/userinfo/userinfo.client.view.html @@ -35,6 +35,14 @@
{{ 'STATUS_FIELD.DISPLAY_NAME' | translate}}:
{{ vm.user.displayName }}
+
+
{{ 'STATUS_FIELD.INVITED_BY' | translate}}:
+
+ + +
+
+
{{ 'STATUS_FIELD.EMAIL' | translate}}:
{{ vm.user.email }}
diff --git a/modules/users/server/controllers/admin.server.controller.js b/modules/users/server/controllers/admin.server.controller.js index 5e781ecf..27fe344b 100644 --- a/modules/users/server/controllers/admin.server.controller.js +++ b/modules/users/server/controllers/admin.server.controller.js @@ -349,9 +349,7 @@ exports.userByID = function (req, res, next, id) { }); } - User.findById(id, '-salt -password -providerData') - .populate('invited_by', 'username displayName profileImageURL') - .exec(function (err, user) { + User.findById(id, '-salt -password -providerData').populate('invited_by', 'username displayName profileImageURL').exec(function (err, user) { if (err) { return next(err); } else if (!user) {