2013-10-02 05:20:30 +00:00
|
|
|
'use strict';
|
|
|
|
define(
|
|
|
|
[
|
|
|
|
'marionette',
|
|
|
|
'backgrid',
|
2014-10-12 07:29:09 +00:00
|
|
|
'Activity/Queue/QueueCollection',
|
2013-10-02 05:20:30 +00:00
|
|
|
'Cells/SeriesTitleCell',
|
|
|
|
'Cells/EpisodeNumberCell',
|
|
|
|
'Cells/EpisodeTitleCell',
|
|
|
|
'Cells/QualityCell',
|
2014-10-12 07:29:09 +00:00
|
|
|
'Activity/Queue/QueueStatusCell',
|
2014-12-03 00:47:45 +00:00
|
|
|
'Activity/Queue/QueueActionsCell',
|
2014-10-12 07:29:09 +00:00
|
|
|
'Activity/Queue/TimeleftCell',
|
2014-12-04 06:26:50 +00:00
|
|
|
'Activity/Queue/ProgressCell',
|
2015-01-31 08:24:09 +00:00
|
|
|
'Release/ProtocolCell',
|
2014-02-23 22:45:37 +00:00
|
|
|
'Shared/Grid/Pager'
|
2013-10-02 05:20:30 +00:00
|
|
|
], function (Marionette,
|
|
|
|
Backgrid,
|
|
|
|
QueueCollection,
|
|
|
|
SeriesTitleCell,
|
|
|
|
EpisodeNumberCell,
|
|
|
|
EpisodeTitleCell,
|
|
|
|
QualityCell,
|
2013-10-03 21:06:52 +00:00
|
|
|
QueueStatusCell,
|
2014-12-03 00:47:45 +00:00
|
|
|
QueueActionsCell,
|
2014-02-23 22:45:37 +00:00
|
|
|
TimeleftCell,
|
2014-12-04 06:26:50 +00:00
|
|
|
ProgressCell,
|
2015-01-31 08:24:09 +00:00
|
|
|
ProtocolCell,
|
2014-02-23 22:45:37 +00:00
|
|
|
GridPager) {
|
2013-10-02 05:20:30 +00:00
|
|
|
return Marionette.Layout.extend({
|
2014-10-12 07:29:09 +00:00
|
|
|
template: 'Activity/Queue/QueueLayoutTemplate',
|
2013-10-02 05:20:30 +00:00
|
|
|
|
|
|
|
regions: {
|
2014-02-23 22:45:37 +00:00
|
|
|
table: '#x-queue',
|
|
|
|
pager: '#x-queue-pager'
|
2013-10-02 05:20:30 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
columns:
|
|
|
|
[
|
2013-10-03 21:06:52 +00:00
|
|
|
{
|
2014-06-20 22:29:12 +00:00
|
|
|
name : 'status',
|
|
|
|
label : '',
|
|
|
|
cell : QueueStatusCell,
|
|
|
|
cellValue : 'this'
|
2013-10-03 21:06:52 +00:00
|
|
|
},
|
2013-10-02 05:20:30 +00:00
|
|
|
{
|
2014-06-20 22:29:12 +00:00
|
|
|
name : 'series',
|
|
|
|
label : 'Series',
|
|
|
|
cell : SeriesTitleCell,
|
|
|
|
sortable : false
|
2013-10-02 05:20:30 +00:00
|
|
|
},
|
|
|
|
{
|
2014-06-20 22:29:12 +00:00
|
|
|
name : 'episode',
|
|
|
|
label : 'Episode',
|
|
|
|
cell : EpisodeNumberCell,
|
|
|
|
sortable : false
|
2013-10-02 05:20:30 +00:00
|
|
|
},
|
|
|
|
{
|
2014-06-20 22:29:12 +00:00
|
|
|
name : 'episode',
|
|
|
|
label : 'Episode Title',
|
|
|
|
cell : EpisodeTitleCell,
|
|
|
|
sortable : false
|
2013-10-02 05:20:30 +00:00
|
|
|
},
|
|
|
|
{
|
2014-06-20 22:29:12 +00:00
|
|
|
name : 'quality',
|
|
|
|
label : 'Quality',
|
|
|
|
cell : QualityCell,
|
|
|
|
sortable : false
|
2013-10-02 05:20:30 +00:00
|
|
|
},
|
2015-01-31 08:24:09 +00:00
|
|
|
{
|
|
|
|
name : 'protocol',
|
|
|
|
label : 'Protocol',
|
|
|
|
cell : ProtocolCell
|
|
|
|
},
|
2013-10-02 05:20:30 +00:00
|
|
|
{
|
|
|
|
name : 'timeleft',
|
|
|
|
label : 'Timeleft',
|
|
|
|
cell : TimeleftCell,
|
|
|
|
cellValue : 'this'
|
2014-12-04 06:26:50 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'episode',
|
|
|
|
label : 'Progress',
|
|
|
|
cell : ProgressCell,
|
|
|
|
cellValue : 'this'
|
2014-12-03 00:47:45 +00:00
|
|
|
},
|
2015-01-11 19:49:09 +00:00
|
|
|
{
|
|
|
|
name : 'status',
|
|
|
|
label : '',
|
|
|
|
cell : QueueActionsCell,
|
|
|
|
cellValue : 'this'
|
|
|
|
}
|
2013-10-02 05:20:30 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
initialize: function () {
|
|
|
|
this.listenTo(QueueCollection, 'sync', this._showTable);
|
|
|
|
},
|
|
|
|
|
|
|
|
onShow: function () {
|
|
|
|
this._showTable();
|
|
|
|
},
|
|
|
|
|
|
|
|
_showTable: function () {
|
|
|
|
this.table.show(new Backgrid.Grid({
|
|
|
|
columns : this.columns,
|
|
|
|
collection: QueueCollection,
|
|
|
|
className : 'table table-hover'
|
|
|
|
}));
|
2014-02-23 22:45:37 +00:00
|
|
|
|
|
|
|
this.pager.show(new GridPager({
|
|
|
|
columns : this.columns,
|
|
|
|
collection: QueueCollection
|
|
|
|
}));
|
2013-10-02 05:20:30 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|