Series monitored visible on seasons/episodes on details page and episode details modal

New: Visual indication on season/episode when series is not monitored
New: Prevent changing monitored state when series is not monitored
This commit is contained in:
Mark McDowall
2014-02-26 19:11:50 -08:00
parent 4478f2d723
commit d44b220fd0
8 changed files with 96 additions and 10 deletions

View File

@@ -4,15 +4,27 @@ define(
'vent',
'marionette',
'backgrid',
'Cells/ToggleCell',
'Cells/EpisodeMonitoredCell',
'Cells/EpisodeTitleCell',
'Cells/RelativeDateCell',
'Cells/EpisodeStatusCell',
'Cells/EpisodeActionsCell',
'Commands/CommandController',
'moment',
'underscore'
], function (vent, Marionette, Backgrid, ToggleCell, EpisodeTitleCell, RelativeDateCell, EpisodeStatusCell, EpisodeActionsCell, CommandController, Moment, _) {
'underscore',
'Shared/Messenger'
], function (vent,
Marionette,
Backgrid,
ToggleCell,
EpisodeTitleCell,
RelativeDateCell,
EpisodeStatusCell,
EpisodeActionsCell,
CommandController,
Moment,
_,
Messenger) {
return Marionette.Layout.extend({
template: 'Series/Details/SeasonLayoutTemplate',
@@ -95,7 +107,6 @@ define(
onRender: function () {
if (this.showingEpisodes) {
this._showEpisodes();
}
@@ -135,6 +146,16 @@ define(
},
_seasonMonitored: function () {
if (!this.series.get('monitored')) {
Messenger.show({
message: 'Unable to change monitored state when series is not monitored',
type : 'error'
});
return;
}
var name = 'monitored';
this.model.set(name, !this.model.get(name));
this.series.setSeasonMonitored(this.model.get('seasonNumber'));