1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-20 00:11:46 +02:00
Radarr/UI/History/HistoryLayout.js

108 lines
3.1 KiB
JavaScript
Raw Normal View History

2013-06-22 08:24:24 +02:00
'use strict';
2013-05-03 08:53:32 +02:00
define([
'app',
'History/Collection',
2013-06-11 03:55:05 +02:00
'History/EventTypeCell',
'Cells/RelativeDateCell',
'Cells/TemplatedCell',
'Cells/SeriesTitleCell',
'Cells/EpisodeNumberCell',
'Cells/EpisodeTitleCell',
'Cells/QualityCell',
2013-06-08 09:57:43 +02:00
'Shared/Toolbar/ToolbarLayout',
2013-06-14 02:41:46 +02:00
'Shared/Grid/Pager',
'Shared/Grid/HeaderCell',
2013-06-08 09:57:43 +02:00
'Shared/LoadingView'
2013-05-03 08:53:32 +02:00
],
2013-06-24 04:31:02 +02:00
function (App,
HistoryCollection,
EventTypeCell,
RelativeDateCell,
TemplatedCell,
SeriesTitleCell,
EpisodeNumberCell,
EpisodeTitleCell,
QualityCell,
ToolbarLayout,
Pager,
HeaderCell,
LoadingView) {
return Backbone.Marionette.Layout.extend({
2013-05-03 08:53:32 +02:00
template: 'History/HistoryLayoutTemplate',
regions: {
history: '#x-history',
toolbar: '#x-toolbar',
pager : '#x-pager'
},
columns: [
{
2013-06-11 03:55:05 +02:00
name: 'eventType',
label:'',
2013-06-24 04:31:02 +02:00
cell : EventTypeCell
},
{
name : 'series',
label : 'Series',
2013-06-24 04:31:02 +02:00
cell : SeriesTitleCell
},
{
name : 'episode',
label : 'Episode',
sortable: false,
2013-06-24 04:31:02 +02:00
cell : EpisodeNumberCell
},
{
name : 'episode',
label : 'Episode Title',
sortable: false,
2013-06-24 04:31:02 +02:00
cell : EpisodeTitleCell
},
{
2013-06-24 04:31:02 +02:00
name : 'quality',
label : 'Quality',
cell : QualityCell
},
{
name : 'date',
label: 'Date',
2013-06-24 04:31:02 +02:00
cell : RelativeDateCell
}
],
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'
}));
2013-06-24 04:31:02 +02:00
this.pager.show(new Pager({
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;
2013-06-24 04:31:02 +02:00
this.history.show(new LoadingView());
2013-06-08 09:57:43 +02:00
2013-06-24 04:31:02 +02:00
this.historyCollection = new HistoryCollection();
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}));
}
})
;
})
;