2013-06-22 06:24:24 +00:00
|
|
|
'use strict';
|
2013-06-21 05:35:56 +00:00
|
|
|
define(
|
|
|
|
[
|
|
|
|
'app',
|
|
|
|
'Missing/Row',
|
|
|
|
'Missing/Collection',
|
|
|
|
'Cells/AirDateCell',
|
|
|
|
'Series/Index/Table/SeriesStatusCell',
|
|
|
|
'Shared/Toolbar/ToolbarLayout',
|
|
|
|
'Cells/SeriesTitleCell',
|
|
|
|
'Cells/EpisodeNumberCell',
|
|
|
|
'Cells/EpisodeTitleCell',
|
|
|
|
'Cells/AirDateCell',
|
|
|
|
'Shared/Grid/Pager',
|
|
|
|
'Shared/LoadingView'
|
|
|
|
], function (App, MissingRow) {
|
2013-05-01 03:04:06 +00:00
|
|
|
NzbDrone.Missing.MissingLayout = Backbone.Marionette.Layout.extend({
|
|
|
|
template: 'Missing/MissingLayoutTemplate',
|
|
|
|
|
|
|
|
regions: {
|
|
|
|
missing: '#x-missing',
|
2013-05-02 05:50:34 +00:00
|
|
|
toolbar: '#x-toolbar',
|
|
|
|
pager : '#x-pager'
|
2013-05-01 03:04:06 +00:00
|
|
|
},
|
|
|
|
|
2013-06-21 05:35:56 +00:00
|
|
|
columns:
|
|
|
|
[
|
|
|
|
{
|
|
|
|
name : 'series',
|
|
|
|
label : 'Series Title',
|
|
|
|
sortable: false,
|
|
|
|
cell : NzbDrone.Cells.SeriesTitleCell
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'this',
|
|
|
|
label : 'Episode',
|
|
|
|
sortable: false,
|
|
|
|
cell : NzbDrone.Cells.EpisodeNumberCell
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'this',
|
|
|
|
label : 'Episode Title',
|
|
|
|
sortable: false,
|
|
|
|
cell : NzbDrone.Cells.EpisodeTitleCell
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'airDate',
|
|
|
|
label: 'Air Date',
|
|
|
|
cell : NzbDrone.Cells.AirDateCell
|
|
|
|
}
|
|
|
|
],
|
2013-05-01 03:04:06 +00:00
|
|
|
|
2013-06-08 07:57:43 +00:00
|
|
|
_showTable: function () {
|
2013-06-21 05:35:56 +00:00
|
|
|
this.missing.show(new Backgrid.Grid({
|
|
|
|
row : MissingRow,
|
2013-05-17 03:47:28 +00:00
|
|
|
columns : this.columns,
|
2013-05-01 03:04:06 +00:00
|
|
|
collection: this.missingCollection,
|
2013-05-01 07:34:05 +00:00
|
|
|
className : 'table table-hover'
|
2013-05-01 03:04:06 +00:00
|
|
|
}));
|
2013-05-02 05:50:34 +00:00
|
|
|
|
2013-06-14 00:41:46 +00:00
|
|
|
this.pager.show(new NzbDrone.Shared.Grid.Pager({
|
2013-06-09 20:51:32 +00:00
|
|
|
columns : this.columns,
|
2013-05-02 05:50:34 +00:00
|
|
|
collection: this.missingCollection
|
|
|
|
}));
|
2013-05-01 03:04:06 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
onShow: function () {
|
2013-06-08 07:57:43 +00:00
|
|
|
var self = this;
|
2013-05-01 03:04:06 +00:00
|
|
|
|
2013-06-08 07:57:43 +00:00
|
|
|
this.missing.show(new NzbDrone.Shared.LoadingView());
|
|
|
|
|
|
|
|
this.missingCollection = new NzbDrone.Missing.Collection();
|
2013-06-21 05:35:56 +00:00
|
|
|
this.missingCollection.fetch().done(function () {
|
2013-06-09 20:51:32 +00:00
|
|
|
self._showTable();
|
|
|
|
});
|
2013-06-08 07:57:43 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|