1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/UI/History/HistoryLayout.js

96 lines
2.9 KiB
JavaScript
Raw Normal View History

2013-05-03 09:53:32 +03:00
"use strict";
define([
'app',
'History/Collection',
2013-06-11 04:55:05 +03:00
'History/EventTypeCell',
'Cells/RelativeDateCell',
'Cells/TemplatedCell',
'Cells/SeriesTitleCell',
'Cells/EpisodeNumberCell',
'Cells/EpisodeTitleCell',
'Cells/QualityCell',
2013-06-08 10:57:43 +03:00
'Shared/Toolbar/ToolbarLayout',
2013-06-14 03:41:46 +03:00
'Shared/Grid/Pager',
'Shared/Grid/HeaderCell',
2013-06-08 10:57:43 +03:00
'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'
},
columns: [
{
2013-06-11 04:55:05 +03:00
name: 'eventType',
label:'',
cell : NzbDrone.History.EventTypeCell
},
{
name : 'series',
label : 'Series',
cell : NzbDrone.Cells.SeriesTitleCell
},
{
name : 'episode',
label : 'Episode',
sortable: false,
cell : NzbDrone.Cells.EpisodeNumberCell
},
{
name : 'episode',
label : 'Episode Title',
sortable: false,
cell : NzbDrone.Cells.EpisodeTitleCell
},
{
name : 'quality',
label: 'Quality',
cell : NzbDrone.Cells.QualityCell
},
{
name : 'date',
label: 'Date',
cell : NzbDrone.Cells.RelativeDateCell
}
],
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,
columns : this.columns,
2013-05-03 09:53:32 +03:00
collection: this.historyCollection,
className : 'table table-hover'
}));
2013-06-14 03:41:46 +03:00
this.pager.show(new NzbDrone.Shared.Grid.Pager({
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()
.done(function () {
self._showTable();
});
2013-05-03 09:53:32 +03:00
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
}
})
;
})
;