diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 30c55f85..0a15ac4b 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -714,8 +714,8 @@ FORM_REWARDS_MAX_MIN: 'Rewards score numbers must more than {{min}} and less than {{max}}', BTN_SUBMIT_REQUEST: 'Submit Request', NO_MY_REQUESTS: 'You aren’t post any request.', - STATUS_GETTING: 'Getting your requests, please waiting ...', - STATUS_GETTING_ERROR: 'Getting your requests ERROR!', + STATUS_GETTING: 'Getting requests, please waiting ...', + STATUS_GETTING_ERROR: 'Getting requests ERROR!', POST_REQUEST_SUCCESSFULLY: 'Create request successfully', POST_REQUEST_FAILED: 'Create request failed', FIELD_TITLE: 'Title', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 01ebaff3..3ccfdd1c 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -714,8 +714,8 @@ FORM_REWARDS_MAX_MIN: '悬赏积分必须大于 {{min}} 且小于 {{max}}', BTN_SUBMIT_REQUEST: '提交请求', NO_MY_REQUESTS: '您没有提交过任何求种请求.', - STATUS_GETTING: '正在获取您的求种请求, 请稍候 ...', - STATUS_GETTING_ERROR: '获取您的求种请求失败!', + STATUS_GETTING: '正在获取求种请求, 请稍候 ...', + STATUS_GETTING_ERROR: '获取求种请求失败!', POST_REQUEST_SUCCESSFULLY: '创建求种请求成功!', POST_REQUEST_FAILED: '创建求种请求失败!', FIELD_TITLE: '求种标题', diff --git a/modules/requests/client/controllers/requests-list.client.controller.js b/modules/requests/client/controllers/requests-list.client.controller.js index 6d208c61..80e91351 100644 --- a/modules/requests/client/controllers/requests-list.client.controller.js +++ b/modules/requests/client/controllers/requests-list.client.controller.js @@ -5,10 +5,10 @@ .module('requests') .controller('RequestsListController', RequestsListController); - RequestsListController.$inject = ['$scope', '$rootScope', '$state', '$timeout', '$translate', 'Authentication', 'UsersService', 'ScoreLevelService', 'MeanTorrentConfig', 'DebugConsoleService', + RequestsListController.$inject = ['$scope', '$rootScope', '$state', '$timeout', '$translate', 'Authentication', 'RequestsService', 'ScoreLevelService', 'MeanTorrentConfig', 'DebugConsoleService', 'NotifycationService', 'uibButtonConfig', 'marked']; - function RequestsListController($scope, $rootScope, $state, $timeout, $translate, Authentication, UsersService, ScoreLevelService, MeanTorrentConfig, mtDebug, + function RequestsListController($scope, $rootScope, $state, $timeout, $translate, Authentication, RequestsService, ScoreLevelService, MeanTorrentConfig, mtDebug, NotifycationService, uibButtonConfig, marked) { var vm = this; vm.user = Authentication.user; @@ -44,7 +44,7 @@ vm.figureOutItemsToDisplay = function (callback) { vm.getRequests(vm.currentPage, function (items) { vm.filterLength = items.total; - vm.pagedItems = items; + vm.pagedItems = items.rows; if (callback) callback(); }); @@ -54,24 +54,18 @@ * getRequests */ vm.getRequests = function (p, callback) { - vm.statusMsg = 'FOLLOW.STATUS_GETTING'; + vm.statusMsg = 'REQUESTS.STATUS_GETTING'; - UsersService.getMyFollowers({ + RequestsService.get({ skip: (p - 1) * vm.itemsPerPage, limit: vm.itemsPerPage - }) - .then(onSuccess) - .catch(onError); - - function onSuccess(data) { + }, function (data) { vm.statusMsg = undefined; mtDebug.info(data); callback(data); - } - - function onError(data) { - vm.statusMsg = 'FOLLOW.STATUS_GETTING_ERROR'; - } + }, function (res) { + vm.statusMsg = 'REQUESTS.STATUS_GETTING_ERROR'; + }); }; /** diff --git a/modules/requests/client/views/requests-list.client.view.html b/modules/requests/client/views/requests-list.client.view.html index 86e2bd8a..560c8e76 100644 --- a/modules/requests/client/views/requests-list.client.view.html +++ b/modules/requests/client/views/requests-list.client.view.html @@ -1,4 +1,4 @@ -
| {{ 'REQUESTS.FIELD_TITLE' | translate}} | +{{ 'REQUESTS.FIELD_TYPE' | translate}} | +{{ 'REQUESTS.FIELD_CREATEDAT' | translate}} | +{{ 'REQUESTS.FIELD_REWARDS' | translate}} | +{{ 'REQUESTS.FIELD_USER' | translate}} | +
|---|---|---|---|---|
+ + {{item.title}} ++{{item.desc}}
+ |
+ {{'MENU_TORRENTS_SUB.'+item.type.toUpperCase() | translate}} | +{{item.createdAt | date: 'yyyy-MM-dd HH:mm:ss'}} | +{{item.rewards}} | ++ + | +