mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
added path validation to add series/ recent folders.
This commit is contained in:
parent
bf9946b653
commit
4465d50a31
19 changed files with 146 additions and 88 deletions
|
@ -1,4 +1,4 @@
|
|||
'use strict';
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
|
|
|
@ -7,10 +7,11 @@ define(
|
|||
'AddSeries/RootFolders/Collection',
|
||||
'AddSeries/RootFolders/Model',
|
||||
'Shared/LoadingView',
|
||||
'Mixins/AsValidatedView',
|
||||
'Mixins/AutoComplete'
|
||||
], function (Marionette, RootFolderCollectionView, RootFolderCollection, RootFolderModel, LoadingView) {
|
||||
], function (Marionette, RootFolderCollectionView, RootFolderCollection, RootFolderModel, LoadingView, AsValidatedView) {
|
||||
|
||||
return Marionette.Layout.extend({
|
||||
var layout = Marionette.Layout.extend({
|
||||
template: 'AddSeries/RootFolders/LayoutTemplate',
|
||||
|
||||
ui: {
|
||||
|
@ -55,12 +56,16 @@ define(
|
|||
Path: this.ui.pathInput.val()
|
||||
});
|
||||
|
||||
RootFolderCollection.add(newDir);
|
||||
this.bindToModelValidation(newDir);
|
||||
|
||||
newDir.save().done(function () {
|
||||
RootFolderCollection.add(newDir);
|
||||
self.trigger('folderSelected', {model: newDir});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return AsValidatedView.apply(layout);
|
||||
|
||||
});
|
||||
|
|
|
@ -3,10 +3,13 @@
|
|||
<h3>Select Folder</h3>
|
||||
</div>
|
||||
<div class="modal-body root-folders-modal">
|
||||
<div class="input-prepend input-append x-path">
|
||||
<div class="validation-errors"></div>
|
||||
<div class="input-prepend input-append x-path control-group">
|
||||
<span class="add-on"> <i class="icon-folder-open"></i></span>
|
||||
<input class="span9" type="text" placeholder="Start Typing Folder Path...">
|
||||
<button class="btn btn-success x-add"><i class="icon-ok"/></button>
|
||||
<input class="span9" type="text" validation-name="path" placeholder="Start Typing Folder Path...">
|
||||
<button class="btn btn-success x-add">
|
||||
<i class="icon-ok"/>
|
||||
</button>
|
||||
</div>
|
||||
{{#if items}}
|
||||
<h4>Recent Folders</h4>
|
||||
|
|
|
@ -4,6 +4,7 @@ define(
|
|||
'backbone'
|
||||
], function (Backbone) {
|
||||
return Backbone.Model.extend({
|
||||
urlRoot : window.ApiRoot + '/rootfolder',
|
||||
defaults: {
|
||||
freeSpace: 0
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ define(
|
|||
|
||||
this.listenTo(App.vent, Config.Events.ConfigUpdatedEvent, this._onConfigUpdated);
|
||||
this.listenTo(this.model, 'change', this.render);
|
||||
this.listenTo(RootFolders, 'change', this.render);
|
||||
this.listenTo(RootFolders, 'all', this.render);
|
||||
|
||||
this.rootFolderLayout = new RootFolderLayout();
|
||||
this.listenTo(this.rootFolderLayout, 'folderSelected', this._setRootFolder);
|
||||
|
@ -108,6 +108,7 @@ define(
|
|||
_setRootFolder: function (options) {
|
||||
App.vent.trigger(App.Commands.CloseModalCommand);
|
||||
this.ui.rootFolder.val(options.model.id);
|
||||
this._rootFolderChanged();
|
||||
},
|
||||
|
||||
_addSeries: function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue