diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 6046ac1e..6c9f7dc4 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -750,6 +750,8 @@ ACCEPT_SUCCESSFULLY: 'Accept response successfully', ACCEPT_FAILED: 'Accept response failed', RESPONSE_TITLE: 'Response torrent list:', + DESC_HELP_TITLE: 'Show help tooltip', + CLOSE_HELP_TITLE: 'Close help tooltip', DESC_LIST: '### NOTE: \n - The list contains only the last `{{days}}` days of the requests. \n - If your response is accepted, the requestor\'s reward score will be automatically transferred to your account. \n - Only the torrents reviewed by the administrator can be accepted by the requestor. \n - The requester can only accept one of the responses. \n - If your response is complains, your account may be punished, Please respond to the user\'s request carefully.', DESC_MY: '### NOTE: \n - If you accept a response, your reward score will be transferred to the respondent\'s account that you accept. \n - Only the torrents reviewed by the administrator can be accepted by you. \n - You can only accept one of the responses. \n - The request over `{{days}}` days has expired and cannot accept the response, you can only post the request again. \n - If your score is maliciously damaged, please mail to the [administrator](mailto:{{admin}})', DESC_ADD: '### NOTE: \n - Each request will be automatically deducted from `{{add_score}}` points, but your reward score will only be transferred to the responder\'s account that you eventually accept. \n - Only the torrents reviewed by the administrator can be accepted by you. \n - Each request is only valid for `{{days}}` days. After expiry, you can only post the request again. \n - Please give a clear resources description of your request when you post the request.', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 23a5953f..8cd155c9 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -750,6 +750,8 @@ ACCEPT_SUCCESSFULLY: '接受响应成功', ACCEPT_FAILED: '接受响应失败', RESPONSE_TITLE: '响应列表', + DESC_HELP_TITLE: '显示帮助提示', + CLOSE_HELP_TITLE: '关闭帮助提示', DESC_LIST: '### 提示: \n - 此列表只包含最近 `{{days}}` 天内发布的求种请求. \n - 如果你的回应被采纳, 请求者悬赏的积分将自动转入你的帐户. \n - 只有被管理员审核通过的种子才能被请求者接受. \n - 请求者只能接受多个响应中的一个. \n - 如果你的响应被请求者投诉,你的帐号就可能会受到惩罚, 请认真响应用户的请求.', DESC_MY: '### 提示: \n - 如果您接受一个响应, 你的悬赏积分就会转入你接受的响应者的帐户. \n - 只有被管理员审核通过的种子才能被您接受. \n - 您只能接受多个响应中的一个. \n - 超过 `{{days}}` 天的请求已经过期且不能接受响应, 如果需要你只能再次发起请求. \n - 如果您的积分受到恶意损害, 请向管理员[投诉](mailto:{{admin}}).', DESC_ADD: '### 提示: \n - 每发布一个请求会被自动扣除 `{{add_score}}` 积分, 而你的悬赏积分会转入你最终接受的响应者的帐户. \n - 只有被管理员审核通过的种子才能被您接受. \n - 每一个发布的请求只有 `{{days}}` 天的有效期, 过期后你只能再次发起请求. \n - 请在发布请求时明确描述您对资源的要求.', diff --git a/modules/requests/client/controllers/requests-add.client.controller.js b/modules/requests/client/controllers/requests-add.client.controller.js index 379ff4fe..b8086d82 100644 --- a/modules/requests/client/controllers/requests-add.client.controller.js +++ b/modules/requests/client/controllers/requests-add.client.controller.js @@ -6,16 +6,17 @@ .controller('RequestsAddController', RequestsAddController); RequestsAddController.$inject = ['$scope', '$rootScope', '$state', '$timeout', '$translate', 'Authentication', 'RequestsService', 'ScoreLevelService', 'MeanTorrentConfig', 'DebugConsoleService', - 'NotifycationService', 'marked']; + 'NotifycationService', 'marked', 'localStorageService']; function RequestsAddController($scope, $rootScope, $state, $timeout, $translate, Authentication, RequestsService, ScoreLevelService, MeanTorrentConfig, mtDebug, - NotifycationService, marked) { + NotifycationService, marked, localStorageService) { var vm = this; vm.user = Authentication.user; vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage; vm.requestsConfig = MeanTorrentConfig.meanTorrentConfig.requests; vm.torrentTypeConfig = MeanTorrentConfig.meanTorrentConfig.torrentType; vm.inputLengthConfig = MeanTorrentConfig.meanTorrentConfig.inputLength; + vm.show_desc_help = localStorageService.get('requests_add_show_help') || 'yes'; vm.request = { type: 'movie', @@ -64,5 +65,35 @@ NotifycationService.showErrorNotify(res.data.message, 'REQUESTS.POST_REQUEST_FAILED'); } }; + + /** + * onShowHelpClicked + */ + vm.onShowHelpClicked = function () { + var e = $('.requests-desc'); + + if (e.hasClass('panel-collapsed')) { + e.slideDown(); + e.removeClass('panel-collapsed'); + localStorageService.set('requests_add_show_help', 'yes'); + } else { + e.slideUp(); + e.addClass('panel-collapsed'); + localStorageService.set('requests_add_show_help', 'no'); + } + }; + + /** + * onCloseHelpClicked + */ + vm.onCloseHelpClicked = function () { + var e = $('.requests-desc'); + + if (!e.hasClass('panel-collapsed')) { + e.slideUp(); + e.addClass('panel-collapsed'); + localStorageService.set('requests_add_show_help', 'no'); + } + }; } }()); diff --git a/modules/requests/client/controllers/requests-list.client.controller.js b/modules/requests/client/controllers/requests-list.client.controller.js index 92c23dcb..0ae262af 100644 --- a/modules/requests/client/controllers/requests-list.client.controller.js +++ b/modules/requests/client/controllers/requests-list.client.controller.js @@ -6,15 +6,17 @@ .controller('RequestsListController', RequestsListController); RequestsListController.$inject = ['$scope', '$rootScope', '$state', '$timeout', '$translate', 'Authentication', 'RequestsService', 'ScoreLevelService', 'MeanTorrentConfig', 'DebugConsoleService', - 'NotifycationService', 'uibButtonConfig', 'marked']; + 'NotifycationService', 'uibButtonConfig', 'marked', 'localStorageService']; function RequestsListController($scope, $rootScope, $state, $timeout, $translate, Authentication, RequestsService, ScoreLevelService, MeanTorrentConfig, mtDebug, - NotifycationService, uibButtonConfig, marked) { + NotifycationService, uibButtonConfig, marked, localStorageService) { var vm = this; vm.user = Authentication.user; vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage; vm.requestsConfig = MeanTorrentConfig.meanTorrentConfig.requests; + vm.show_desc_help = localStorageService.get('requests_list_show_help') || 'yes'; + console.log(vm.show_desc_help); /** * getRequestsDesc * @returns {*} @@ -94,5 +96,34 @@ return exp; }; + /** + * onShowHelpClicked + */ + vm.onShowHelpClicked = function () { + var e = $('.requests-desc'); + + if (e.hasClass('panel-collapsed')) { + e.slideDown(); + e.removeClass('panel-collapsed'); + localStorageService.set('requests_list_show_help', 'yes'); + } else { + e.slideUp(); + e.addClass('panel-collapsed'); + localStorageService.set('requests_list_show_help', 'no'); + } + }; + + /** + * onCloseHelpClicked + */ + vm.onCloseHelpClicked = function () { + var e = $('.requests-desc'); + + if (!e.hasClass('panel-collapsed')) { + e.slideUp(); + e.addClass('panel-collapsed'); + localStorageService.set('requests_list_show_help', 'no'); + } + }; } }()); diff --git a/modules/requests/client/controllers/requests-my.client.controller.js b/modules/requests/client/controllers/requests-my.client.controller.js index 091d7594..3840846a 100644 --- a/modules/requests/client/controllers/requests-my.client.controller.js +++ b/modules/requests/client/controllers/requests-my.client.controller.js @@ -6,15 +6,16 @@ .controller('RequestsMyController', RequestsMyController); RequestsMyController.$inject = ['$scope', '$rootScope', '$state', '$timeout', '$translate', 'Authentication', 'RequestsService', 'ScoreLevelService', 'MeanTorrentConfig', 'DebugConsoleService', - 'NotifycationService', 'uibButtonConfig', 'marked']; + 'NotifycationService', 'uibButtonConfig', 'marked', 'localStorageService']; function RequestsMyController($scope, $rootScope, $state, $timeout, $translate, Authentication, RequestsService, ScoreLevelService, MeanTorrentConfig, mtDebug, - NotifycationService, uibButtonConfig, marked) { + NotifycationService, uibButtonConfig, marked, localStorageService) { var vm = this; vm.user = Authentication.user; vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage; vm.requestsConfig = MeanTorrentConfig.meanTorrentConfig.requests; vm.announceConfig = MeanTorrentConfig.meanTorrentConfig.announce; + vm.show_desc_help = localStorageService.get('requests_my_show_help') || 'yes'; /** * getRequestsDesc @@ -97,5 +98,35 @@ return exp; }; + /** + * onShowHelpClicked + */ + vm.onShowHelpClicked = function () { + var e = $('.requests-desc'); + + if (e.hasClass('panel-collapsed')) { + e.slideDown(); + e.removeClass('panel-collapsed'); + localStorageService.set('requests_my_show_help', 'yes'); + } else { + e.slideUp(); + e.addClass('panel-collapsed'); + localStorageService.set('requests_my_show_help', 'no'); + } + }; + + /** + * onCloseHelpClicked + */ + vm.onCloseHelpClicked = function () { + var e = $('.requests-desc'); + + if (!e.hasClass('panel-collapsed')) { + e.slideUp(); + e.addClass('panel-collapsed'); + localStorageService.set('requests_my_show_help', 'no'); + } + }; + } }()); diff --git a/modules/requests/client/controllers/requests-res.client.controller.js b/modules/requests/client/controllers/requests-res.client.controller.js index 7eaba377..c5ae8fb0 100644 --- a/modules/requests/client/controllers/requests-res.client.controller.js +++ b/modules/requests/client/controllers/requests-res.client.controller.js @@ -6,15 +6,16 @@ .controller('RequestsResController', RequestsResController); RequestsResController.$inject = ['$scope', '$rootScope', '$state', '$timeout', '$translate', 'Authentication', 'RequestsService', 'ScoreLevelService', 'MeanTorrentConfig', 'DebugConsoleService', - 'NotifycationService', 'uibButtonConfig', 'marked']; + 'NotifycationService', 'uibButtonConfig', 'marked', 'localStorageService']; function RequestsResController($scope, $rootScope, $state, $timeout, $translate, Authentication, RequestsService, ScoreLevelService, MeanTorrentConfig, mtDebug, - NotifycationService, uibButtonConfig, marked) { + NotifycationService, uibButtonConfig, marked, localStorageService) { var vm = this; vm.user = Authentication.user; vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage; vm.requestsConfig = MeanTorrentConfig.meanTorrentConfig.requests; vm.announceConfig = MeanTorrentConfig.meanTorrentConfig.announce; + vm.show_desc_help = localStorageService.get('requests_res_show_help') || 'yes'; /** * getRequestsDesc @@ -97,5 +98,35 @@ return exp; }; + /** + * onShowHelpClicked + */ + vm.onShowHelpClicked = function () { + var e = $('.requests-desc'); + + if (e.hasClass('panel-collapsed')) { + e.slideDown(); + e.removeClass('panel-collapsed'); + localStorageService.set('requests_res_show_help', 'yes'); + } else { + e.slideUp(); + e.addClass('panel-collapsed'); + localStorageService.set('requests_res_show_help', 'no'); + } + }; + + /** + * onCloseHelpClicked + */ + vm.onCloseHelpClicked = function () { + var e = $('.requests-desc'); + + if (!e.hasClass('panel-collapsed')) { + e.slideUp(); + e.addClass('panel-collapsed'); + localStorageService.set('requests_res_show_help', 'no'); + } + }; + } }()); diff --git a/modules/requests/client/controllers/requests-view.client.controller.js b/modules/requests/client/controllers/requests-view.client.controller.js index 46c7dab4..6de98657 100644 --- a/modules/requests/client/controllers/requests-view.client.controller.js +++ b/modules/requests/client/controllers/requests-view.client.controller.js @@ -9,7 +9,7 @@ 'NotifycationService', '$stateParams', 'marked', 'ModalConfirmService', '$compile', 'DownloadService', 'TorrentGetInfoServices', 'ResourcesTagsServices']; function RequestsViewController($scope, $rootScope, $state, $timeout, $translate, Authentication, RequestsService, localStorageService, MeanTorrentConfig, mtDebug, - NotifycationService, $stateParams, marked, ModalConfirmService, $compile, DownloadService, TorrentGetInfoServices, ResourcesTagsServices) { + NotifycationService, $stateParams, marked, ModalConfirmService, $compile, DownloadService, TorrentGetInfoServices, ResourcesTagsServices,) { var vm = this; vm.user = Authentication.user; vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage; @@ -18,6 +18,7 @@ vm.DLS = DownloadService; vm.TGI = TorrentGetInfoServices; vm.RTS = ResourcesTagsServices; + vm.show_desc_help = localStorageService.get('requests_view_show_help') || 'yes'; vm.searchTags = []; @@ -266,5 +267,35 @@ return exp; }; + + /** + * onShowHelpClicked + */ + vm.onShowHelpClicked = function () { + var e = $('.requests-desc'); + + if (e.hasClass('panel-collapsed')) { + e.slideDown(); + e.removeClass('panel-collapsed'); + localStorageService.set('requests_view_show_help', 'yes'); + } else { + e.slideUp(); + e.addClass('panel-collapsed'); + localStorageService.set('requests_view_show_help', 'no'); + } + }; + + /** + * onCloseHelpClicked + */ + vm.onCloseHelpClicked = function () { + var e = $('.requests-desc'); + + if (!e.hasClass('panel-collapsed')) { + e.slideUp(); + e.addClass('panel-collapsed'); + localStorageService.set('requests_view_show_help', 'no'); + } + }; } }()); diff --git a/modules/requests/client/less/requests.less b/modules/requests/client/less/requests.less index 27b30706..7eb12255 100644 --- a/modules/requests/client/less/requests.less +++ b/modules/requests/client/less/requests.less @@ -27,7 +27,23 @@ } } +.pagetop { + .request-help { + margin-left: 20px; + color: #337ab7; + cursor: pointer; + &:hover { + color: #fff; + } + } +} + +.requests-desc-hide { + display: none; +} + .requests-desc { + position: relative; text-shadow: 0 0 0.1em #000, 0 0 0.1em #000; margin-bottom: 30px; padding: 0 20px 20px; @@ -42,6 +58,15 @@ text-shadow: none; } } + .fa-close { + position: absolute; + top: 20px; + right: 20px; + cursor: pointer; + &:hover { + color: @brand-danger; + } + } } .request-form { diff --git a/modules/requests/client/views/requests-add.client.view.html b/modules/requests/client/views/requests-add.client.view.html index ca2448af..0104b0fc 100644 --- a/modules/requests/client/views/requests-add.client.view.html +++ b/modules/requests/client/views/requests-add.client.view.html @@ -21,11 +21,20 @@ {{'REQUESTS.NAV_RES' | translate}} - + +