diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 56e33ab0..575a66b5 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -226,6 +226,8 @@ SENDING_MAIL: 'The authentication mail is being sent. Please wait a moment...', SIGNIN_ERROR: 'Signin Error!', SIGNUP_ERROR: 'Signup Error!', + SIGNIN_WELCOME_NORMAL: 'Welcome, {{name}}', + SIGNIN_WELCOME_IDLE: 'Welcome, {{name}}, you not login for long time, your account is IDLE status, before download any things, you should active you account again in profile menu "account status"!', NEW_PASSWORD: 'New Password', NP_REQUIRED: 'Enter a new password.', @@ -659,6 +661,8 @@ STATUS: 'Status', NORMAL: 'normal', BANNED: 'banned', + IDLE: 'idle', + ACTIVE: 'Active', INACTIVE: 'inactive', BTN_BAN: 'Ban', BTN_UNBAN: 'Unban', @@ -1224,7 +1228,10 @@ INVALID_USERNAME: 'Invalid username!', INVALID_PASSWORD: 'Invalid password!', YOU_ARE_BANNED: 'You are banned from the server!', - ACCOUNT_IS_NOT_ACTIVATED: 'Your account is not activated, you should active first!' + ACCOUNT_IS_NOT_ACTIVATED: 'Your account is not activated, you should active first!', + ONLY_VIP_CAN_DOWNLOAD: 'This torrent is only for Vip users', + CAN_NOT_DOWNLOAD_BANNED: 'Download failed, you are banned from server', + CAN_NOT_DOWNLOAD_IDLE: 'Download failed, you are idle for long time, before download any things, you should active you account again in profile menu "account status"!' } }; diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 7fc6c60b..9cc92fe6 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -226,6 +226,8 @@ SENDING_MAIL: '正在发送验证邮件,请稍等...', SIGNIN_ERROR: '登录失败!', SIGNUP_ERROR: '注册失败!', + SIGNIN_WELCOME_NORMAL: '欢迎您, {{name}}', + SIGNIN_WELCOME_IDLE: '欢迎您, {{name}}, 您已经很长时间没有你登录, 帐户处于空闲状态, 在您下载任何种子前, 您必须进入帐户状态页再次激活您的帐户!', NEW_PASSWORD: '新密码', NP_REQUIRED: '新密码不能为空.', @@ -659,6 +661,8 @@ STATUS: '帐号状态', NORMAL: '正常', BANNED: '被禁止', + IDLE: '空闲', + ACTIVE: '激活', INACTIVE: '未激活', BTN_BAN: '禁止', BTN_UNBAN: '解禁', @@ -1224,7 +1228,10 @@ INVALID_USERNAME: '无效的用户名!', INVALID_PASSWORD: '无效的密码!', YOU_ARE_BANNED: '您已被服务器禁止(banned)!', - ACCOUNT_IS_NOT_ACTIVATED: '您的帐户未激活, 请激活后再试!' + ACCOUNT_IS_NOT_ACTIVATED: '您的帐户未激活, 请激活后再试!', + ONLY_VIP_CAN_DOWNLOAD: '该种子只有VIP用户才可以下载', + CAN_NOT_DOWNLOAD_BANNED: '下载失败, 您被服务器禁止(banned)', + CAN_NOT_DOWNLOAD_IDLE: '下载失败,您闲置了太长时间,在您下载任何种子前, 您必须进入帐户状态页再次激活您的帐户!' } }; diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less index f8a825d9..8083a108 100644 --- a/modules/core/client/less/mt.less +++ b/modules/core/client/less/mt.less @@ -1606,6 +1606,13 @@ body { } } +.span-idle { + color: @alert-danger-text !important; + h4 { + color: @alert-danger-text !important; + } +} + .maker-list { &:not(:first-child) { &::before { diff --git a/modules/torrents/client/services/torrent-download.client.service.js b/modules/torrents/client/services/torrent-download.client.service.js index 142753e7..078f9742 100644 --- a/modules/torrents/client/services/torrent-download.client.service.js +++ b/modules/torrents/client/services/torrent-download.client.service.js @@ -29,7 +29,19 @@ } }, function (err) { mtDebug.info(err); - NotifycationService.showErrorNotify(err.data.message, 'TORRENT_DOWNLOAD_ERROR'); + switch (err.status) { + case 701: + NotifycationService.showErrorNotify('SERVER.ONLY_VIP_CAN_DOWNLOAD', 'TORRENT_DOWNLOAD_ERROR'); + break; + case 702: + NotifycationService.showErrorNotify('SERVER.CAN_NOT_DOWNLOAD_BANNED', 'TORRENT_DOWNLOAD_ERROR'); + break; + case 703: + NotifycationService.showErrorNotify('SERVER.CAN_NOT_DOWNLOAD_IDLE', 'TORRENT_DOWNLOAD_ERROR'); + break; + default: + NotifycationService.showErrorNotify(err.data.message, 'TORRENT_DOWNLOAD_ERROR'); + } }); } diff --git a/modules/users/client/controllers/authentication.client.controller.js b/modules/users/client/controllers/authentication.client.controller.js index 841ae395..8e0b851d 100644 --- a/modules/users/client/controllers/authentication.client.controller.js +++ b/modules/users/client/controllers/authentication.client.controller.js @@ -119,7 +119,12 @@ vm.authentication.user = response; $rootScope.$broadcast('auth-user-changed'); $rootScope.$broadcast('user-invitations-changed'); - NotifycationService.showNotify('info', null, 'Welcome ' + response.displayName); + if (vm.authentication.user.status === 'normal') { + NotifycationService.showNotify('info', null, $translate.instant('SIGN.SIGNIN_WELCOME_NORMAL', {name: response.displayName})); + } + if (vm.authentication.user.status === 'idle') { + NotifycationService.showNotify('error', null, $translate.instant('SIGN.SIGNIN_WELCOME_IDLE', {name: response.displayName})); + } // And redirect to the previous or home page $state.go($state.previous.state.name || 'home', $state.previous.params); } diff --git a/modules/users/client/views/status/account.client.view.html b/modules/users/client/views/status/account.client.view.html index f44496c0..8f0281d4 100644 --- a/modules/users/client/views/status/account.client.view.html +++ b/modules/users/client/views/status/account.client.view.html @@ -58,6 +58,16 @@ - +