mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
removed NzbDrone. namespace, everything is done using require.
This commit is contained in:
@@ -1,33 +1,22 @@
|
||||
'use strict';
|
||||
define([
|
||||
'app',
|
||||
'Series/Index/List/CollectionView',
|
||||
'Series/Index/Posters/CollectionView',
|
||||
'Series/Index/EmptyView',
|
||||
'Series/SeriesCollection',
|
||||
'Cells/AirDateCell',
|
||||
'Cells/SeriesTitleCell',
|
||||
'Cells/SeriesStatusCell',
|
||||
'Cells/TemplatedCell',
|
||||
'Shared/Toolbar/ToolbarLayout',
|
||||
'Config',
|
||||
'Shared/LoadingView'
|
||||
],
|
||||
function (
|
||||
App,
|
||||
ListCollectionView,
|
||||
PosterCollectionView,
|
||||
EmptyView,
|
||||
SeriesCollection,
|
||||
AirDateCell,
|
||||
SeriesTitleCell,
|
||||
SeriesStatusCell,
|
||||
TemplatedCell,
|
||||
ToolbarLayout,
|
||||
Config,
|
||||
LoadingView)
|
||||
{
|
||||
NzbDrone.Series.Index.SeriesIndexLayout = Backbone.Marionette.Layout.extend({
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Series/Index/Posters/CollectionView',
|
||||
'Series/Index/List/CollectionView',
|
||||
'Series/Index/EmptyView',
|
||||
'Series/SeriesCollection',
|
||||
'Cells/AirDateCell',
|
||||
'Cells/SeriesTitleCell',
|
||||
'Cells/TemplatedCell',
|
||||
'Series/Index/Table/SeriesStatusCell',
|
||||
'Series/Index/Table/Row',
|
||||
'Shared/Toolbar/ToolbarLayout',
|
||||
'Config',
|
||||
'Shared/LoadingView'
|
||||
], function (Marionette, PosterCollectionView, ListCollectionView, EmptyView, SeriesCollection, AirDateCell, SeriesTitleCell, TemplatedCell, SeriesStatusCell, SeriesIndexRow,
|
||||
ToolbarLayout, Config, LoadingView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Series/Index/SeriesIndexLayoutTemplate',
|
||||
|
||||
regions: {
|
||||
@@ -35,87 +24,88 @@ define([
|
||||
toolbar: '#x-toolbar'
|
||||
},
|
||||
|
||||
columns: [
|
||||
{
|
||||
name : 'status',
|
||||
label: '',
|
||||
cell : SeriesStatusCell
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label: 'Title',
|
||||
cell : SeriesTitleCell
|
||||
},
|
||||
{
|
||||
name : 'seasonCount',
|
||||
label: 'Seasons',
|
||||
cell : 'integer'
|
||||
},
|
||||
{
|
||||
name : 'quality',
|
||||
label: 'Quality',
|
||||
cell : 'integer'
|
||||
},
|
||||
{
|
||||
name : 'network',
|
||||
label: 'Network',
|
||||
cell : 'string'
|
||||
},
|
||||
{
|
||||
name : 'nextAiring',
|
||||
label: 'Next Airing',
|
||||
cell : AirDateCell
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label : 'Episodes',
|
||||
sortable: false,
|
||||
template: 'Series/EpisodeProgressTemplate',
|
||||
cell : TemplatedCell
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label : '',
|
||||
sortable: false,
|
||||
template: 'Series/Index/Table/ControlsColumnTemplate',
|
||||
cell : TemplatedCell
|
||||
}
|
||||
],
|
||||
columns:
|
||||
[
|
||||
{
|
||||
name : 'status',
|
||||
label: '',
|
||||
cell : SeriesStatusCell
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label: 'Title',
|
||||
cell : SeriesTitleCell
|
||||
},
|
||||
{
|
||||
name : 'seasonCount',
|
||||
label: 'Seasons',
|
||||
cell : 'integer'
|
||||
},
|
||||
{
|
||||
name : 'quality',
|
||||
label: 'Quality',
|
||||
cell : 'integer'
|
||||
},
|
||||
{
|
||||
name : 'network',
|
||||
label: 'Network',
|
||||
cell : 'string'
|
||||
},
|
||||
{
|
||||
name : 'nextAiring',
|
||||
label: 'Next Airing',
|
||||
cell : AirDateCell
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label : 'Episodes',
|
||||
sortable: false,
|
||||
template: 'Series/EpisodeProgressTemplate',
|
||||
cell : TemplatedCell
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label : '',
|
||||
sortable: false,
|
||||
template: 'Series/Index/Table/ControlsColumnTemplate',
|
||||
cell : TemplatedCell
|
||||
}
|
||||
],
|
||||
|
||||
leftSideButtons: {
|
||||
type : 'default',
|
||||
storeState: false,
|
||||
items : [
|
||||
{
|
||||
title: 'Add Series',
|
||||
icon : 'icon-plus',
|
||||
route: 'series/add'
|
||||
},
|
||||
{
|
||||
title : 'RSS Sync',
|
||||
icon : 'icon-rss',
|
||||
command : 'rsssync',
|
||||
successMessage: 'RSS Sync Completed',
|
||||
errorMessage : 'RSS Sync Failed!'
|
||||
},
|
||||
{
|
||||
title : 'Update Library',
|
||||
icon : 'icon-refresh',
|
||||
command : 'refreshseries',
|
||||
successMessage: 'Library was updated!',
|
||||
errorMessage : 'Library update failed!'
|
||||
}
|
||||
]
|
||||
items :
|
||||
[
|
||||
{
|
||||
title: 'Add Series',
|
||||
icon : 'icon-plus',
|
||||
route: 'series/add'
|
||||
},
|
||||
{
|
||||
title : 'RSS Sync',
|
||||
icon : 'icon-rss',
|
||||
command : 'rsssync',
|
||||
successMessage: 'RSS Sync Completed',
|
||||
errorMessage : 'RSS Sync Failed!'
|
||||
},
|
||||
{
|
||||
title : 'Update Library',
|
||||
icon : 'icon-refresh',
|
||||
command : 'refreshseries',
|
||||
successMessage: 'Library was updated!',
|
||||
errorMessage : 'Library update failed!'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
_showTable: function () {
|
||||
var view = new Backgrid.Grid(
|
||||
{
|
||||
row : NzbDrone.Series.Index.Table.Row,
|
||||
columns : this.columns,
|
||||
collection: this.seriesCollection,
|
||||
className : 'table table-hover'
|
||||
});
|
||||
var view = new Backgrid.Grid({
|
||||
row : SeriesIndexRow,
|
||||
columns : this.columns,
|
||||
collection: this.seriesCollection,
|
||||
className : 'table table-hover'
|
||||
});
|
||||
|
||||
this._fetchCollection(view);
|
||||
},
|
||||
@@ -140,16 +130,15 @@ define([
|
||||
if (this.seriesCollection.models.length === 0) {
|
||||
this.series.show(new LoadingView());
|
||||
|
||||
this.seriesCollection.fetch()
|
||||
.done(function () {
|
||||
if (self.seriesCollection.models.length === 0) {
|
||||
self._showEmpty();
|
||||
}
|
||||
else {
|
||||
view.collection = self.seriesCollection;
|
||||
self.series.show(view);
|
||||
}
|
||||
});
|
||||
this.seriesCollection.fetch().done(function () {
|
||||
if (self.seriesCollection.models.length === 0) {
|
||||
self._showEmpty();
|
||||
}
|
||||
else {
|
||||
view.collection = self.seriesCollection;
|
||||
self.series.show(view);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
else {
|
||||
@@ -170,35 +159,40 @@ define([
|
||||
storeState : true,
|
||||
menuKey : 'seriesViewMode',
|
||||
defaultAction: 'listView',
|
||||
items : [
|
||||
{
|
||||
key : 'tableView',
|
||||
title : '',
|
||||
icon : 'icon-table',
|
||||
callback: this._showTable
|
||||
},
|
||||
{
|
||||
key : 'listView',
|
||||
title : '',
|
||||
icon : 'icon-list',
|
||||
callback: this._showList
|
||||
},
|
||||
{
|
||||
key : 'posterView',
|
||||
title : '',
|
||||
icon : 'icon-picture',
|
||||
callback: this._showPosters
|
||||
}
|
||||
]
|
||||
items :
|
||||
[
|
||||
{
|
||||
key : 'tableView',
|
||||
title : '',
|
||||
icon : 'icon-table',
|
||||
callback: this._showTable
|
||||
},
|
||||
{
|
||||
key : 'listView',
|
||||
title : '',
|
||||
icon : 'icon-list',
|
||||
callback: this._showList
|
||||
},
|
||||
{
|
||||
key : 'posterView',
|
||||
title : '',
|
||||
icon : 'icon-picture',
|
||||
callback: this._showPosters
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
this.toolbar.show(new ToolbarLayout({
|
||||
right : [ viewButtons],
|
||||
left : [ this.leftSideButtons],
|
||||
right :
|
||||
[
|
||||
viewButtons
|
||||
],
|
||||
left :
|
||||
[
|
||||
this.leftSideButtons
|
||||
],
|
||||
context: this
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
return NzbDrone.Series.Index.SeriesIndexLayou;
|
||||
});
|
||||
|
Reference in New Issue
Block a user