diff --git a/UI/Series/Index/FooterModel.js b/UI/Series/Index/FooterModel.js new file mode 100644 index 000000000..0ed6ca77c --- /dev/null +++ b/UI/Series/Index/FooterModel.js @@ -0,0 +1,9 @@ +'use strict'; +define( + [ + 'backbone', + 'underscore' + ], function (Backbone, _) { + return Backbone.Model.extend({ + }); + }); diff --git a/UI/Series/Index/LegendView.js b/UI/Series/Index/FooterView.js similarity index 73% rename from UI/Series/Index/LegendView.js rename to UI/Series/Index/FooterView.js index c5fac4c4d..0e569b70a 100644 --- a/UI/Series/Index/LegendView.js +++ b/UI/Series/Index/FooterView.js @@ -4,6 +4,6 @@ define( 'marionette' ], function (Marionette) { return Marionette.CompositeView.extend({ - template: 'Series/Index/LegendViewTemplate' + template: 'Series/Index/FooterViewTemplate' }); }); diff --git a/UI/Series/Index/FooterViewTemplate.html b/UI/Series/Index/FooterViewTemplate.html new file mode 100644 index 000000000..e55cb7755 --- /dev/null +++ b/UI/Series/Index/FooterViewTemplate.html @@ -0,0 +1,21 @@ +
+
+ +
+ +
+
+
Series
+
{{count}}
+
Episodes
+
{{episodeCount}}
+
Files
+
{{episodeFileCount}}
+
+ +
+
diff --git a/UI/Series/Index/LegendViewTemplate.html b/UI/Series/Index/LegendViewTemplate.html deleted file mode 100644 index 11a7486a4..000000000 --- a/UI/Series/Index/LegendViewTemplate.html +++ /dev/null @@ -1,7 +0,0 @@ -
- -
\ No newline at end of file diff --git a/UI/Series/Index/SeriesIndexLayout.js b/UI/Series/Index/SeriesIndexLayout.js index 916613b3e..8bfd57ef1 100644 --- a/UI/Series/Index/SeriesIndexLayout.js +++ b/UI/Series/Index/SeriesIndexLayout.js @@ -12,7 +12,8 @@ define( 'Cells/QualityProfileCell', 'Series/Index/Table/SeriesStatusCell', 'Series/Index/Table/Row', - 'Series/Index/LegendView', + 'Series/Index/FooterView', + 'Series/Index/FooterModel', 'Shared/Toolbar/ToolbarLayout', 'Shared/LoadingView' ], function (Marionette, @@ -26,7 +27,8 @@ define( QualityProfileCell, SeriesStatusCell, SeriesIndexRow, - LegendView, + FooterView, + FooterModel, ToolbarLayout, LoadingView) { return Marionette.Layout.extend({ @@ -35,7 +37,7 @@ define( regions: { seriesRegion: '#x-series', toolbar : '#x-toolbar', - legend : '#x-legend' + footer : '#x-series-footer' }, columns: @@ -155,9 +157,9 @@ define( else { this.currentView.collection = SeriesCollection; this.seriesRegion.show(this.currentView); - this.legend.show(new LegendView()); this._showToolbar(); + this._showFooter(); } }, @@ -168,7 +170,6 @@ define( this._fetchCollection(); }, - _fetchCollection: function () { if (SeriesCollection.length === 0) { this.seriesRegion.show(new LoadingView()); @@ -225,6 +226,25 @@ define( ], 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 })); } }); }); diff --git a/UI/Series/Index/SeriesIndexLayoutTemplate.html b/UI/Series/Index/SeriesIndexLayoutTemplate.html index a140e82cc..40124822f 100644 --- a/UI/Series/Index/SeriesIndexLayoutTemplate.html +++ b/UI/Series/Index/SeriesIndexLayoutTemplate.html @@ -1,11 +1,9 @@ 
+
-
-
-
-
-
\ No newline at end of file + + \ No newline at end of file diff --git a/UI/Series/series.less b/UI/Series/series.less index c9491fb3b..0908c4e38 100644 --- a/UI/Series/series.less +++ b/UI/Series/series.less @@ -221,3 +221,10 @@ } } +.series-stats { + font-size: 11px; +} + +.series-legend { + padding-top: 5px; +} \ No newline at end of file