mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-23 22:25:14 -04:00
New: Manual Import episodes
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
var Marionette = require('marionette');
|
||||
require('../../Mixins/FileBrowser');
|
||||
|
||||
module.exports = Marionette.ItemView.extend({
|
||||
template : 'ManualImport/Folder/SelectFolderViewTemplate',
|
||||
|
||||
ui : {
|
||||
path : '.x-path',
|
||||
buttons : '.x-button'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click .x-manual-import' : '_manualImport',
|
||||
'click .x-automatic-import' : '_automaticImport',
|
||||
'change .x-path' : '_updateButtons',
|
||||
'keyup .x-path' : '_updateButtons'
|
||||
},
|
||||
|
||||
onRender : function() {
|
||||
this.ui.path.fileBrowser();
|
||||
this._updateButtons();
|
||||
},
|
||||
|
||||
path : function() {
|
||||
return this.ui.path.val();
|
||||
},
|
||||
|
||||
_manualImport : function () {
|
||||
if (this.ui.path.val()) {
|
||||
this.trigger('manualImport', { folder: this.ui.path.val() });
|
||||
}
|
||||
},
|
||||
|
||||
_automaticImport : function () {
|
||||
if (this.ui.path.val()) {
|
||||
this.trigger('automaticImport', { folder: this.ui.path.val() });
|
||||
}
|
||||
},
|
||||
|
||||
_updateButtons : function () {
|
||||
if (this.ui.path.val()) {
|
||||
this.ui.buttons.removeAttr('disabled');
|
||||
}
|
||||
|
||||
else {
|
||||
this.ui.buttons.attr('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
<div class="select-folder">
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<div class="col-md-12">
|
||||
<input type="text" class="form-control x-path" placeholder="Select a folder to import" name="path">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<button class="btn btn-primary btn-lg btn-block x-automatic-import x-button"><i class="icon-sonarr-search-automatic"></i> Import File(s) Automatically</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<button class="btn btn-primary btn-lg btn-block x-manual-import x-button"><i class="icon-sonarr-search-manual"></i> Manual Import</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user