|
|
@ -12,7 +12,8 @@ define(
|
|
|
|
'Cells/QualityProfileCell',
|
|
|
|
'Cells/QualityProfileCell',
|
|
|
|
'Series/Index/Table/SeriesStatusCell',
|
|
|
|
'Series/Index/Table/SeriesStatusCell',
|
|
|
|
'Series/Index/Table/Row',
|
|
|
|
'Series/Index/Table/Row',
|
|
|
|
'Series/Index/LegendView',
|
|
|
|
'Series/Index/FooterView',
|
|
|
|
|
|
|
|
'Series/Index/FooterModel',
|
|
|
|
'Shared/Toolbar/ToolbarLayout',
|
|
|
|
'Shared/Toolbar/ToolbarLayout',
|
|
|
|
'Shared/LoadingView'
|
|
|
|
'Shared/LoadingView'
|
|
|
|
], function (Marionette,
|
|
|
|
], function (Marionette,
|
|
|
@ -26,7 +27,8 @@ define(
|
|
|
|
QualityProfileCell,
|
|
|
|
QualityProfileCell,
|
|
|
|
SeriesStatusCell,
|
|
|
|
SeriesStatusCell,
|
|
|
|
SeriesIndexRow,
|
|
|
|
SeriesIndexRow,
|
|
|
|
LegendView,
|
|
|
|
FooterView,
|
|
|
|
|
|
|
|
FooterModel,
|
|
|
|
ToolbarLayout,
|
|
|
|
ToolbarLayout,
|
|
|
|
LoadingView) {
|
|
|
|
LoadingView) {
|
|
|
|
return Marionette.Layout.extend({
|
|
|
|
return Marionette.Layout.extend({
|
|
|
@ -35,7 +37,7 @@ define(
|
|
|
|
regions: {
|
|
|
|
regions: {
|
|
|
|
seriesRegion: '#x-series',
|
|
|
|
seriesRegion: '#x-series',
|
|
|
|
toolbar : '#x-toolbar',
|
|
|
|
toolbar : '#x-toolbar',
|
|
|
|
legend : '#x-legend'
|
|
|
|
footer : '#x-series-footer'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
columns:
|
|
|
|
columns:
|
|
|
@ -155,9 +157,9 @@ define(
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
this.currentView.collection = SeriesCollection;
|
|
|
|
this.currentView.collection = SeriesCollection;
|
|
|
|
this.seriesRegion.show(this.currentView);
|
|
|
|
this.seriesRegion.show(this.currentView);
|
|
|
|
this.legend.show(new LegendView());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this._showToolbar();
|
|
|
|
this._showToolbar();
|
|
|
|
|
|
|
|
this._showFooter();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
@ -168,7 +170,6 @@ define(
|
|
|
|
this._fetchCollection();
|
|
|
|
this._fetchCollection();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_fetchCollection: function () {
|
|
|
|
_fetchCollection: function () {
|
|
|
|
if (SeriesCollection.length === 0) {
|
|
|
|
if (SeriesCollection.length === 0) {
|
|
|
|
this.seriesRegion.show(new LoadingView());
|
|
|
|
this.seriesRegion.show(new LoadingView());
|
|
|
@ -225,6 +226,25 @@ define(
|
|
|
|
],
|
|
|
|
],
|
|
|
|
context: this
|
|
|
|
context: this
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_showFooter: function () {
|
|
|
|
|
|
|
|
var footerModel = new FooterModel();
|
|
|
|
|
|
|
|
var episodeCount = _.reduce(SeriesCollection.models, function (memo, model) {
|
|
|
|
|
|
|
|
return memo + model.get('episodeCount');
|
|
|
|
|
|
|
|
}, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var episodeFileCount = _.reduce(SeriesCollection.models, function (memo, model) {
|
|
|
|
|
|
|
|
return memo + model.get('episodeFileCount');
|
|
|
|
|
|
|
|
}, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
footerModel.set({
|
|
|
|
|
|
|
|
count: SeriesCollection.models.length,
|
|
|
|
|
|
|
|
episodeCount: episodeCount,
|
|
|
|
|
|
|
|
episodeFileCount: episodeFileCount
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.footer.show(new FooterView({ model: footerModel }));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|