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'
|
|
|
|
},
|
|
|
|
|
2013-05-17 05:47:28 +02:00
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
name : 'indexer',
|
|
|
|
label : '',
|
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'History/IndexerTemplate' })
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'Series.Title',
|
|
|
|
label : 'Series Title',
|
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'Missing/SeriesTitleTemplate' })
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'episode',
|
|
|
|
label : 'Episode',
|
|
|
|
sortable : false,
|
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'Missing/EpisodeColumnTemplate' })
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'Episode.Title',
|
|
|
|
label : 'Episode Title',
|
|
|
|
sortable : false,
|
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'History/EpisodeTitleTemplate' })
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'quality',
|
|
|
|
label : 'Quality',
|
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'History/QualityTemplate' })
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'date',
|
|
|
|
label : 'Grabbed',
|
|
|
|
cell : 'airDate'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'edit',
|
|
|
|
label : '',
|
|
|
|
sortable : false,
|
|
|
|
cell : Backgrid.TemplateBackedCell.extend({ template: 'History/ControlsColumnTemplate' })
|
|
|
|
}
|
|
|
|
],
|
2013-05-03 08:53:32 +02:00
|
|
|
|
2013-05-17 05:47:28 +02:00
|
|
|
showTable: function () {
|
2013-05-03 08:53:32 +02:00
|
|
|
|
|
|
|
this.history.show(new Backgrid.Grid(
|
|
|
|
{
|
|
|
|
row : NzbDrone.History.Row,
|
2013-05-17 05:47:28 +02:00
|
|
|
columns : this.columns,
|
2013-05-03 08:53:32 +02:00
|
|
|
collection: this.historyCollection,
|
|
|
|
className : 'table table-hover'
|
|
|
|
}));
|
|
|
|
|
|
|
|
this.pager.show(new Backgrid.NzbDronePaginator({
|
2013-05-17 05:47:28 +02:00
|
|
|
columns: this.columns,
|
2013-05-03 08:53:32 +02:00
|
|
|
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}));
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
;
|
|
|
|
})
|
|
|
|
;
|