feat(torrents): add torrent type configure item 'uploadTemplateID'

This commit is contained in:
OldHawk
2017-09-22 16:02:04 +08:00
parent d0869b210a
commit 36c8ecb98c
3 changed files with 144 additions and 73 deletions

View File

@@ -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'
}
]
},

View File

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

View File

@@ -52,55 +52,7 @@
</div>
</div>
<div ng-if="vm.selectedType" ng-include="vm.selectedType"></div>
<div class="row margin-bottom-40" ng-show="vm.showResourcesTag">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="SELECT_TAGS"></legend>
<dl class="dl-horizontal">
<div ng-repeat="item in vm.resourcesTags.radio | filter:vm.selectedType">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<label class="radio-inline" ng-repeat="sitem in item.value">
<input type="radio" class="tradio" name="tag_{{item.name}}" ng-model="vm.tags['tag_'+item.name]"
id="radio_{{item.name}}{{$index}}"
value="{{sitem.name}}"> {{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</label>
</dd>
</div>
<div style="margin-top: 30px;"></div>
<div ng-repeat="item in vm.resourcesTags.checkbox | filter:vm.selectedType">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<label class="checkbox-inline" ng-repeat="sitem in item.value">
<input type="checkbox" class="tcheckbox" ng-model="vm.tags['tag_'+item.name+'_'+sitem.name]"
id="checkbox_{{item.name}}_{{sitem.name}}"
value="{{sitem.name}}"> {{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</label>
</dd>
</div>
<div class="margin-top-10">
<dt class="h-line"></dt>
<dd class="h-line">
<span class="label label-tag text-uppercase" ng-click="vm.clearAllCondition();">
{{ 'CLEAR_ALL_CONDITION' | translate}}
</span>
</dd>
</div>
</dl>
</div>
</div>
<div class="row margin-bottom-40" ng-show="vm.showVideoNfo">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="ENTER_VIDEO_NFO"></legend>
<div class="col-xs-12">
<textarea class="form-control" rows="10" ng-model="vm.videoNfo" style="resize: vertical"></textarea>
</div>
</div>
</div>
<div ng-if="vm.selectedType" ng-include="vm.getIncludeUploadTemplateID(vm.selectedType);"></div>
<div class="row margin-bottom-40 margin-top-50" ng-show="vm.showAgreeAndSubmit">
<div class="col-md-12 col-sm-12 col-xs-12">
@@ -124,11 +76,9 @@
</div>
</div>
<!--
**********************************************************************
<!-- **********************************************************************
ng-template movie.html
**********************************************************************
-->
*********************************************************************** -->
<script type="text/ng-template" id="movie">
<div class="row margin-bottom-40">
<div class="col-md-12 col-sm-12 col-xs-12">
@@ -239,12 +189,58 @@
</div>
</div>
</div>
<div class="row margin-bottom-40" ng-show="vm.showResourcesTag">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="SELECT_TAGS"></legend>
<dl class="dl-horizontal">
<div ng-repeat="item in vm.resourcesTags.radio | filter:vm.selectedType">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<label class="radio-inline" ng-repeat="sitem in item.value">
<input type="radio" class="tradio" name="tag_{{item.name}}" ng-model="vm.tags['tag_'+item.name]"
id="radio_{{item.name}}{{$index}}"
value="{{sitem.name}}"> {{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</label>
</dd>
</div>
<div style="margin-top: 30px;"></div>
<div ng-repeat="item in vm.resourcesTags.checkbox | filter:vm.selectedType">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<label class="checkbox-inline" ng-repeat="sitem in item.value">
<input type="checkbox" class="tcheckbox" ng-model="vm.tags['tag_'+item.name+'_'+sitem.name]"
id="checkbox_{{item.name}}_{{sitem.name}}"
value="{{sitem.name}}"> {{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</label>
</dd>
</div>
<div class="margin-top-10">
<dt class="h-line"></dt>
<dd class="h-line">
<span class="label label-tag text-uppercase" ng-click="vm.clearAllCondition();">
{{ 'CLEAR_ALL_CONDITION' | translate}}
</span>
</dd>
</div>
</dl>
</div>
</div>
<div class="row margin-bottom-40" ng-show="vm.showVideoNfo">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="ENTER_VIDEO_NFO"></legend>
<div class="col-xs-12">
<textarea class="form-control" rows="10" ng-model="vm.videoNfo" style="resize: vertical"></textarea>
</div>
</div>
</div>
</script>
<!--
**********************************************************************
<!-- **********************************************************************
ng-template tvserial.html
**********************************************************************
-->
*********************************************************************** -->
<script type="text/ng-template" id="tvserial">
<div class="row margin-bottom-40">
<div class="col-md-12 col-sm-12 col-xs-12">
@@ -277,6 +273,7 @@
</div>
</div>
</div>
<div ng-show="vm.tmdb_info_ok == true">
<div class="row margin-bottom-40">
<div class="col-md-12 col-sm-12 col-xs-12">
@@ -393,23 +390,75 @@
</div>
</div>
</div>
<div class="row margin-bottom-40" ng-show="vm.showResourcesTag">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="SELECT_TAGS"></legend>
<dl class="dl-horizontal">
<div ng-repeat="item in vm.resourcesTags.radio | filter:vm.selectedType">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<label class="radio-inline" ng-repeat="sitem in item.value">
<input type="radio" class="tradio" name="tag_{{item.name}}" ng-model="vm.tags['tag_'+item.name]"
id="radio_{{item.name}}{{$index}}"
value="{{sitem.name}}"> {{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</label>
</dd>
</div>
<div style="margin-top: 30px;"></div>
<div ng-repeat="item in vm.resourcesTags.checkbox | filter:vm.selectedType">
<dt class="h-line">{{ 'RESOURCESTAGS.'+item.name+'.SELF' | translate}}</dt>
<dd class="h-line">
<label class="checkbox-inline" ng-repeat="sitem in item.value">
<input type="checkbox" class="tcheckbox" ng-model="vm.tags['tag_'+item.name+'_'+sitem.name]"
id="checkbox_{{item.name}}_{{sitem.name}}"
value="{{sitem.name}}"> {{ 'RESOURCESTAGS.' + item.name + '.' + sitem.name | translate}}
</label>
</dd>
</div>
<div class="margin-top-10">
<dt class="h-line"></dt>
<dd class="h-line">
<span class="label label-tag text-uppercase" ng-click="vm.clearAllCondition();">
{{ 'CLEAR_ALL_CONDITION' | translate}}
</span>
</dd>
</div>
</dl>
</div>
</div>
<div class="row margin-bottom-40" ng-show="vm.showVideoNfo">
<div class="col-md-12 col-sm-12 col-xs-12">
<legend class="small-legend" translate="ENTER_VIDEO_NFO"></legend>
<div class="col-xs-12">
<textarea class="form-control" rows="10" ng-model="vm.videoNfo" style="resize: vertical"></textarea>
</div>
</div>
</div>
</script>
<!--
**********************************************************************
<!-- **********************************************************************
ng-template music.html
**********************************************************************
-->
*********************************************************************** -->
<script type="text/ng-template" id="music">
<div>
</div>
</script>
<!--
**********************************************************************
<!-- **********************************************************************
ng-template music.html
*********************************************************************** -->
<script type="text/ng-template" id="variety">
<div>
</div>
</script>
<!-- **********************************************************************
ng-template other.html
**********************************************************************
-->
<script type="text/ng-template" id="other">
*********************************************************************** -->
<script type="text/ng-template" id="default">
<div>
</div>