From 36c8ecb98c2f12e77438fd909eaf559c8db65910 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Fri, 22 Sep 2017 16:02:04 +0800 Subject: [PATCH] feat(torrents): add torrent type configure item 'uploadTemplateID' --- config/env/torrents.js | 21 +- .../controllers/uploads.client.controller.js | 15 ++ .../views/uploads-torrents.client.view.html | 181 +++++++++++------- 3 files changed, 144 insertions(+), 73 deletions(-) diff --git a/config/env/torrents.js b/config/env/torrents.js index 18003e45..1894279d 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -258,7 +258,8 @@ module.exports = { state: 'torrents.movie', url: '/movie', divider: false, - position: 1 + position: 1, + uploadTemplateID: 'movie' }, { enable: true, @@ -268,7 +269,8 @@ module.exports = { state: 'torrents.tvserial', url: '/tv', divider: false, - position: 2 + position: 2, + uploadTemplateID: 'tvserial' }, { enable: true, @@ -278,7 +280,8 @@ module.exports = { state: 'torrents.music', url: '/music', divider: false, - position: 3 + position: 3, + uploadTemplateID: 'music' }, { enable: true, @@ -288,7 +291,8 @@ module.exports = { state: 'torrents.variety', url: '/variety', divider: false, - position: 4 + position: 4, + uploadTemplateID: 'variety' }, { enable: true, @@ -298,7 +302,8 @@ module.exports = { state: 'torrents.software', url: '/software', divider: true, - position: 4 + position: 4, + uploadTemplateID: 'default' }, { enable: true, @@ -308,7 +313,8 @@ module.exports = { state: 'torrents.ebook', url: '/ebook', divider: false, - position: 4 + position: 4, + uploadTemplateID: 'default' }, { enable: true, @@ -318,7 +324,8 @@ module.exports = { state: 'torrents.other', url: '/other', divider: true, - position: 5 + position: 5, + uploadTemplateID: 'default' } ] }, diff --git a/modules/torrents/client/controllers/uploads.client.controller.js b/modules/torrents/client/controllers/uploads.client.controller.js index 3fd83b62..d0e334a5 100644 --- a/modules/torrents/client/controllers/uploads.client.controller.js +++ b/modules/torrents/client/controllers/uploads.client.controller.js @@ -129,6 +129,21 @@ vm.showAgreeAndSubmit = false; }; + /** + * getIncludeUploadTemplateID + * @param st + */ + vm.getIncludeUploadTemplateID = function (st) { + var inc = 'default'; + angular.forEach(vm.torrentType.value, function (tc) { + if (tc.value === st) { + inc = tc.uploadTemplateID; + } + }); + + return inc; + }; + /** * getMovieInfo * @param tmdbid diff --git a/modules/torrents/client/views/uploads-torrents.client.view.html b/modules/torrents/client/views/uploads-torrents.client.view.html index cab400b5..014ffb26 100644 --- a/modules/torrents/client/views/uploads-torrents.client.view.html +++ b/modules/torrents/client/views/uploads-torrents.client.view.html @@ -52,55 +52,7 @@ -
- -
-
- -
-
-
{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}:
-
- -
-
- -
- -
-
{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}:
-
- -
-
-
-
-
- - {{ 'CLEAR_ALL_CONDITION' | translate}} - -
-
-
-
-
- -
-
- -
- -
-
-
+
@@ -124,11 +76,9 @@
- + *********************************************************************** --> - + *********************************************************************** --> - + *********************************************************************** --> - + + -