2013-05-03 08:53:32 +02:00
|
|
|
"use strict";
|
|
|
|
define([
|
|
|
|
'app',
|
|
|
|
'History/Collection',
|
|
|
|
'Series/Index/Table/AirDateCell',
|
|
|
|
'Shared/Toolbar/ToolbarLayout'
|
|
|
|
],
|
|
|
|
function () {
|
|
|
|
NzbDrone.History.HistoryLayout = Backbone.Marionette.Layout.extend({
|
|
|
|
template: 'History/HistoryLayoutTemplate',
|
|
|
|
|
|
|
|
regions: {
|
|
|
|
history: '#x-history',
|
|
|
|
toolbar: '#x-toolbar',
|
|
|
|
pager : '#x-pager'
|
|
|
|
},
|
|
|
|
|
|
|
|
showTable: function () {
|
|
|
|
|
|
|
|
var columns = [
|
2013-05-07 04:32:43 +02:00
|
|
|
{
|
|
|
|
name : 'indexer',
|
|
|
|
label : '',
|
|
|
|
editable : false,
|
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'History/IndexerTemplate' }),
|
|
|
|
headerCell: 'nzbDrone'
|
|
|
|
},
|
2013-05-03 08:53:32 +02:00
|
|
|
{
|
2013-05-11 00:33:04 +02:00
|
|
|
name : 'Series.Title',
|
2013-05-03 08:53:32 +02:00
|
|
|
label : 'Series Title',
|
|
|
|
editable : false,
|
2013-05-07 04:32:43 +02:00
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'Missing/SeriesTitleTemplate' }),
|
2013-05-03 08:53:32 +02:00
|
|
|
headerCell: 'nzbDrone'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'episode',
|
|
|
|
label : 'Episode',
|
|
|
|
editable : false,
|
|
|
|
sortable : false,
|
2013-05-07 04:32:43 +02:00
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'Missing/EpisodeColumnTemplate' }),
|
2013-05-03 08:53:32 +02:00
|
|
|
headerCell: 'nzbDrone'
|
|
|
|
},
|
|
|
|
{
|
2013-05-11 00:33:04 +02:00
|
|
|
name : 'Episode.Title',
|
2013-05-03 08:53:32 +02:00
|
|
|
label : 'Episode Title',
|
|
|
|
editable : false,
|
|
|
|
sortable : false,
|
2013-05-11 00:33:04 +02:00
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'History/EpisodeTitleTemplate' }),
|
2013-05-03 08:53:32 +02:00
|
|
|
headerCell: 'nzbDrone'
|
|
|
|
},
|
|
|
|
{
|
2013-05-07 04:32:43 +02:00
|
|
|
name : 'quality',
|
|
|
|
label : 'Quality',
|
|
|
|
editable : false,
|
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'History/QualityTemplate' }),
|
|
|
|
headerCell: 'nzbDrone'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'date',
|
|
|
|
label : 'Grabbed',
|
2013-05-03 08:53:32 +02:00
|
|
|
editable : false,
|
|
|
|
cell : 'airDate',
|
|
|
|
headerCell: 'nzbDrone'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'edit',
|
|
|
|
label : '',
|
|
|
|
editable : false,
|
|
|
|
sortable : false,
|
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'History/ControlsColumnTemplate' }),
|
|
|
|
headerCell: 'nzbDrone'
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
this.history.show(new Backgrid.Grid(
|
|
|
|
{
|
|
|
|
row : NzbDrone.History.Row,
|
|
|
|
columns : columns,
|
|
|
|
collection: this.historyCollection,
|
|
|
|
className : 'table table-hover'
|
|
|
|
}));
|
|
|
|
|
|
|
|
this.pager.show(new Backgrid.NzbDronePaginator({
|
|
|
|
columns: columns,
|
|
|
|
collection: this.historyCollection
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
|
|
|
|
initialize: function () {
|
|
|
|
this.historyCollection = new NzbDrone.History.Collection();
|
|
|
|
this.historyCollection.fetch();
|
|
|
|
},
|
|
|
|
|
|
|
|
onShow: function () {
|
|
|
|
this.showTable();
|
|
|
|
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
;
|
|
|
|
})
|
|
|
|
;
|