1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Added series stats to footer

This commit is contained in:
Mark McDowall 2013-07-28 18:12:34 -07:00
parent 708cb954c4
commit 74a4def877
7 changed files with 66 additions and 18 deletions

View File

@ -0,0 +1,9 @@
'use strict';
define(
[
'backbone',
'underscore'
], function (Backbone, _) {
return Backbone.Model.extend({
});
});

View File

@ -4,6 +4,6 @@ define(
'marionette'
], function (Marionette) {
return Marionette.CompositeView.extend({
template: 'Series/Index/LegendViewTemplate'
template: 'Series/Index/FooterViewTemplate'
});
});

View File

@ -0,0 +1,21 @@
<div class="row">
<div class="series-legend legend span3">
<ul class='legend-labels'>
<li><span class="progress-primary"></span>Continuing (All Episodes downloaded)</li>
<li><span class="progress-success"></span>Ended (All Episodes downloaded)</li>
<li><span class="progress-danger"></span>Missing Episodes</li>
</ul>
</div>
<div class="series-stats span3">
<dl class="dl-horizontal">
<dt>Series</dt>
<dd>{{count}}</dd>
<dt>Episodes</dt>
<dd>{{episodeCount}}</dd>
<dt>Files</dt>
<dd>{{episodeFileCount}}</dd>
</dl>
</div>
</div>

View File

@ -1,7 +0,0 @@
<div class="legend">
<ul class='legend-labels'>
<li><span class="progress-primary"></span>Continuing (All Episodes downloaded)</li>
<li><span class="progress-success"></span>Ended (All Episodes downloaded)</li>
<li><span class="progress-danger"></span>Missing Episodes</li>
</ul>
</div>

View File

@ -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 }));
}
});
});

View File

@ -1,11 +1,9 @@
<div id="x-toolbar"></div>
<div class="row">
<div class="span12">
<div id="x-series"></div>
</div>
</div>
<div class="row">
<div class="span12">
<div id="x-legend"></div>
</div>
</div>
<div id="x-series-footer"></div>

View File

@ -221,3 +221,10 @@
}
}
.series-stats {
font-size: 11px;
}
.series-legend {
padding-top: 5px;
}