1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-29 11:25:26 +00:00
Radarr/UI/History/HistoryLayout.js

88 lines
2.7 KiB
JavaScript
Raw Normal View History

2013-06-22 06:24:24 +00:00
'use strict';
define(
[
'marionette',
'backgrid',
'History/Collection',
'History/EventTypeCell',
'Cells/SeriesTitleCell',
'Cells/EpisodeNumberCell',
'Cells/EpisodeTitleCell',
'Cells/QualityCell',
'Cells/RelativeDateCell',
'Shared/Grid/Pager',
'Shared/LoadingView'
], function (Marionette, Backgrid, HistoryCollection, EventTypeCell, SeriesTitleCell, EpisodeNumberCell, EpisodeTitleCell, QualityCell, RelativeDateCell, GridPager, LoadingView) {
return Marionette.Layout.extend({
2013-05-03 06:53:32 +00:00
template: 'History/HistoryLayoutTemplate',
regions: {
history: '#x-history',
toolbar: '#x-toolbar',
pager : '#x-pager'
},
columns:
[
{
name : 'eventType',
label: '',
cell : EventTypeCell
},
{
name : 'series',
label: 'Series',
cell : SeriesTitleCell
},
{
name : 'episode',
label : 'Episode',
sortable: false,
cell : EpisodeNumberCell
},
{
name : 'episode',
label : 'Episode Title',
sortable: false,
cell : EpisodeTitleCell
},
{
name : 'quality',
label: 'Quality',
cell : QualityCell
},
{
name : 'date',
label: 'Date',
cell : RelativeDateCell
}
],
2013-05-03 06:53:32 +00:00
_showTable: function (collection) {
2013-05-03 06:53:32 +00:00
this.history.show(new Backgrid.Grid({
columns : this.columns,
collection: collection,
className : 'table table-hover'
}));
2013-05-03 06:53:32 +00:00
this.pager.show(new GridPager({
columns : this.columns,
collection: collection
2013-05-03 06:53:32 +00:00
}));
},
2013-06-08 07:57:43 +00:00
onShow: function () {
var self = this;
2013-06-24 02:31:02 +00:00
this.history.show(new LoadingView());
2013-06-08 07:57:43 +00:00
var collection = new HistoryCollection();
collection.fetch().done(function () {
self._showTable(collection);
});
2013-05-03 06:53:32 +00:00
}
});
});