1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/UI/Series/Details/SeasonLayout.js

69 lines
2.0 KiB
JavaScript
Raw Normal View History

2013-04-23 05:07:21 +03:00
'use strict';
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({
template: 'Series/Details/SeasonLayoutTemplate',
2013-04-23 05:07:21 +03:00
regions: {
episodeGrid: '#x-episode-grid'
},
2013-04-23 05:07:21 +03:00
columns: [
2013-05-21 00:06:01 +03:00
{
name : 'ignored',
label : '',
2013-06-24 05:31:02 +03:00
cell : ToggleCell,
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
{
name : 'this',
label: 'Title',
2013-06-24 05:31:02 +03:00
cell : EpisodeTitleCell
},
{
name : 'airDate',
label: 'Air Date',
2013-06-24 05:31:02 +03:00
cell : AirDateCell
} ,
{
name : 'status',
label: 'Status',
2013-06-24 05:31:02 +03:00
cell : EpisodeStatusCell
}
],
2013-04-23 05:07:21 +03:00
initialize: function (options) {
if (!options.episodeCollection) {
throw 'episodeCollection is needed';
}
this.episodeCollection = options.episodeCollection.bySeason(this.model.get('seasonNumber'));
},
2013-04-23 05:07:21 +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
});