diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 5333340e..582229f0 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -643,6 +643,11 @@ PRESENT_INVITATIONS_SUCCESSFULLY: 'Present invitations successfully', PRESENT_INVITATIONS_FAILED: 'Present invitations failed', + EDIT_USER_SUCCESSFULLY: 'Edit user info successfully', + EDIT_USER_FAILED: 'Edit user info failed', + UPDATE_REMARKS_SUCCESSFULLY: 'Update user remarks successfully', + UPDATE_REMARKS_FAILED: 'Update user remarks failed', + ANNOUNCE_EDIT_TIP: 'Upload a torrent file, automatic replacement Announce URL & Comment', ANNOUNCE_COMMENT: 'Announce Comment', @@ -1010,7 +1015,9 @@ LEECHED_IP: 'Leeched IP list', CURR_SIGNED_IP: 'Current signed IP', CURR_LEECHED_IP: 'Latest leeched IP', - BT_CLIENT: 'Leeched BT Client list' + BT_CLIENT: 'Leeched BT Client list', + ADMIN_REMARKS: 'Admin Remarks', + BTN_SAVE_REMARKS: 'Save remarks' }, TORRENT_TYPE_LABEL: { MOVIE: 'Movie', diff --git a/modules/core/client/app/trans-string-zh-tw.js b/modules/core/client/app/trans-string-zh-tw.js index d5359002..9b9969c6 100644 --- a/modules/core/client/app/trans-string-zh-tw.js +++ b/modules/core/client/app/trans-string-zh-tw.js @@ -643,6 +643,11 @@ PRESENT_INVITATIONS_SUCCESSFULLY: '贈送邀請成功', PRESENT_INVITATIONS_FAILED: '贈送邀請失敗', + EDIT_USER_SUCCESSFULLY: '修改用戶信息成功', + EDIT_USER_FAILED: '修改用戶信息失敗', + UPDATE_REMARKS_SUCCESSFULLY: '更新用戶備註信息成功', + UPDATE_REMARKS_FAILED: '更新用戶備註信息失敗', + ANNOUNCE_EDIT_TIP: '上傳一個種子檔案, 自動替換 Announce URL 與 Comment', ANNOUNCE_COMMENT: 'Announce Comment', @@ -1010,7 +1015,9 @@ LEECHED_IP: '下載過的IP列表', CURR_SIGNED_IP: '當前登入的IP', CURR_LEECHED_IP: '最近一次下載IP', - BT_CLIENT: '下載過的BT客戶端' + BT_CLIENT: '下載過的BT客戶端', + ADMIN_REMARKS: '管理員備註', + BTN_SAVE_REMARKS: '保存備註' }, TORRENT_TYPE_LABEL: { MOVIE: '電影', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 9d2f296a..6e70362d 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -643,6 +643,11 @@ PRESENT_INVITATIONS_SUCCESSFULLY: '赠送邀请成功', PRESENT_INVITATIONS_FAILED: '赠送邀请失败', + EDIT_USER_SUCCESSFULLY: '修改用户信息成功', + EDIT_USER_FAILED: '修改用户信息失败', + UPDATE_REMARKS_SUCCESSFULLY: '更新用户备注信息成功', + UPDATE_REMARKS_FAILED: '更新用户备注信息失败', + ANNOUNCE_EDIT_TIP: '上传一个种子文件, 自动替换 Announce URL 与 Comment', ANNOUNCE_COMMENT: 'Announce Comment', @@ -1010,7 +1015,9 @@ LEECHED_IP: '下载过的IP列表', CURR_SIGNED_IP: '当前登录的IP', CURR_LEECHED_IP: '最近一次下载IP', - BT_CLIENT: '下载过的BT客户端' + BT_CLIENT: '下载过的BT客户端', + ADMIN_REMARKS: '管理员备注', + BTN_SAVE_REMARKS: '保存备注' }, TORRENT_TYPE_LABEL: { MOVIE: '电影', diff --git a/modules/core/client/less/margin.less b/modules/core/client/less/margin.less index 8782910b..0cc2fb16 100644 --- a/modules/core/client/less/margin.less +++ b/modules/core/client/less/margin.less @@ -110,6 +110,10 @@ margin-left: 100px; } +.padding-top-5 { + padding-top: 5px; +} + .padding-top-10 { padding-top: 10px; } @@ -134,6 +138,10 @@ padding-top: 100px; } +.padding-bottom-5 { + padding-bottom: 5px; +} + .padding-bottom-10 { padding-bottom: 10px; } diff --git a/modules/core/server/models/common.server.model.js b/modules/core/server/models/common.server.model.js index d24c7e17..c19f4d7f 100644 --- a/modules/core/server/models/common.server.model.js +++ b/modules/core/server/models/common.server.model.js @@ -77,9 +77,29 @@ var CommentSchema = new Schema({ mongoose.model('Comment', CommentSchema); +/** + * Sub History Schema + */ +var HistorySchema = new Schema({ + event: { + type: String, + default: '', + trim: true + }, + params: { + type: Object + }, + createdAt: { + type: Date + } +}, {usePushEach: true}); + +mongoose.model('History', HistorySchema); + /** * exports */ exports.RatingSchema = RatingSchema; exports.ThumbSchema = ThumbSchema; exports.CommentSchema = CommentSchema; +exports.HistorySchema = HistorySchema; diff --git a/modules/users/client/controllers/admin/user.client.controller.js b/modules/users/client/controllers/admin/user.client.controller.js index c8d6f7bb..a4606995 100644 --- a/modules/users/client/controllers/admin/user.client.controller.js +++ b/modules/users/client/controllers/admin/user.client.controller.js @@ -109,9 +109,9 @@ $state.go('admin.user', { userId: user._id }); - Notification.success({message: ' User saved successfully!'}); - }, function (errorResponse) { - Notification.error({message: errorResponse.data.message, title: ' User update error!'}); + NotifycationService.showSuccessNotify('EDIT_USER_SUCCESSFULLY'); + }, function (res) { + NotifycationService.showErrorNotify(res.data.message, 'EDIT_USER_FAILED'); }); } @@ -453,5 +453,18 @@ NotifycationService.showErrorNotify(response.data.message, 'PRESENT_INVITATIONS_FAILED'); } }; + + /** + * saveRemarks + */ + vm.saveRemarks = function () { + vm.user.$update(function (res) { + vm.user = res; + NotifycationService.showSuccessNotify('UPDATE_REMARKS_SUCCESSFULLY'); + }, function (res) { + NotifycationService.showErrorNotify(res.data.message, 'UPDATE_REMARKS_FAILED'); + }); + + }; } }()); 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 4ae4a5ae..942a18ff 100644 --- a/modules/users/client/views/admin/view-user.client.view.html +++ b/modules/users/client/views/admin/view-user.client.view.html @@ -282,6 +282,19 @@