You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/src/UI/Episode/Activity/EpisodeActivityLayout.js

68 lines
2.1 KiB

'use strict';
define(
[
'app',
'marionette',
'backgrid',
'History/HistoryCollection',
'Cells/EventTypeCell',
'Cells/QualityCell',
'Cells/RelativeDateCell',
'Shared/LoadingView'
], function (App, Marionette, Backgrid, HistoryCollection, EventTypeCell, QualityCell, RelativeDateCell, LoadingView) {
return Marionette.Layout.extend({
template: 'Episode/Activity/EpisodeActivityLayoutTemplate',
regions: {
activityTable: '.activity-table'
},
columns:
[
{
name : 'eventType',
label : '',
cell : EventTypeCell,
cellValue: 'this'
},
{
name : 'sourceTitle',
label: 'Source Title',
cell : 'string'
},
{
name : 'quality',
label: 'Quality',
cell : QualityCell
},
{
name : 'date',
label: 'Date',
cell : RelativeDateCell
}
],
initialize: function (options) {
this.model = options.model;
this.series = options.series;
this.collection = new HistoryCollection({ episodeId: this.model.id });
this.collection.fetch();
this.listenTo(this.collection, 'sync', this._showTable);
},
onRender: function () {
this.activityTable.show(new LoadingView());
},
_showTable: function () {
this.activityTable.show(new Backgrid.Grid({
collection: this.collection,
columns : this.columns,
className : 'table table-hover table-condensed'
}));
}
});
});