2013-04-23 02:07:21 +00:00
|
|
|
|
'use strict';
|
2013-05-21 00:17:33 +00:00
|
|
|
|
define(['app', 'Series/Details/EpisodeStatusCell', 'Series/Details/EpisodeTitleCell'], function () {
|
2013-04-23 02:07:21 +00:00
|
|
|
|
NzbDrone.Series.Details.SeasonLayout = Backbone.Marionette.Layout.extend({
|
|
|
|
|
template: 'Series/Details/SeasonLayoutTemplate',
|
|
|
|
|
|
|
|
|
|
regions: {
|
|
|
|
|
episodeGrid: '#x-episode-grid'
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
columns: [
|
2013-05-20 21:06:01 +00:00
|
|
|
|
|
2013-05-15 01:17:24 +00:00
|
|
|
|
{
|
2013-05-20 21:06:01 +00:00
|
|
|
|
name : 'episodeNumber',
|
|
|
|
|
label: '#',
|
2013-05-20 21:42:20 +00:00
|
|
|
|
cell : Backgrid.IntegerCell.extend({
|
|
|
|
|
className: 'episode-number-cell'
|
|
|
|
|
})
|
2013-04-23 02:07:21 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
2013-05-20 21:06:01 +00:00
|
|
|
|
name : 'title',
|
|
|
|
|
label: 'Title',
|
2013-05-21 00:17:33 +00:00
|
|
|
|
cell : NzbDrone.Series.Details.EpisodeTitleCell
|
2013-04-23 02:07:21 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
2013-05-20 21:06:01 +00:00
|
|
|
|
name : 'airDate',
|
|
|
|
|
label: 'Air Date',
|
2013-05-20 21:42:20 +00:00
|
|
|
|
cell : Backgrid.DateCell.extend({
|
|
|
|
|
className: 'episode-air-date-cell'
|
|
|
|
|
})
|
2013-05-20 21:06:01 +00:00
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
name : 'status',
|
|
|
|
|
label: 'Status',
|
|
|
|
|
cell : NzbDrone.Series.Details.EpisodeStatusCell
|
2013-04-23 02:07:21 +00:00
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
|
2013-06-01 19:31:39 +00:00
|
|
|
|
initialize: function (options) {
|
|
|
|
|
|
|
|
|
|
if (!options.episodeCollection) {
|
|
|
|
|
throw 'episodeCollection is needed';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.episodeCollection = options.episodeCollection.bySeason(this.model.get('seasonNumber'));
|
2013-04-23 02:07:21 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onShow: function () {
|
|
|
|
|
this.episodeGrid.show(new Backgrid.Grid(
|
|
|
|
|
{
|
|
|
|
|
columns : this.columns,
|
|
|
|
|
collection: this.episodeCollection,
|
|
|
|
|
className : 'table table-hover'
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|