diff --git a/NzbDrone.Api/Series/SeriesModule.cs b/NzbDrone.Api/Series/SeriesModule.cs index 86cab1a8e..b6e33922f 100644 --- a/NzbDrone.Api/Series/SeriesModule.cs +++ b/NzbDrone.Api/Series/SeriesModule.cs @@ -88,11 +88,6 @@ namespace NzbDrone.Api.Series private SeriesResource AddSeries(SeriesResource seriesResource) { - //Todo: Alert the user if this series already exists - //Todo: We need to create the folder if the user is adding a new series - //(we can just create the folder and it won't blow up if it already exists) - //We also need to remove any special characters from the filename before attempting to create it - return ToResource(_seriesService.AddSeries, seriesResource); } diff --git a/UI/Series/Details/SeasonLayoutTemplate.html b/UI/Series/Details/SeasonLayoutTemplate.html index efa58f097..a4cdad5fc 100644 --- a/UI/Series/Details/SeasonLayoutTemplate.html +++ b/UI/Series/Details/SeasonLayoutTemplate.html @@ -3,7 +3,7 @@ {{seasonTitle}} - +
diff --git a/UI/Series/Details/SeriesDetailsLayout.js b/UI/Series/Details/SeriesDetailsLayout.js index 8d4c08c0b..6dba647b3 100644 --- a/UI/Series/Details/SeriesDetailsLayout.js +++ b/UI/Series/Details/SeriesDetailsLayout.js @@ -1,13 +1,16 @@ 'use strict'; define( [ + 'app', 'marionette', 'Series/EpisodeCollection', 'Series/SeasonCollection', 'Series/Details/SeasonCollectionView', + 'Series/Edit/EditSeriesView', 'Shared/LoadingView', + 'Commands/CommandController', 'backstrech' - ], function (Marionette, EpisodeCollection, SeasonCollection, SeasonCollectionView, LoadingView) { + ], function (App, Marionette, EpisodeCollection, SeasonCollection, SeasonCollectionView, EditSeriesView, LoadingView, CommandController) { return Marionette.Layout.extend({ itemViewContainer: '.x-series-seasons', @@ -18,11 +21,24 @@ define( }, ui: { - header: '.x-header' + header : '.x-header', + monitored: '.x-monitored', + edit : '.x-edit', + refresh : '.x-refresh' + }, + + events: { + 'click .x-monitored': '_toggleMonitored', + 'click .x-edit' : '_editSeries', + 'click .x-refresh' : '_refreshSeries' }, initialize: function () { $('body').addClass('backdrop'); + + this.model.on('sync', function () { + this._setMonitoredState() + }, this); }, onShow: function () { @@ -47,11 +63,58 @@ define( series : self.model })); }); + + this._setMonitoredState(); }, onClose: function () { $('.backstretch').remove(); $('body').removeClass('backdrop'); + }, + + _toggleMonitored: function () { + var self = this; + var name = 'monitored'; + this.model.set(name, !this.model.get(name), { silent: true }); + + this.ui.monitored.addClass('icon-spinner icon-spin'); + + var promise = this.model.save(); + + promise.always(function (){ + self._setMonitoredState(); + }); + }, + + _setMonitoredState: function () { + var monitored = this.model.get('monitored'); + + this.ui.monitored.removeClass('icon-spinner icon-spin'); + + if (this.model.get('monitored')) { + this.ui.monitored.addClass('icon-bookmark'); + this.ui.monitored.removeClass('icon-bookmark-empty'); + } + else { + this.ui.monitored.addClass('icon-bookmark-empty'); + this.ui.monitored.removeClass('icon-bookmark'); + } + }, + + _editSeries: function () { + var view = new EditSeriesView({ model: this.model }); + App.modalRegion.show(view); + }, + + _refreshSeries: function () { + var self = this; + + this.ui.refresh.addClass('icon-spinner icon-spin'); + var promise = CommandController.Execute('refreshseries', { seriesId: this.model.get('id') }); + + promise.always(function () { + self.ui.refresh.removeClass('icon-spinner icon-spin'); + }); } }); }); diff --git a/UI/Series/Details/SeriesDetailsTemplate.html b/UI/Series/Details/SeriesDetailsTemplate.html index dd933f674..d06e564ab 100644 --- a/UI/Series/Details/SeriesDetailsTemplate.html +++ b/UI/Series/Details/SeriesDetailsTemplate.html @@ -1,7 +1,14 @@ 
-

{{title}}

+

+ {{title}} + + + + + +

{{overview}} diff --git a/UI/Series/series.less b/UI/Series/series.less index 1b2ef2d04..19976483f 100644 --- a/UI/Series/series.less +++ b/UI/Series/series.less @@ -183,7 +183,7 @@ } } -.season-actions { +.season-actions, .series-actions { font-size : 24px; text-transform: none;