2013-05-01 03:04:06 +00:00
|
|
|
"use strict";
|
|
|
|
define([
|
|
|
|
'app',
|
|
|
|
'Missing/Collection',
|
|
|
|
'Series/Index/Table/AirDateCell',
|
|
|
|
'Series/Index/Table/SeriesStatusCell',
|
2013-06-08 07:57:43 +00:00
|
|
|
'Shared/Toolbar/ToolbarLayout',
|
|
|
|
'Shared/LoadingView'
|
2013-05-01 03:04:06 +00:00
|
|
|
],
|
|
|
|
function () {
|
|
|
|
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-05-17 03:47:28 +00:00
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
name : 'series.Title',
|
|
|
|
label : 'Series Title',
|
2013-06-04 03:59:24 +00:00
|
|
|
sortable : false,
|
2013-05-17 03:47:28 +00:00
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'Missing/SeriesTitleTemplate' })
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'episode',
|
|
|
|
label : 'Episode',
|
|
|
|
sortable : false,
|
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'Missing/EpisodeColumnTemplate' })
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'title',
|
|
|
|
label : 'Episode Title',
|
|
|
|
sortable : false,
|
|
|
|
cell : 'string'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'airDate',
|
|
|
|
label : 'Air Date',
|
|
|
|
cell : 'airDate'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'edit',
|
|
|
|
label : '',
|
|
|
|
sortable : false,
|
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'Missing/ControlsColumnTemplate' })
|
|
|
|
}
|
|
|
|
],
|
2013-05-01 03:04:06 +00:00
|
|
|
|
2013-06-08 07:57:43 +00:00
|
|
|
_showTable: function () {
|
2013-05-01 03:04:06 +00:00
|
|
|
this.missing.show(new Backgrid.Grid(
|
|
|
|
{
|
|
|
|
row : NzbDrone.Missing.Row,
|
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
|
|
|
|
|
|
|
this.pager.show(new Backgrid.NzbDronePaginator({
|
2013-05-17 03:47:28 +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();
|
|
|
|
this.missingCollection.fetch()
|
|
|
|
.done(function () {
|
|
|
|
self._showTable();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|