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/Missing/MissingLayout.js

88 lines
2.7 KiB

'use strict';
define(
[
'app',
'Missing/Row',
'Missing/Collection',
'Cells/AirDateCell',
'Series/Index/Table/SeriesStatusCell',
'Shared/Toolbar/ToolbarLayout',
'Cells/SeriesTitleCell',
'Cells/EpisodeNumberCell',
'Cells/EpisodeTitleCell',
'Shared/Grid/Pager',
'Shared/LoadingView'
12 years ago
], function (App,
MissingRow,
MissingCollection,
AirDateCell,
SeriesStatusCell,
ToolbarLayout,
SeriesTitleCell,
EpisodeNumberCell,
EpisodeTitleCell,
Pager,
LoadingView) {
return Backbone.Marionette.Layout.extend({
template: 'Missing/MissingLayoutTemplate',
regions: {
missing: '#x-missing',
toolbar: '#x-toolbar',
pager : '#x-pager'
},
columns:
[
{
name : 'series',
label : 'Series Title',
sortable: false,
12 years ago
cell : SeriesTitleCell
},
{
name : 'this',
label : 'Episode',
sortable: false,
12 years ago
cell : EpisodeNumberCell
},
{
name : 'this',
label : 'Episode Title',
sortable: false,
12 years ago
cell : EpisodeTitleCell
},
{
12 years ago
name : 'airDate',
label : 'Air Date',
cell : AirDateCell
}
],
_showTable: function () {
this.missing.show(new Backgrid.Grid({
row : MissingRow,
columns : this.columns,
collection: this.missingCollection,
className : 'table table-hover'
}));
this.pager.show(new NzbDrone.Shared.Grid.Pager({
columns : this.columns,
collection: this.missingCollection
}));
},
onShow: function () {
var self = this;
12 years ago
this.missing.show(new LoadingView());
12 years ago
this.missingCollection = new MissingCollection();
this.missingCollection.fetch().done(function () {
self._showTable();
});
}
});
});