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.
Sonarr/UI/History/HistoryLayout.js

108 lines
3.1 KiB

'use strict';
12 years ago
define([
'app',
'History/Collection',
'History/EventTypeCell',
'Cells/RelativeDateCell',
'Cells/TemplatedCell',
'Cells/SeriesTitleCell',
'Cells/EpisodeNumberCell',
'Cells/EpisodeTitleCell',
'Cells/QualityCell',
'Shared/Toolbar/ToolbarLayout',
'Shared/Grid/Pager',
'Shared/Grid/HeaderCell',
'Shared/LoadingView'
12 years ago
],
12 years ago
function (App,
HistoryCollection,
EventTypeCell,
RelativeDateCell,
TemplatedCell,
SeriesTitleCell,
EpisodeNumberCell,
EpisodeTitleCell,
QualityCell,
ToolbarLayout,
Pager,
HeaderCell,
LoadingView) {
return Backbone.Marionette.Layout.extend({
12 years ago
template: 'History/HistoryLayoutTemplate',
regions: {
history: '#x-history',
toolbar: '#x-toolbar',
pager : '#x-pager'
},
columns: [
{
name: 'eventType',
label:'',
12 years ago
cell : EventTypeCell
},
{
name : 'series',
label : 'Series',
12 years ago
cell : SeriesTitleCell
},
{
name : 'episode',
label : 'Episode',
sortable: false,
12 years ago
cell : EpisodeNumberCell
},
{
name : 'episode',
label : 'Episode Title',
sortable: false,
12 years ago
cell : EpisodeTitleCell
},
{
12 years ago
name : 'quality',
label : 'Quality',
cell : QualityCell
},
{
name : 'date',
label: 'Date',
12 years ago
cell : RelativeDateCell
}
],
12 years ago
_showTable: function () {
12 years ago
this.history.show(new Backgrid.Grid(
{
row : NzbDrone.History.Row,
columns : this.columns,
12 years ago
collection: this.historyCollection,
className : 'table table-hover'
}));
12 years ago
this.pager.show(new Pager({
columns : this.columns,
12 years ago
collection: this.historyCollection
}));
},
onShow: function () {
var self = this;
12 years ago
this.history.show(new LoadingView());
12 years ago
this.historyCollection = new HistoryCollection();
this.historyCollection.fetch()
.done(function () {
self._showTable();
});
12 years ago
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
}
})
;
})
;