removed add series tab
This commit is contained in:
parent
0d21f34ec5
commit
6e6df842a0
|
@ -31,11 +31,10 @@ namespace NzbDrone.Api.Series
|
|||
|
||||
SharedValidator.RuleFor(s => s.QualityProfileId).ValidId();
|
||||
|
||||
PutValidator.RuleFor(s => s.Path).NotEmpty().When(s => String.IsNullOrEmpty(s.RootFolderPath));
|
||||
PutValidator.RuleFor(s => s.RootFolderPath).NotEmpty().When(s => String.IsNullOrEmpty(s.Path));
|
||||
SharedValidator.RuleFor(s => s.Path).NotEmpty().When(s => String.IsNullOrEmpty(s.RootFolderPath));
|
||||
SharedValidator.RuleFor(s => s.RootFolderPath).NotEmpty().When(s => String.IsNullOrEmpty(s.Path));
|
||||
|
||||
PostValidator.RuleFor(s => s.Title).NotEmpty();
|
||||
PostValidator.RuleFor(s => s.Path).NotEmpty();
|
||||
}
|
||||
|
||||
private Response GetSeries(string slug)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<FileVersion>1</FileVersion>
|
||||
<AutoEnableOnStartup>False</AutoEnableOnStartup>
|
||||
<AllowParallelTestExecution>true</AllowParallelTestExecution>
|
||||
<AllowTestsToRunInParallelWithThemselves>true</AllowTestsToRunInParallelWithThemselves>
|
||||
<FrameworkUtilisationTypeForNUnit>UseDynamicAnalysis</FrameworkUtilisationTypeForNUnit>
|
||||
<FrameworkUtilisationTypeForGallio>Disabled</FrameworkUtilisationTypeForGallio>
|
||||
<FrameworkUtilisationTypeForMSpec>Disabled</FrameworkUtilisationTypeForMSpec>
|
||||
|
|
|
@ -4,7 +4,7 @@ define([
|
|||
'AddSeries/RootFolders/RootFolderCollection',
|
||||
'Quality/QualityProfileCollection',
|
||||
'AddSeries/RootFolders/RootFolderView',
|
||||
'AddSeries/New/AddNewSeriesView',
|
||||
'AddSeries/AddSeriesView',
|
||||
'AddSeries/Existing/ImportSeriesView'
|
||||
],
|
||||
function (app, rootFolderCollection, qualityProfileCollection) {
|
||||
|
@ -12,96 +12,27 @@ define([
|
|||
template: 'AddSeries/addSeriesLayoutTemplate',
|
||||
|
||||
regions: {
|
||||
addNew : '#add-new',
|
||||
importExisting: '#import-existing',
|
||||
rootFolders : '#root-folders'
|
||||
},
|
||||
|
||||
ui: {
|
||||
addNewTab : '.x-add-new-tab',
|
||||
importExistingTab: '.x-import-existing-tab',
|
||||
rootFoldersTab : '.x-root-folders-tab'
|
||||
workspace: '#add-series-workspace'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click .x-add-new-tab' : 'showAddNew',
|
||||
'click .x-import-existing-tab': 'showImport',
|
||||
'click .x-root-folders-tab' : 'showRootFolders'
|
||||
},
|
||||
|
||||
showAddNew: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
this.ui.addNewTab.tab('show');
|
||||
NzbDrone.Router.navigate('series/add/new');
|
||||
},
|
||||
|
||||
showImport: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
this.ui.importExistingTab.tab('show');
|
||||
NzbDrone.Router.navigate('series/add/import');
|
||||
},
|
||||
|
||||
showRootFolders: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
this.ui.rootFoldersTab.tab('show');
|
||||
NzbDrone.Router.navigate('series/add/rootfolders');
|
||||
},
|
||||
|
||||
|
||||
initialize: function (options) {
|
||||
if (options.action) {
|
||||
this.action = options.action.toLowerCase();
|
||||
}
|
||||
'click .x-import': '_importSeries'
|
||||
},
|
||||
|
||||
onRender: function () {
|
||||
|
||||
var self = this;
|
||||
|
||||
rootFolderCollection.fetch({success: function () {
|
||||
self.importExisting.show(new NzbDrone.AddSeries.Existing.RootFolderCompositeView({model: rootFolderCollection.at(0)}));
|
||||
}});
|
||||
/* rootFolderCollection.fetch({success: function () {
|
||||
self.importExisting.show(new NzbDrone.AddSeries.Existing.RootDirListView({model: rootFolderCollection.at(0)}));
|
||||
}});*/
|
||||
qualityProfileCollection.fetch();
|
||||
rootFolderCollection.fetch();
|
||||
|
||||
this.addNew.show(new NzbDrone.AddSeries.New.AddNewSeriesView());
|
||||
this.rootFolders.show(new NzbDrone.AddSeries.RootDirView());
|
||||
|
||||
this.listenTo(rootFolderCollection, 'add', this.evaluateActions, this);
|
||||
this.listenTo(rootFolderCollection, 'remove', this.evaluateActions, this);
|
||||
this.listenTo(rootFolderCollection, 'reset', this.evaluateActions, this);
|
||||
this.workspace.show(new NzbDrone.AddSeries.AddSeriesView());
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
switch (this.action) {
|
||||
case 'import':
|
||||
this.showImport();
|
||||
break;
|
||||
case 'rootfolders':
|
||||
this.showRootFolders();
|
||||
break;
|
||||
default:
|
||||
this.showAddNew();
|
||||
}
|
||||
},
|
||||
|
||||
evaluateActions: function () {
|
||||
if (rootFolderCollection.length === 0) {
|
||||
this.ui.addNewTab.hide();
|
||||
this.ui.importExistingTab.hide();
|
||||
this.showRootFolders();
|
||||
} else {
|
||||
this.ui.addNewTab.show();
|
||||
this.ui.importExistingTab.show();
|
||||
}
|
||||
_importSeries: function () {
|
||||
NzbDrone.modalRegion.show(new NzbDrone.AddSeries.RootFolders.Layout());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<div class="row">
|
||||
<div class="input-prepend nz-input-large add-series-search span11">
|
||||
<i class="add-on icon-search"></i>
|
||||
<input type="text" class="input-block-level x-series-search" placeholder="Start typing the name of series you want to add ...">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div id="search-result" class="result-list span12"/>
|
||||
</div>
|
|
@ -4,12 +4,11 @@ define(['app',
|
|||
'AddSeries/SearchResultView',
|
||||
'Shared/SpinnerView',
|
||||
'AddSeries/Collection'], function () {
|
||||
NzbDrone.AddSeries.New.AddNewSeriesView = Backbone.Marionette.Layout.extend({
|
||||
template: 'AddSeries/New/AddNewSeriesTemplate',
|
||||
route : 'Series/add/new',
|
||||
NzbDrone.AddSeries.AddSeriesView = Backbone.Marionette.Layout.extend({
|
||||
template: 'AddSeries/AddSeriesTemplate',
|
||||
|
||||
ui: {
|
||||
seriesSearch: '.search input'
|
||||
seriesSearch: '.x-series-search'
|
||||
},
|
||||
|
||||
regions: {
|
|
@ -107,21 +107,13 @@ define([
|
|||
}
|
||||
});
|
||||
|
||||
NzbDrone.AddSeries.Existing.RootFolderCompositeView = Backbone.Marionette.CompositeView.extend({
|
||||
NzbDrone.AddSeries.Existing.ListView = Backbone.Marionette.CollectionView.extend({
|
||||
|
||||
template : "AddSeries/Existing/RootFolderCompositeViewTemplate",
|
||||
itemViewContainer: ".x-existing-folder-container",
|
||||
itemView : NzbDrone.AddSeries.Existing.UnmappedFolderCompositeView,
|
||||
itemView: NzbDrone.AddSeries.Existing.UnmappedFolderCompositeView,
|
||||
|
||||
initialize: function () {
|
||||
|
||||
if (!this.model) {
|
||||
throw "model is required.";
|
||||
}
|
||||
|
||||
this.collection = new NzbDrone.AddSeries.Existing.UnmappedFolderCollection();
|
||||
this.refreshItems();
|
||||
this.listenTo(qualityProfileCollection, 'reset', this.refreshItems, this);
|
||||
},
|
||||
|
||||
refreshItems: function () {
|
||||
|
@ -147,5 +139,4 @@ define([
|
|||
}
|
||||
|
||||
});
|
||||
})
|
||||
;
|
||||
});
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<div class="row">
|
||||
<div class="result-list span12 existing-root-folder-view">
|
||||
<h1>{{path}}</h1>
|
||||
|
||||
<div class="x-existing-folder-container"/>
|
||||
</div>
|
||||
</div>
|
|
@ -1,9 +0,0 @@
|
|||
<div class="row">
|
||||
<div class="input-prepend nz-input-large search span11">
|
||||
<i class="add-on icon-search"></i>
|
||||
<input type="text" class="input-block-level" placeholder="Start typing the name of series you want to add ...">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div id="search-result" class="result-list span12"/>
|
||||
</div>
|
|
@ -0,0 +1,15 @@
|
|||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<i class="icon-hdd"/>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="input-prepend input-append x-path">
|
||||
<i class="add-on icon-folder-open"></i>
|
||||
<input class="input-block-level" type="text" placeholder="Path of the folder to add ...">
|
||||
<div class="btn icon-plus btn-success x-add"/>
|
||||
</div>
|
||||
<div class="result-list" id="current-dirs"/>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal">close</button>
|
||||
</div>
|
|
@ -0,0 +1,7 @@
|
|||
<select class="span6 x-root-folder">
|
||||
{{debug}}
|
||||
{{#each this}}
|
||||
<option value="{{id}}">{{path}}</option>
|
||||
{{/each}}
|
||||
<option value="addNew">Add a diffrent path</option>
|
||||
</select>
|
|
@ -1,9 +0,0 @@
|
|||
<div class="tab-pane row" id="root-dir">
|
||||
<div class="input-prepend input-append nz-input-large x-path span10">
|
||||
<i class="add-on icon-folder-open"></i>
|
||||
<input class="input-block-level" type="text" placeholder="Path of the folder to add ...">
|
||||
|
||||
<div class="btn icon-plus btn-success x-add"/>
|
||||
</div>
|
||||
<div class="span12 result-list" id="current-dirs"/>
|
||||
</div>
|
|
@ -0,0 +1,11 @@
|
|||
'use strict';
|
||||
|
||||
define(['app', 'AddSeries/RootFolders/RootFolderCollection'], function (app, rootFolders) {
|
||||
|
||||
Handlebars.registerHelper('rootFolderSelection', function () {
|
||||
//TODO: We should be able to pass in the context, either an object or a property
|
||||
|
||||
var templateFunction = Marionette.TemplateCache.get('AddSeries/RootFolders/RootFolderSelectionTemplate');
|
||||
return new Handlebars.SafeString(templateFunction(rootFolders.toJSON()));
|
||||
});
|
||||
});
|
|
@ -25,9 +25,8 @@ define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'Mixins/AutoComplet
|
|||
className: 'table table-hover'
|
||||
});
|
||||
|
||||
NzbDrone.AddSeries.RootDirView = Backbone.Marionette.Layout.extend({
|
||||
template: 'AddSeries/RootFolders/RootFolderTemplate',
|
||||
route : 'series/add/rootdir',
|
||||
NzbDrone.AddSeries.RootFolders.Layout = Backbone.Marionette.Layout.extend({
|
||||
template: 'AddSeries/RootFolders/LayoutTemplate',
|
||||
|
||||
ui: {
|
||||
pathInput: '.x-path input'
|
||||
|
@ -75,8 +74,6 @@ define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'Mixins/AutoComplet
|
|||
console.log(term);
|
||||
context.collection.fetch({ data: { term: term } });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -19,11 +19,7 @@
|
|||
<icon class="icon-plus"></icon>
|
||||
</div>
|
||||
{{#unless isExisting}}
|
||||
<select class="span6 x-root-folder">
|
||||
{{#each rootFolders.models}}
|
||||
<option value="{{id}}">{{attributes.path}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
{{rootFolderSelection}}
|
||||
{{/unless}}
|
||||
<select class="span2 x-quality-profile pull-right">
|
||||
{{#each qualityProfiles.models}}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
'use strict';
|
||||
define(['app', 'Series/SeriesCollection'], function (app) {
|
||||
define(['app', 'Series/SeriesCollection', 'AddSeries/RootFolders/RootFolderTemplateHelper'], function () {
|
||||
|
||||
NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.ItemView.extend({
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
@import "../shared/Styles/card.less";
|
||||
@import "../shared/Styles/clickable.less";
|
||||
|
||||
.result-list {
|
||||
|
||||
|
@ -13,19 +14,26 @@
|
|||
}
|
||||
}
|
||||
|
||||
.nz-input-large {
|
||||
.add-series-import-btn {
|
||||
margin: 0px 40px;
|
||||
width: 1080px;
|
||||
}
|
||||
|
||||
.add-series-search {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 40px;
|
||||
margin-bottom: 20px;
|
||||
padding-left: 20px;
|
||||
|
||||
*[class*='icon-'] {
|
||||
font-size: 28px;
|
||||
height: 30px;
|
||||
width: 40px;
|
||||
padding-top: 14px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
input {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.folder-name-matches {
|
||||
|
@ -83,13 +91,10 @@
|
|||
}
|
||||
|
||||
.new-series-loadmore {
|
||||
.card;
|
||||
.clickable;
|
||||
font-size: 30px;
|
||||
font-weight: 300;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
background: #fcf8e3;
|
||||
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
|
@ -1,10 +1,7 @@
|
|||
<ul class="nav nav-tabs" id="myTab">
|
||||
<li><a href="#add-new" class="x-add-new-tab">Add New Series</a></li>
|
||||
<li><a href="#import-existing" class="x-import-existing-tab">Import Existing Series</a></li>
|
||||
<li><a href="#root-folders" class="x-root-folders-tab">TV Folders</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane" id="add-new">Add new series.</div>
|
||||
<div class="tab-pane" id="import-existing">Import existing.</div>
|
||||
<div class="tab-pane" id="root-folders">Manage root folders</div>
|
||||
<div class="row">
|
||||
<div class="btn-block btn btn-large add-series-import-btn x-import">
|
||||
<i class="icon-hdd"/> Import existing series on disk
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="add-series-workspace"/>
|
|
@ -0,0 +1,3 @@
|
|||
.clickable {
|
||||
cursor: pointer;
|
||||
}
|
Loading…
Reference in New Issue