2013-06-05 08:38:15 +03:00
|
|
|
"use strict";
|
|
|
|
define([
|
|
|
|
'app',
|
|
|
|
'Release/Collection',
|
2013-06-09 23:51:32 +03:00
|
|
|
'Release/ApprovalStatusCell',
|
2013-06-05 08:38:15 +03:00
|
|
|
'Shared/SpinnerView',
|
2013-06-08 02:54:46 +03:00
|
|
|
'Shared/Toolbar/ToolbarLayout',
|
2013-06-09 23:51:32 +03:00
|
|
|
'Cells/EpisodeNumberCell',
|
|
|
|
'Cells/FileSizeCell',
|
2013-06-10 05:16:48 +03:00
|
|
|
'Cells/IndexerCell',
|
|
|
|
'Cells/QualityCell'
|
2013-06-05 08:38:15 +03:00
|
|
|
],
|
|
|
|
function () {
|
|
|
|
NzbDrone.Release.Layout = Backbone.Marionette.Layout.extend({
|
|
|
|
template: 'Release/LayoutTemplate',
|
|
|
|
|
|
|
|
regions: {
|
|
|
|
grid : '#x-grid',
|
|
|
|
toolbar: '#x-toolbar'
|
|
|
|
},
|
|
|
|
|
|
|
|
columns: [
|
|
|
|
{
|
2013-06-08 20:29:19 +03:00
|
|
|
name : 'indexer',
|
|
|
|
label : 'Indexer',
|
2013-06-05 08:38:15 +03:00
|
|
|
sortable: true,
|
2013-06-09 23:51:32 +03:00
|
|
|
cell : NzbDrone.Cells.IndexerCell
|
2013-06-05 08:38:15 +03:00
|
|
|
},
|
2013-06-10 05:16:48 +03:00
|
|
|
|
2013-06-05 08:38:15 +03:00
|
|
|
{
|
|
|
|
name : 'title',
|
|
|
|
label : 'Title',
|
|
|
|
sortable: true,
|
|
|
|
cell : Backgrid.StringCell
|
|
|
|
},
|
|
|
|
{
|
2013-06-08 02:54:46 +03:00
|
|
|
name : 'episodeNumbers',
|
|
|
|
episodes: 'episodeNumbers',
|
|
|
|
label : 'season',
|
2013-06-09 23:51:32 +03:00
|
|
|
cell : NzbDrone.Cells.EpisodeNumberCell
|
2013-06-05 08:38:15 +03:00
|
|
|
},
|
2013-06-10 05:16:48 +03:00
|
|
|
{
|
|
|
|
name : 'size',
|
|
|
|
label : 'Size',
|
|
|
|
sortable: true,
|
|
|
|
cell : NzbDrone.Cells.FileSizeCell
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'quality',
|
|
|
|
label : 'Quality',
|
|
|
|
sortable: true,
|
|
|
|
cell : NzbDrone.Cells.QualityCell
|
|
|
|
},
|
|
|
|
|
2013-06-05 08:38:15 +03:00
|
|
|
{
|
2013-06-08 02:54:46 +03:00
|
|
|
name : 'rejections',
|
|
|
|
label: 'decision',
|
2013-06-09 23:51:32 +03:00
|
|
|
cell : NzbDrone.Release.ApprovalStatusCell
|
2013-06-05 08:38:15 +03:00
|
|
|
}
|
|
|
|
],
|
|
|
|
|
|
|
|
showTable: function () {
|
2013-06-08 02:54:46 +03:00
|
|
|
if (!this.isClosed) {
|
2013-06-05 08:38:15 +03: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}));
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|