diff --git a/config/env/torrents.js b/config/env/torrents.js index c4410f7b..8b0f458f 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -61,7 +61,8 @@ module.exports = { {name: 'U3/D.5', desc: 'Upload * 3, Download * 0.5'}, {name: 'U3/D.8', desc: 'Upload * 3, Download * 0.8'}, {name: 'U3/D1', desc: 'Upload * 3, Download * 1'} - ] + ], + expires: {size: 1024 * 1024 * 1024, time: 60 * 60 * 1000} }, torrentSalesValue: { global: undefined, diff --git a/modules/core/client/app/trans-string-cn.js b/modules/core/client/app/trans-string-cn.js index cd3b9f99..6bd75c0b 100644 --- a/modules/core/client/app/trans-string-cn.js +++ b/modules/core/client/app/trans-string-cn.js @@ -128,6 +128,8 @@ ATTRIBUTE_TAGS: '视频属性(标签)', VIDEO_NFO: '视频 NFO', VIDEO_SIZE: '视频文件大小', + VIDEO_SALE_INFO: '视频促销信息', + SALE_EXPIRES_TIME: '过期', UPLOAD_SUBTITLE: '上传字幕文件', SUBTITLE_LIST: '字幕列表', SUBTITLE_RULES: { diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 9aca76c4..7f031013 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -128,6 +128,8 @@ ATTRIBUTE_TAGS: 'Video Attribute (tags)', VIDEO_NFO: 'Video NFO', VIDEO_SIZE: 'Video Size', + VIDEO_SALE_INFO: 'Video Sale Info', + SALE_EXPIRES_TIME: 'expires', UPLOAD_SUBTITLE: 'Upload Subtitle file', SUBTITLE_LIST: 'Subtitle list', SUBTITLE_RULES: { diff --git a/modules/core/client/filter/life.client.filter.js b/modules/core/client/filter/life.client.filter.js index 580d938a..cb152f8c 100644 --- a/modules/core/client/filter/life.client.filter.js +++ b/modules/core/client/filter/life.client.filter.js @@ -37,4 +37,38 @@ } }; } + + angular.module('core') + .filter('unlife', unlife); + + unlife.$inject = ['moment']; + + function unlife(moment) { + return function (expires) { + var d = moment(expires).diff(moment(), 'days'); + var h = moment(expires).diff(moment(), 'hours'); + var m = moment(expires).diff(moment(), 'minutes'); + var s = moment(expires).diff(moment(), 'seconds'); + + if (!expires) { + d = 0; + h = 0; + m = 0; + s = 0; + } + + if (d > 0) { + h = h - d * 24; + return d + 'd' + h + 'h'; + } else if (h > 0) { + m = m - h * 60; + return h + 'h' + m + 'm'; + } else if (m > 0) { + s = s - m * 60; + return m + 'm' + s + 's'; + } else { + return s + 's'; + } + }; + } }()); diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less index d243932c..ea4bfaa6 100644 --- a/modules/core/client/less/mt.less +++ b/modules/core/client/less/mt.less @@ -315,6 +315,21 @@ } } +.label-sale { + color: #0366d6; + background-color: #f1f8ff; + &:hover { + cursor: pointer; + color: #f00; + } + &:active { + color: #0366d6; + } + &.used { + background-color: #c9e4ff !important; + } +} + .inline-block { display: inline-block; } diff --git a/modules/torrents/client/views/view-torrent.client.view.html b/modules/torrents/client/views/view-torrent.client.view.html index ea721314..aece5ed2 100644 --- a/modules/torrents/client/views/view-torrent.client.view.html +++ b/modules/torrents/client/views/view-torrent.client.view.html @@ -291,6 +291,17 @@