parent
f6a37186aa
commit
40809f1d91
@ -0,0 +1,50 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>Delete {{title}}</h3>
|
||||
</div>
|
||||
<div class="modal-body delete-series-modal">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-3 hidden-xs">
|
||||
{{poster}}
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<div class="form-horizontal">
|
||||
<h3 class="path">{{path}}</h3>
|
||||
|
||||
<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"/>
|
||||
</label>
|
||||
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-sonarr-form-info" title="Do you want to delete all files from disk?"/>
|
||||
<i class="icon-sonarr-form-warning" title="This option is irreversible, use with extreme caution"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-offset-1 col-md-5 delete-files-info x-delete-files-info">
|
||||
{{#if hasFile}}1{{#else}}0{{/if}} movie file(s) will be deleted
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<span class="indicator x-indicator"><i class="icon-sonarr-spinner fa-spin"></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,41 @@
|
||||
var vent = require('vent');
|
||||
var Marionette = require('marionette');
|
||||
|
||||
module.exports = Marionette.ItemView.extend({
|
||||
template : 'Movies/Delete/DeleteMovieTemplate',
|
||||
|
||||
events : {
|
||||
'click .x-confirm-delete' : 'removeSeries',
|
||||
'change .x-delete-files' : 'changeDeletedFiles'
|
||||
},
|
||||
|
||||
ui : {
|
||||
deleteFiles : '.x-delete-files',
|
||||
deleteFilesInfo : '.x-delete-files-info',
|
||||
indicator : '.x-indicator'
|
||||
},
|
||||
|
||||
removeSeries : function() {
|
||||
var self = this;
|
||||
var deleteFiles = this.ui.deleteFiles.prop('checked');
|
||||
this.ui.indicator.show();
|
||||
|
||||
this.model.destroy({
|
||||
data : { 'deleteFiles' : deleteFiles },
|
||||
wait : true
|
||||
}).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