2013-05-03 09:53:32 +03:00
|
|
|
"use strict";
|
|
|
|
define([
|
|
|
|
'app',
|
|
|
|
'History/Collection',
|
2013-06-09 23:51:32 +03:00
|
|
|
'Cells/RelativeDateCell',
|
|
|
|
'Cells/IndexerCell',
|
|
|
|
'Cells/TemplatedCell',
|
|
|
|
'Cells/SeriesTitleCell',
|
|
|
|
'Cells/EpisodeNumberCell',
|
|
|
|
'Cells/EpisodeTitleCell',
|
|
|
|
'Cells/QualityCell',
|
2013-06-08 10:57:43 +03:00
|
|
|
'Shared/Toolbar/ToolbarLayout',
|
|
|
|
'Shared/LoadingView'
|
2013-05-03 09:53:32 +03:00
|
|
|
],
|
|
|
|
function () {
|
|
|
|
NzbDrone.History.HistoryLayout = Backbone.Marionette.Layout.extend({
|
|
|
|
template: 'History/HistoryLayoutTemplate',
|
|
|
|
|
|
|
|
regions: {
|
|
|
|
history: '#x-history',
|
|
|
|
toolbar: '#x-toolbar',
|
|
|
|
pager : '#x-pager'
|
|
|
|
},
|
|
|
|
|
2013-05-17 06:47:28 +03:00
|
|
|
columns: [
|
|
|
|
{
|
2013-06-09 23:51:32 +03:00
|
|
|
name : 'indexer',
|
|
|
|
label: '',
|
|
|
|
cell : NzbDrone.Cells.IndexerCell
|
2013-05-17 06:47:28 +03:00
|
|
|
},
|
|
|
|
{
|
2013-06-09 23:51:32 +03:00
|
|
|
name : 'series',
|
|
|
|
label : 'Series',
|
|
|
|
cell : NzbDrone.Cells.SeriesTitleCell
|
2013-05-17 06:47:28 +03:00
|
|
|
},
|
|
|
|
{
|
2013-06-09 23:51:32 +03:00
|
|
|
name : 'episode',
|
|
|
|
label : 'Episode',
|
|
|
|
sortable: false,
|
|
|
|
cell : NzbDrone.Cells.EpisodeNumberCell
|
2013-05-17 06:47:28 +03:00
|
|
|
},
|
|
|
|
{
|
2013-06-09 23:51:32 +03:00
|
|
|
name : 'episode',
|
|
|
|
label : 'Episode Title',
|
|
|
|
sortable: false,
|
|
|
|
cell : NzbDrone.Cells.EpisodeTitleCell
|
2013-05-17 06:47:28 +03:00
|
|
|
},
|
|
|
|
{
|
2013-06-09 23:51:32 +03:00
|
|
|
name : 'quality',
|
|
|
|
label: 'Quality',
|
|
|
|
cell : NzbDrone.Cells.QualityCell
|
2013-05-17 06:47:28 +03:00
|
|
|
},
|
|
|
|
{
|
2013-06-09 23:51:32 +03:00
|
|
|
name : 'date',
|
|
|
|
label: 'Date',
|
|
|
|
cell : NzbDrone.Cells.RelativeDateCell
|
2013-05-17 06:47:28 +03:00
|
|
|
}
|
|
|
|
],
|
2013-05-03 09:53:32 +03:00
|
|
|
|
2013-06-08 10:57:43 +03:00
|
|
|
_showTable: function () {
|
2013-05-03 09:53:32 +03:00
|
|
|
|
|
|
|
this.history.show(new Backgrid.Grid(
|
|
|
|
{
|
|
|
|
row : NzbDrone.History.Row,
|
2013-05-17 06:47:28 +03:00
|
|
|
columns : this.columns,
|
2013-05-03 09:53:32 +03:00
|
|
|
collection: this.historyCollection,
|
|
|
|
className : 'table table-hover'
|
|
|
|
}));
|
|
|
|
|
|
|
|
this.pager.show(new Backgrid.NzbDronePaginator({
|
2013-06-09 23:51:32 +03:00
|
|
|
columns : this.columns,
|
2013-05-03 09:53:32 +03:00
|
|
|
collection: this.historyCollection
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
|
2013-06-08 10:57:43 +03:00
|
|
|
onShow: function () {
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
this.history.show(new NzbDrone.Shared.LoadingView());
|
|
|
|
|
2013-05-03 09:53:32 +03:00
|
|
|
this.historyCollection = new NzbDrone.History.Collection();
|
2013-06-08 10:57:43 +03:00
|
|
|
this.historyCollection.fetch()
|
2013-06-09 23:51:32 +03:00
|
|
|
.done(function () {
|
|
|
|
self._showTable();
|
|
|
|
});
|
2013-05-03 09:53:32 +03:00
|
|
|
|
|
|
|
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
;
|
|
|
|
})
|
|
|
|
;
|