parent
8de87bb516
commit
fb53fc68a9
@ -0,0 +1,63 @@
|
|||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="close">×</button>
|
||||||
|
<h3>Delete {{removeCount}} Titles</h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body delete-series-modal">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="form-horizontal">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">Delete all files</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<label class="checkbox toggle well">
|
||||||
|
<input type="checkbox" class="x-delete-files">
|
||||||
|
<p>
|
||||||
|
<span>Yes</span>
|
||||||
|
<span>No</span>
|
||||||
|
</p>
|
||||||
|
<div class="btn slide-button btn-danger"></div>
|
||||||
|
</label>
|
||||||
|
<span class="help-inline-checkbox">
|
||||||
|
<i class="icon-sonarr-form-info" title="Do you want to delete all files from disk?"></i>
|
||||||
|
<i class="icon-sonarr-form-warning" title="This option is irreversible, use with extreme caution!"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-offset-1 col-md-5 delete-files-info x-delete-files-info">
|
||||||
|
{{fileCount}} movie file(s) will be deleted
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-4 control-label">Exclude movies from auto list import?</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<label class="checkbox toggle well">
|
||||||
|
<input type="checkbox" class="x-add-exclusion">
|
||||||
|
<p>
|
||||||
|
<span>Yes</span>
|
||||||
|
<span>No</span>
|
||||||
|
</p>
|
||||||
|
<div class="btn slide-button btn-danger"></div>
|
||||||
|
</label>
|
||||||
|
<span class="help-inline-checkbox">
|
||||||
|
<i class="icon-sonarr-form-info" title="Do you want to prevent these movies from being read during automatic list syncing?"></i>
|
||||||
|
<i class="icon-sonarr-form-info" title="Movies can be removed from the exclusions list via the lists tab in settings."></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<span class="indicator x-indicator">
|
||||||
|
<i class="icon-sonarr-spinner fa-spin" aria-hidden="true"></i>
|
||||||
|
</span>
|
||||||
|
<button class="btn" data-dismiss="modal">Cancel</button>
|
||||||
|
<button class="btn btn-danger x-confirm-delete">Delete</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,60 @@
|
|||||||
|
var vent = require('vent');
|
||||||
|
var Marionette = require('marionette');
|
||||||
|
var Backbone = require('backbone');
|
||||||
|
|
||||||
|
module.exports = Marionette.ItemView.extend({
|
||||||
|
template : 'Movies/Editor/Delete/DeleteSelectedTemplate',
|
||||||
|
|
||||||
|
events : {
|
||||||
|
'click .x-confirm-delete' : 'removeSeries',
|
||||||
|
'change .x-delete-files' : 'changeDeletedFiles'
|
||||||
|
},
|
||||||
|
|
||||||
|
ui : {
|
||||||
|
deleteFiles : '.x-delete-files',
|
||||||
|
deleteFilesInfo : '.x-delete-files-info',
|
||||||
|
indicator : '.x-indicator',
|
||||||
|
addExclusion : '.x-add-exclusion'
|
||||||
|
},
|
||||||
|
|
||||||
|
initialize : function(options) {
|
||||||
|
this.movies = options.movies;
|
||||||
|
this.templateHelpers = {
|
||||||
|
removeCount : this.movies.length,
|
||||||
|
fileCount : _.filter(this.movies, function(m){
|
||||||
|
return m.get("hasFile");
|
||||||
|
}).length
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
removeSeries : function() {
|
||||||
|
var self = this;
|
||||||
|
var deleteFiles = this.ui.deleteFiles.prop('checked');
|
||||||
|
var addExclusion = this.ui.addExclusion.prop('checked');
|
||||||
|
this.ui.indicator.show();
|
||||||
|
var proxy = _.extend(new Backbone.Model(), {
|
||||||
|
id : '',
|
||||||
|
|
||||||
|
url : window.NzbDrone.ApiRoot+'/movie/editor/delete?deleteFiles='+deleteFiles+'&addExclusion='+addExclusion,
|
||||||
|
|
||||||
|
toJSON : function() {
|
||||||
|
return _.pluck(self.movies, "id");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
proxy.save().done(function() {
|
||||||
|
//vent.trigger(vent.Events.SeriesDeleted, { series : self.model });
|
||||||
|
vent.trigger(vent.Commands.CloseModalCommand);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
changeDeletedFiles : function() {
|
||||||
|
var deleteFiles = this.ui.deleteFiles.prop('checked');
|
||||||
|
|
||||||
|
if (deleteFiles) {
|
||||||
|
this.ui.deleteFilesInfo.show();
|
||||||
|
} else {
|
||||||
|
this.ui.deleteFilesInfo.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
Loading…
Reference in new issue