From 5ff9b41176b63cda12982b41387f2cfb0a127dfc Mon Sep 17 00:00:00 2001 From: OldHawk Date: Mon, 11 Jun 2018 14:29:25 +0800 Subject: [PATCH] feat(torrent): automatic move torrent to vip area when uploader select the source is a vip source --- modules/core/client/app/trans-string-en.js | 3 +++ modules/core/client/app/trans-string-zh-tw.js | 3 +++ modules/core/client/app/trans-string-zh.js | 3 +++ .../client/config/core.client.route-filter.js | 2 ++ .../controllers/uploads.client.controller.js | 23 ++++++++++++++++--- .../views/uploads-torrents.client.view.html | 17 ++++++++++++-- 6 files changed, 46 insertions(+), 5 deletions(-) diff --git a/modules/core/client/app/trans-string-en.js b/modules/core/client/app/trans-string-en.js index 4d329236..18223062 100644 --- a/modules/core/client/app/trans-string-en.js +++ b/modules/core/client/app/trans-string-en.js @@ -575,6 +575,9 @@ SELECT_MAKER_GROUP: '• Please select resources group upload from and anonymous option', MAKER_NULL: 'NULL', UPLOADER_ANONYMOUS: 'Anonymous Upload (The user wont see me as an uploader)', + SELECT_VIP_PROPERTY: '• Please select the VIP property of torrent', + IS_VIP_RESOURCES: 'set VIP property of this torrent', + IS_VIP_RESOURCES_TIP: 'TIP: If this is a VIP resource, please select the button below and the system will automatically assign this resource to the VIP zone.', ANONYMOUS: 'Anonymous', TORRENTS_SUBMIT_UPLOAD: '• Agree the rules and submit your resources', SUBMIT_BUTTON: 'OK, SUBMIT NOW', diff --git a/modules/core/client/app/trans-string-zh-tw.js b/modules/core/client/app/trans-string-zh-tw.js index 362fe4fd..4b431b53 100644 --- a/modules/core/client/app/trans-string-zh-tw.js +++ b/modules/core/client/app/trans-string-zh-tw.js @@ -575,6 +575,9 @@ SELECT_MAKER_GROUP: '• 請選擇您上傳時使用的資源小組', MAKER_NULL: '無', UPLOADER_ANONYMOUS: '匿名上傳(用戶不會看到我是上傳者)', + SELECT_VIP_PROPERTY: '• 请选择是否设置资源的 VIP 属性', + IS_VIP_RESOURCES_TIP: '提示:如果这是一个 VIP 资源,请选中下面的按钮,系统会自动将此资源归入 VIP 专区。', + IS_VIP_RESOURCES: '为此资源设置 VIP 属性', ANONYMOUS: '匿名', TORRENTS_SUBMIT_UPLOAD: '• 同意上傳協議,並提交', SUBMIT_BUTTON: '已備妥,現在提交', diff --git a/modules/core/client/app/trans-string-zh.js b/modules/core/client/app/trans-string-zh.js index 7f656e4e..34d3f991 100644 --- a/modules/core/client/app/trans-string-zh.js +++ b/modules/core/client/app/trans-string-zh.js @@ -575,6 +575,9 @@ SELECT_MAKER_GROUP: '• 请选择您上传时使用的资源小组', MAKER_NULL: '无', UPLOADER_ANONYMOUS: '匿名上传(用户不会看到我是上传者)', + SELECT_VIP_PROPERTY: '• 请选择是否设置资源的 VIP 属性', + IS_VIP_RESOURCES_TIP: '提示:如果这是一个 VIP 资源,请选中下面的按钮,系统会自动将此资源归入 VIP 专区。', + IS_VIP_RESOURCES: '为此资源设置 VIP 属性', ANONYMOUS: '匿名', TORRENTS_SUBMIT_UPLOAD: '• 同意上传协议,并提交', SUBMIT_BUTTON: '已备妥,现在提交', diff --git a/modules/core/client/config/core.client.route-filter.js b/modules/core/client/config/core.client.route-filter.js index 1f264bbf..a0f403d9 100644 --- a/modules/core/client/config/core.client.route-filter.js +++ b/modules/core/client/config/core.client.route-filter.js @@ -14,6 +14,8 @@ function stateChangeStart(event, toState, toParams, fromState, fromParams) { $('.side-background').remove(); $('.textcomplete-dropdown').remove(); + $('#uploaded_popup_wrapper').remove(); + $('#uploaded_popup_background').remove(); // Check authentication before changing state if (toState.data && toState.data.roles && toState.data.roles.length > 0) { var allowed = false; diff --git a/modules/torrents/client/controllers/uploads.client.controller.js b/modules/torrents/client/controllers/uploads.client.controller.js index b632d0a8..1fb97288 100644 --- a/modules/torrents/client/controllers/uploads.client.controller.js +++ b/modules/torrents/client/controllers/uploads.client.controller.js @@ -45,6 +45,7 @@ vm.tags = []; vm.maker = 'NULL'; vm.anonymous = false; + vm.isVipProperty = false; vm.videoNfo = ''; vm.customTorrent = {}; vm.resourceImagesList = []; @@ -413,6 +414,22 @@ return v; } + /** + * selectedTypeRole + * @param type + * @returns {string} + */ + vm.selectedTypeRole = function (type) { + var v = 'user'; + angular.forEach(vm.torrentType.value, function (t) { + if (t.value === type) { + v = t.role; + } + }); + + return v; + }; + /** * getIncludeUploadTemplateID * @param st @@ -609,7 +626,7 @@ maker: vm.maker === 'NULL' ? undefined : vm.maker, torrent_filename: vm.torrentInfo.filename, torrent_type: 'movie', - torrent_vip: isSelectedVipType(vm.selectedType), + torrent_vip: isSelectedVipType(vm.selectedType) || vm.isVipProperty, torrent_tags: t, torrent_nfo: vm.videoNfo, torrent_announce: vm.torrentInfo.announce, @@ -657,7 +674,7 @@ maker: vm.maker === 'NULL' ? undefined : vm.maker, torrent_filename: vm.torrentInfo.filename, torrent_type: 'tvserial', - torrent_vip: isSelectedVipType(vm.selectedType), + torrent_vip: isSelectedVipType(vm.selectedType) || vm.isVipProperty, torrent_seasons: vm.selectedSeasons, torrent_episodes: vm.inputedEpisodes, torrent_tags: t, @@ -726,7 +743,7 @@ maker: vm.maker === 'NULL' ? undefined : vm.maker, torrent_filename: vm.torrentInfo.filename, torrent_type: vm.selectedType, - torrent_vip: isSelectedVipType(vm.selectedType), + torrent_vip: isSelectedVipType(vm.selectedType) || vm.isVipProperty, torrent_tags: t, torrent_nfo: vm.videoNfo, torrent_announce: vm.torrentInfo.announce, diff --git a/modules/torrents/client/views/uploads-torrents.client.view.html b/modules/torrents/client/views/uploads-torrents.client.view.html index 2a89ee01..7a60b4dd 100644 --- a/modules/torrents/client/views/uploads-torrents.client.view.html +++ b/modules/torrents/client/views/uploads-torrents.client.view.html @@ -51,8 +51,8 @@
@@ -85,6 +85,19 @@ +
+ +
+ {{'IS_VIP_RESOURCES_TIP' | translate}} +
+ +
+
+
+