feat(requests): show or hide request desc help tooltip info

This commit is contained in:
OldHawk
2018-01-15 14:40:02 +08:00
parent f04bf5ff8f
commit b35cca2fbf
13 changed files with 271 additions and 21 deletions

View File

@@ -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.',

View File

@@ -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 - 请在发布请求时明确描述您对资源的要求.',

View File

@@ -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');
}
};
}
}());

View File

@@ -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');
}
};
}
}());

View File

@@ -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');
}
};
}
}());

View File

@@ -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');
}
};
}
}());

View File

@@ -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');
}
};
}
}());

View File

@@ -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 {

View File

@@ -21,11 +21,20 @@
{{'REQUESTS.NAV_RES' | translate}}
</a>
</div>
<i class="fa fa-question-circle-o request-help" aria-hidden="true"
title="{{ 'REQUESTS.DESC_HELP_TITLE' | translate}}"
ng-click="vm.onShowHelpClicked();">
</i>
</div>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="requests-desc" ng-bind-html="vm.getRequestsDesc();"></div>
<div class="requests-desc" ng-class="{'panel-collapsed': vm.show_desc_help=='no', 'requests-desc-hide': vm.show_desc_help=='no'}">
<span ng-bind-html="vm.getRequestsDesc();"></span>
<i class="fa fa-close" aria-hidden="true"
title="{{ 'REQUESTS.CLOSE_HELP_TITLE' | translate}}"
ng-click="vm.onCloseHelpClicked();">
</i>
</div>
</div>
</div>
</div>

View File

@@ -21,11 +21,20 @@
{{'REQUESTS.NAV_RES' | translate}}
</a>
</div>
<i class="fa fa-question-circle-o request-help" aria-hidden="true"
title="{{ 'REQUESTS.DESC_HELP_TITLE' | translate}}"
ng-click="vm.onShowHelpClicked();">
</i>
</div>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="requests-desc" ng-bind-html="vm.getRequestsDesc();"></div>
<div class="requests-desc" ng-class="{'panel-collapsed': vm.show_desc_help=='no', 'requests-desc-hide': vm.show_desc_help=='no'}">
<span ng-bind-html="vm.getRequestsDesc();"></span>
<i class="fa fa-close" aria-hidden="true"
title="{{ 'REQUESTS.CLOSE_HELP_TITLE' | translate}}"
ng-click="vm.onCloseHelpClicked();">
</i>
</div>
</div>
</div>
</div>

View File

@@ -21,11 +21,20 @@
{{'REQUESTS.NAV_RES' | translate}}
</a>
</div>
<i class="fa fa-question-circle-o request-help" aria-hidden="true"
title="{{ 'REQUESTS.DESC_HELP_TITLE' | translate}}"
ng-click="vm.onShowHelpClicked();">
</i>
</div>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="requests-desc" ng-bind-html="vm.getRequestsDesc();"></div>
<div class="requests-desc" ng-class="{'panel-collapsed': vm.show_desc_help=='no', 'requests-desc-hide': vm.show_desc_help=='no'}">
<span ng-bind-html="vm.getRequestsDesc();"></span>
<i class="fa fa-close" aria-hidden="true"
title="{{ 'REQUESTS.CLOSE_HELP_TITLE' | translate}}"
ng-click="vm.onCloseHelpClicked();">
</i>
</div>
</div>
</div>
</div>

View File

@@ -21,11 +21,20 @@
{{'REQUESTS.NAV_RES' | translate}}
</a>
</div>
<i class="fa fa-question-circle-o request-help" aria-hidden="true"
title="{{ 'REQUESTS.DESC_HELP_TITLE' | translate}}"
ng-click="vm.onShowHelpClicked();">
</i>
</div>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="requests-desc" ng-bind-html="vm.getRequestsDesc();"></div>
<div class="requests-desc" ng-class="{'panel-collapsed': vm.show_desc_help=='no', 'requests-desc-hide': vm.show_desc_help=='no'}">
<span ng-bind-html="vm.getRequestsDesc();"></span>
<i class="fa fa-close" aria-hidden="true"
title="{{ 'REQUESTS.CLOSE_HELP_TITLE' | translate}}"
ng-click="vm.onCloseHelpClicked();">
</i>
</div>
</div>
</div>
</div>

View File

@@ -1,15 +1,45 @@
<div ng-controller="RequestsViewController as vm" ng-init="vm.init();">
<div class="pagetop">
<div class="container">
<div class="padding-top-30">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="requests-desc" ng-bind-html="vm.getRequestsDesc();"></div>
<div class="padding-top-30 padding-bottom-30 text-center">
<div class="btn-group requests-group">
<a class="btn btn-default btn-width-180"
ui-sref="requests.list">
{{'REQUESTS.NAV_LIST' | translate}}
</a>
<a class="btn btn-default btn-width-180"
ui-sref="requests.add">
{{'REQUESTS.NAV_ADD' | translate}}
</a>
<div class="clearfix visible-xxs-block "></div>
<a class="btn btn-default btn-width-180"
ui-sref="requests.my">
{{'REQUESTS.NAV_MY' | translate}}
</a>
<a class="btn btn-default btn-width-180"
ui-sref="requests.res">
{{'REQUESTS.NAV_RES' | translate}}
</a>
</div>
<i class="fa fa-question-circle-o request-help" aria-hidden="true"
title="{{ 'REQUESTS.DESC_HELP_TITLE' | translate}}"
ng-click="vm.onShowHelpClicked();">
</i>
</div>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="requests-desc" ng-class="{'panel-collapsed': vm.show_desc_help=='no', 'requests-desc-hide': vm.show_desc_help=='no'}">
<span ng-bind-html="vm.getRequestsDesc();"></span>
<i class="fa fa-close" aria-hidden="true"
title="{{ 'REQUESTS.CLOSE_HELP_TITLE' | translate}}"
ng-click="vm.onCloseHelpClicked();">
</i>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="margin-bottom-10 margin-top-10">
<div class="row">