2013-06-05 07:38:15 +02:00
|
|
|
"use strict";
|
|
|
|
define([
|
|
|
|
'app',
|
|
|
|
'Release/Collection',
|
2013-06-09 22:51:32 +02:00
|
|
|
'Release/ApprovalStatusCell',
|
2013-06-05 07:38:15 +02:00
|
|
|
'Shared/SpinnerView',
|
2013-06-08 01:54:46 +02:00
|
|
|
'Shared/Toolbar/ToolbarLayout',
|
2013-06-09 22:51:32 +02:00
|
|
|
'Cells/EpisodeNumberCell',
|
|
|
|
'Cells/FileSizeCell',
|
|
|
|
'Cells/IndexerCell'
|
2013-06-05 07:38:15 +02:00
|
|
|
],
|
|
|
|
function () {
|
|
|
|
NzbDrone.Release.Layout = Backbone.Marionette.Layout.extend({
|
|
|
|
template: 'Release/LayoutTemplate',
|
|
|
|
|
|
|
|
regions: {
|
|
|
|
grid : '#x-grid',
|
|
|
|
toolbar: '#x-toolbar'
|
|
|
|
},
|
|
|
|
|
|
|
|
columns: [
|
|
|
|
{
|
2013-06-08 19:29:19 +02:00
|
|
|
name : 'indexer',
|
|
|
|
label : 'Indexer',
|
2013-06-05 07:38:15 +02:00
|
|
|
sortable: true,
|
2013-06-09 22:51:32 +02:00
|
|
|
cell : NzbDrone.Cells.IndexerCell
|
2013-06-05 07:38:15 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'size',
|
|
|
|
label : 'Size',
|
|
|
|
sortable: true,
|
2013-06-09 22:51:32 +02:00
|
|
|
cell : NzbDrone.Cells.FileSizeCell
|
2013-06-05 07:38:15 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'title',
|
|
|
|
label : 'Title',
|
|
|
|
sortable: true,
|
|
|
|
cell : Backgrid.StringCell
|
|
|
|
},
|
|
|
|
{
|
2013-06-08 01:54:46 +02:00
|
|
|
name : 'episodeNumbers',
|
|
|
|
episodes: 'episodeNumbers',
|
|
|
|
label : 'season',
|
2013-06-09 22:51:32 +02:00
|
|
|
cell : NzbDrone.Cells.EpisodeNumberCell
|
2013-06-05 07:38:15 +02:00
|
|
|
},
|
|
|
|
{
|
2013-06-08 01:54:46 +02:00
|
|
|
name : 'rejections',
|
|
|
|
label: 'decision',
|
2013-06-09 22:51:32 +02:00
|
|
|
cell : NzbDrone.Release.ApprovalStatusCell
|
2013-06-05 07:38:15 +02:00
|
|
|
}
|
|
|
|
],
|
|
|
|
|
|
|
|
showTable: function () {
|
2013-06-08 01:54:46 +02:00
|
|
|
if (!this.isClosed) {
|
2013-06-05 07:38:15 +02:00
|
|
|
this.grid.show(new Backgrid.Grid(
|
|
|
|
{
|
|
|
|
row : Backgrid.Row,
|
|
|
|
columns : this.columns,
|
|
|
|
collection: this.collection,
|
|
|
|
className : 'table table-hover'
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
initialize: function () {
|
|
|
|
this.collection = new NzbDrone.Release.Collection();
|
|
|
|
this.fetchPromise = this.collection.fetch();
|
|
|
|
},
|
|
|
|
|
|
|
|
onShow: function () {
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
this.grid.show(new NzbDrone.Shared.SpinnerView());
|
|
|
|
|
|
|
|
this.fetchPromise.done(function () {
|
|
|
|
self.showTable();
|
|
|
|
});
|
|
|
|
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|