1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-31 16:02:29 +01:00
Sonarr/UI/History/HistoryLayout.js

94 lines
3.3 KiB
JavaScript
Raw Normal View History

2013-05-03 08:53:32 +02:00
"use strict";
define([
'app',
'History/Collection',
'Series/Index/Table/AirDateCell',
2013-06-08 09:57:43 +02:00
'Shared/Toolbar/ToolbarLayout',
'Shared/LoadingView'
2013-05-03 08:53:32 +02:00
],
function () {
NzbDrone.History.HistoryLayout = Backbone.Marionette.Layout.extend({
template: 'History/HistoryLayoutTemplate',
regions: {
history: '#x-history',
toolbar: '#x-toolbar',
pager : '#x-pager'
},
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-06-08 09:57:43 +02:00
_showTable: function () {
2013-05-03 08:53:32 +02:00
this.history.show(new Backgrid.Grid(
{
row : NzbDrone.History.Row,
columns : this.columns,
2013-05-03 08:53:32 +02:00
collection: this.historyCollection,
className : 'table table-hover'
}));
this.pager.show(new Backgrid.NzbDronePaginator({
columns: this.columns,
2013-05-03 08:53:32 +02:00
collection: this.historyCollection
}));
},
2013-06-08 09:57:43 +02:00
onShow: function () {
var self = this;
this.history.show(new NzbDrone.Shared.LoadingView());
2013-05-03 08:53:32 +02:00
this.historyCollection = new NzbDrone.History.Collection();
2013-06-08 09:57:43 +02:00
this.historyCollection.fetch()
.done(function () {
self._showTable();
});
2013-05-03 08:53:32 +02:00
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
}
})
;
})
;