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

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

@ -5,6 +5,7 @@ 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');
@ -30,6 +31,13 @@ module.exports = Marionette.Layout.extend({
RootFolderCollection.fetch().done(function() { RootFolderCollection.fetch().done(function() {
RootFolderCollection.synced = true; RootFolderCollection.synced = true;
}); });
this.templateHelpers = {}
this.listCollection = new ListCollection();
this.templateHelpers.lists = this.listCollection.toJSON();
this.listenTo(this.listCollection, 'all', this._listsUpdated);
this.listCollection.fetch();
}, },
_toggleExisting : function(e) { _toggleExisting : function(e) {
@ -44,6 +52,11 @@ module.exports = Marionette.Layout.extend({
this.workspace.show(new AddMoviesView()); this.workspace.show(new AddMoviesView());
}, },
_listsUpdated : function() {
this.templateHelpers.lists = this.listCollection.toJSON();
this.render();
},
_folderSelected : function(options) { _folderSelected : function(options) {
vent.trigger(vent.Commands.CloseModalCommand); vent.trigger(vent.Commands.CloseModalCommand);
this.workspace.show(new ExistingMoviesCollectionView({ model : options.model })); this.workspace.show(new ExistingMoviesCollectionView({ model : options.model }));

@ -33,6 +33,14 @@
</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> </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