mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
moved add series to require.
This commit is contained in:
parent
24c77b4047
commit
72772bed5a
16 changed files with 181 additions and 185 deletions
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
define(
|
||||
[
|
||||
'App',
|
||||
'app',
|
||||
'backbone',
|
||||
'Series/SeriesModel'
|
||||
], function (App, Backbone, SeriesModel) {
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
"use strict";
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'backbone',
|
||||
'AddSeries/RootFolders/Model',
|
||||
'mixins/backbone.signalr.mixin'
|
||||
], function () {
|
||||
], function (Backbone, RootFolderModel) {
|
||||
|
||||
var rootFolderCollection = Backbone.Collection.extend({
|
||||
url : NzbDrone.Constants.ApiRoot + '/rootfolder',
|
||||
model: NzbDrone.AddSeries.RootFolders.RootFolderModel
|
||||
model: RootFolderModel
|
||||
});
|
||||
|
||||
return new rootFolderCollection().BindSignalR();
|
||||
var collection = new rootFolderCollection().BindSignalR();
|
||||
|
||||
return collection;
|
||||
});
|
||||
|
|
|
@ -4,8 +4,8 @@ define(
|
|||
[
|
||||
'marionette',
|
||||
'AddSeries/RootFolders/CollectionView',
|
||||
'AddSeries/RootFolders/Model',
|
||||
'AddSeries/RootFolders/Collection',
|
||||
'AddSeries/RootFolders/Model',
|
||||
'Mixins/AutoComplete'
|
||||
], function (Marionette, RootFolderCollectionView, RootFolderCollection, RootFolderModel) {
|
||||
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
"use strict";
|
||||
define(['app'], function () {
|
||||
NzbDrone.AddSeries.RootFolders.RootFolderModel = Backbone.Model.extend({
|
||||
mutators: {
|
||||
freeSpaceString: function () {
|
||||
return this.get('freeSpace').bytes(2) + " Free";
|
||||
}
|
||||
},
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'sugar'
|
||||
], function (Backbone) {
|
||||
return Backbone.Model.extend({
|
||||
mutators: {
|
||||
freeSpaceString: function () {
|
||||
return this.get('freeSpace').bytes(2) + " Free";
|
||||
}
|
||||
},
|
||||
|
||||
defaults: {
|
||||
freeSpace: 0
|
||||
}
|
||||
defaults: {
|
||||
freeSpace: 0
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -3,4 +3,6 @@
|
|||
<option value="{{id}}">{{path}}</option>
|
||||
{{/each}}
|
||||
<option value="addNew">Add a diffrent path</option>
|
||||
</select>
|
||||
</select>
|
||||
|
||||
{{debug}}
|
|
@ -1,13 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
define(
|
||||
[
|
||||
'AddSeries/RootFolders/Collection',
|
||||
'handlebars'
|
||||
], function (rootFolders, Handlebars) {
|
||||
|
||||
Handlebars.registerHelper('rootFolderSelection', function () {
|
||||
var templateFunction = Marionette.TemplateCache.get('AddSeries/RootFolders/RootFolderSelectionTemplate');
|
||||
return new Handlebars.SafeString(templateFunction(rootFolders.toJSON()));
|
||||
});
|
||||
});
|
|
@ -2,7 +2,8 @@
|
|||
<div class="row">
|
||||
<div class="span2">
|
||||
<a href="{{traktUrl}}" target="_blank">
|
||||
<img class="add-series-poster" src="{{remotePoster}}" {{defaultImg}}>
|
||||
<img class="add-series-poster" src="{{remotePoster}}"
|
||||
{{defaultImg}}>
|
||||
</a>
|
||||
</div>
|
||||
<div class="span9">
|
||||
|
@ -19,12 +20,13 @@
|
|||
<icon class="icon-plus"></icon>
|
||||
</div>
|
||||
{{#unless isExisting}}
|
||||
{{rootFolderSelection}}
|
||||
{{> RootFolderSelectionPartial rootFolders}}
|
||||
{{/unless}}
|
||||
<div class='pull-right'>
|
||||
{{qualityProfileSelection}}
|
||||
{{> QualityProfileSelectionPartial qualityProfiles}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{debug}}
|
||||
|
|
|
@ -3,11 +3,12 @@ define(
|
|||
[
|
||||
'app',
|
||||
'marionette',
|
||||
'Config',
|
||||
'Quality/QualityProfileCollection',
|
||||
'AddSeries/RootFolders/Collection',
|
||||
'Series/SeriesCollection',
|
||||
'Shared/Messenger',
|
||||
'Quality/QualityProfileCollection'
|
||||
], function (App, Marionette, Config, SeriesCollection, Messenger, QualityProfiles) {
|
||||
'Config',
|
||||
'Shared/Messenger'
|
||||
], function (App, Marionette, QualityProfiles, RootFolders, SeriesCollection, Config, Messenger) {
|
||||
|
||||
return Marionette.ItemView.extend({
|
||||
|
||||
|
@ -88,8 +89,15 @@ define(
|
|||
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
serializeData: function () {
|
||||
var data = this.model.toJSON();
|
||||
data.rootFolders = RootFolders.toJSON();
|
||||
data.qualityProfiles = QualityProfiles.toJSON();
|
||||
|
||||
return data;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue