mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-23 14:55:20 -07:00
Added easy to use List Selection for manual import use later. The place where this resides will change.
This commit is contained in:
parent
80e53f209d
commit
8b3b46b724
3 changed files with 105 additions and 74 deletions
|
@ -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();
|
||||||
|
this.templateHelpers.lists = this.listCollection.toJSON();
|
||||||
|
|
||||||
_toggleExisting : function(e) {
|
this.listenTo(this.listCollection, 'all', this._listsUpdated);
|
||||||
var showExisting = e.target.checked;
|
this.listCollection.fetch();
|
||||||
|
|
||||||
vent.trigger(vent.Commands.ShowExistingCommand, {
|
},
|
||||||
showExisting: showExisting
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
onShow : function() {
|
_toggleExisting : function(e) {
|
||||||
this.workspace.show(new AddMoviesView());
|
var showExisting = e.target.checked;
|
||||||
},
|
|
||||||
|
|
||||||
_folderSelected : function(options) {
|
vent.trigger(vent.Commands.ShowExistingCommand, {
|
||||||
vent.trigger(vent.Commands.CloseModalCommand);
|
showExisting: showExisting
|
||||||
this.workspace.show(new ExistingMoviesCollectionView({ model : options.model }));
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_importMovies : function() {
|
onShow : function() {
|
||||||
this.rootFolderLayout = new RootFolderLayout();
|
this.workspace.show(new AddMoviesView());
|
||||||
this.listenTo(this.rootFolderLayout, 'folderSelected', this._folderSelected);
|
},
|
||||||
AppLayout.modalRegion.show(this.rootFolderLayout);
|
|
||||||
},
|
|
||||||
|
|
||||||
_addMovies : function() {
|
_listsUpdated : function() {
|
||||||
this.workspace.show(new AddMoviesView());
|
this.templateHelpers.lists = this.listCollection.toJSON();
|
||||||
}
|
this.render();
|
||||||
|
},
|
||||||
|
|
||||||
|
_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>
|
||||||
|
|
10
src/UI/Settings/NetImport/ListSelectionPartial.hbs
Normal file
10
src/UI/Settings/NetImport/ListSelectionPartial.hbs
Normal file
|
@ -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…
Add table
Add a link
Reference in a new issue