2013-04-23 05:07:21 +03:00
|
|
|
'use strict';
|
2013-06-09 23:51:32 +03:00
|
|
|
define([
|
|
|
|
'app',
|
|
|
|
'Cells/EpisodeStatusCell',
|
|
|
|
'Cells/EpisodeTitleCell',
|
|
|
|
'Cells/AirDateCell',
|
|
|
|
'Cells/ToggleCell'],
|
2013-06-24 05:31:02 +03:00
|
|
|
function (App, EpisodeStatusCell, EpisodeTitleCell, AirDateCell, ToggleCell) {
|
|
|
|
return Backbone.Marionette.Layout.extend({
|
2013-06-09 23:51:32 +03:00
|
|
|
template: 'Series/Details/SeasonLayoutTemplate',
|
2013-04-23 05:07:21 +03:00
|
|
|
|
2013-06-09 23:51:32 +03:00
|
|
|
regions: {
|
|
|
|
episodeGrid: '#x-episode-grid'
|
|
|
|
},
|
2013-04-23 05:07:21 +03:00
|
|
|
|
2013-06-09 23:51:32 +03:00
|
|
|
columns: [
|
2013-05-21 00:06:01 +03:00
|
|
|
|
2013-06-09 23:51:32 +03:00
|
|
|
{
|
|
|
|
name : 'ignored',
|
|
|
|
label : '',
|
2013-06-24 05:31:02 +03:00
|
|
|
cell : ToggleCell,
|
2013-06-09 23:51:32 +03:00
|
|
|
trueClass : 'icon-bookmark-empty',
|
|
|
|
falseClass: 'icon-bookmark'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'episodeNumber',
|
|
|
|
label: '#',
|
|
|
|
cell : Backgrid.IntegerCell.extend({
|
|
|
|
className: 'episode-number-cell'
|
|
|
|
})
|
|
|
|
},
|
2013-04-23 05:07:21 +03:00
|
|
|
|
2013-06-09 23:51:32 +03:00
|
|
|
{
|
|
|
|
name : 'this',
|
|
|
|
label: 'Title',
|
2013-06-24 05:31:02 +03:00
|
|
|
cell : EpisodeTitleCell
|
2013-06-09 23:51:32 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name : 'airDate',
|
|
|
|
label: 'Air Date',
|
2013-06-24 05:31:02 +03:00
|
|
|
cell : AirDateCell
|
2013-06-09 23:51:32 +03:00
|
|
|
} ,
|
|
|
|
{
|
|
|
|
name : 'status',
|
|
|
|
label: 'Status',
|
2013-06-24 05:31:02 +03:00
|
|
|
cell : EpisodeStatusCell
|
2013-06-09 23:51:32 +03:00
|
|
|
}
|
|
|
|
],
|
2013-04-23 05:07:21 +03:00
|
|
|
|
2013-06-09 23:51:32 +03:00
|
|
|
initialize: function (options) {
|
2013-06-01 22:31:39 +03:00
|
|
|
|
2013-06-09 23:51:32 +03:00
|
|
|
if (!options.episodeCollection) {
|
|
|
|
throw 'episodeCollection is needed';
|
|
|
|
}
|
2013-06-01 22:31:39 +03:00
|
|
|
|
2013-06-09 23:51:32 +03:00
|
|
|
this.episodeCollection = options.episodeCollection.bySeason(this.model.get('seasonNumber'));
|
|
|
|
},
|
2013-04-23 05:07:21 +03:00
|
|
|
|
2013-06-09 23:51:32 +03:00
|
|
|
onShow: function () {
|
|
|
|
this.episodeGrid.show(new Backgrid.Grid(
|
|
|
|
{
|
|
|
|
columns : this.columns,
|
|
|
|
collection: this.episodeCollection,
|
|
|
|
className : 'table table-hover season-grid'
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
});
|
2013-04-23 05:07:21 +03:00
|
|
|
});
|