Added easy to use List Selection for manual import use later. The place where this resides will change.

pull/2/head
Leonardo Galli 8 years ago
parent 80e53f209d
commit 8b3b46b724

@ -5,57 +5,70 @@ var RootFolderLayout = require('./RootFolders/RootFolderLayout');
var ExistingMoviesCollectionView = require('./Existing/AddExistingMovieCollectionView'); var ExistingMoviesCollectionView = require('./Existing/AddExistingMovieCollectionView');
var AddMoviesView = require('./AddMoviesView'); var AddMoviesView = require('./AddMoviesView');
var ProfileCollection = require('../Profile/ProfileCollection'); var ProfileCollection = require('../Profile/ProfileCollection');
var ListCollection = require("../Settings/NetImport/NetImportCollection");
var RootFolderCollection = require('./RootFolders/RootFolderCollection'); var RootFolderCollection = require('./RootFolders/RootFolderCollection');
require('../Movies/MoviesCollection'); require('../Movies/MoviesCollection');
module.exports = Marionette.Layout.extend({ module.exports = Marionette.Layout.extend({
template : 'AddMovies/AddMoviesLayoutTemplate', template : 'AddMovies/AddMoviesLayoutTemplate',
regions : { regions : {
workspace : '#add-movies-workspace' workspace : '#add-movies-workspace'
}, },
events : { events : {
'click .x-import' : '_importMovies', 'click .x-import' : '_importMovies',
'click .x-add-new' : '_addMovies', 'click .x-add-new' : '_addMovies',
'click .x-show-existing' : '_toggleExisting' 'click .x-show-existing' : '_toggleExisting'
}, },
attributes : { attributes : {
id : 'add-movies-screen' id : 'add-movies-screen'
}, },
initialize : function() { initialize : function() {
ProfileCollection.fetch(); ProfileCollection.fetch();
RootFolderCollection.fetch().done(function() { RootFolderCollection.fetch().done(function() {
RootFolderCollection.synced = true; RootFolderCollection.synced = true;
}); });
}, this.templateHelpers = {}
this.listCollection = new ListCollection();
_toggleExisting : function(e) { this.templateHelpers.lists = this.listCollection.toJSON();
var showExisting = e.target.checked;
this.listenTo(this.listCollection, 'all', this._listsUpdated);
vent.trigger(vent.Commands.ShowExistingCommand, { this.listCollection.fetch();
showExisting: showExisting
}); },
},
_toggleExisting : function(e) {
onShow : function() { var showExisting = e.target.checked;
this.workspace.show(new AddMoviesView());
}, vent.trigger(vent.Commands.ShowExistingCommand, {
showExisting: showExisting
_folderSelected : function(options) { });
vent.trigger(vent.Commands.CloseModalCommand); },
this.workspace.show(new ExistingMoviesCollectionView({ model : options.model }));
}, onShow : function() {
this.workspace.show(new AddMoviesView());
_importMovies : function() { },
this.rootFolderLayout = new RootFolderLayout();
this.listenTo(this.rootFolderLayout, 'folderSelected', this._folderSelected); _listsUpdated : function() {
AppLayout.modalRegion.show(this.rootFolderLayout); this.templateHelpers.lists = this.listCollection.toJSON();
}, this.render();
},
_addMovies : function() {
this.workspace.show(new AddMoviesView()); _folderSelected : function(options) {
} vent.trigger(vent.Commands.CloseModalCommand);
this.workspace.show(new ExistingMoviesCollectionView({ model : options.model }));
},
_importMovies : function() {
this.rootFolderLayout = new RootFolderLayout();
this.listenTo(this.rootFolderLayout, 'folderSelected', this._folderSelected);
AppLayout.modalRegion.show(this.rootFolderLayout);
},
_addMovies : function() {
this.workspace.show(new AddMoviesView());
}
}); });

@ -1,43 +1,51 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="btn-group add-movies-btn-group btn-group-lg btn-block"> <div class="btn-group add-movies-btn-group btn-group-lg btn-block">
<button type="button" class="btn btn-default col-md-10 col-xs-8 add-movies-import-btn x-import"> <button type="button" class="btn btn-default col-md-10 col-xs-8 add-movies-import-btn x-import">
<i class="icon-sonarr-hdd"/> <i class="icon-sonarr-hdd"/>
Import existing movies on disk Import existing movies on disk
</button> </button>
<button class="btn btn-default col-md-2 col-xs-4 x-add-new"><i class="icon-sonarr-active hidden-xs"></i> Add New Movie</button> <button class="btn btn-default col-md-2 col-xs-4 x-add-new"><i class="icon-sonarr-active hidden-xs"></i> Add New Movie</button>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-horizontal" style="margin-top: 15px;"> <div class="form-horizontal" style="margin-top: 15px;">
<div class="form-group" style="margin-bottom: 0px;"> <div class="form-group" style="margin-bottom: 0px;">
<label class="col-sm-3 control-label">Display Existing Movies</label> <label class="col-sm-3 control-label">Display Existing Movies</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group"> <div class="input-group">
<label class="checkbox toggle well"> <label class="checkbox toggle well">
<input class="x-show-existing" type="checkbox" checked="checked" name="showExisting"/> <input class="x-show-existing" type="checkbox" checked="checked" name="showExisting"/>
<p> <p>
<span>Yes</span> <span>Yes</span>
<span>No</span> <span>No</span>
</p> </p>
<div class="btn btn-primary slide-button"/> <div class="btn btn-primary slide-button"/>
</label> </label>
<span class="help-inline-checkbox"> <span class="help-inline-checkbox">
<i class="icon-sonarr-form-info" title="Should Radarr display movies already in your collection?"/> <i class="icon-sonarr-form-info" title="Should Radarr display movies already in your collection?"/>
</span> </span>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> <div class="form-group" style="margin-bottom: 0px;">
<label class="col-sm-3 control-label">Lists</label>
<div class="col-sm-8">
{{> ListSelectionPartial lists}}
</div>
</div>
</div>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div id="add-movies-workspace"></div> <div id="add-movies-workspace"></div>
</div> </div>
</div> </div>

@ -0,0 +1,10 @@
<select class="col-md-4 form-control x-root-folder" validation-name="RootFolderPath">
{{#if this}}
{{#each this}}
<option value="{{id}}">{{name}}</option>
{{/each}}
{{else}}
<option value="">Select List</option>
{{/if}}
<option value="addNew">Add a new list</option>
</select>
Loading…
Cancel
Save