From 7d35adebf32897889be501fcb353ca5e1b5fec9e Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 13 Aug 2013 16:42:16 -0700 Subject: [PATCH] Reload series info on model sync (details) --- UI/Series/Details/InfoView.js | 10 +++++++++ UI/Series/Details/InfoViewTemplate.html | 19 +++++++++++++++++ UI/Series/Details/SeriesDetailsLayout.js | 14 ++++++++++--- UI/Series/Details/SeriesDetailsTemplate.html | 22 ++------------------ 4 files changed, 42 insertions(+), 23 deletions(-) create mode 100644 UI/Series/Details/InfoView.js create mode 100644 UI/Series/Details/InfoViewTemplate.html diff --git a/UI/Series/Details/InfoView.js b/UI/Series/Details/InfoView.js new file mode 100644 index 000000000..c3b5a6a31 --- /dev/null +++ b/UI/Series/Details/InfoView.js @@ -0,0 +1,10 @@ +'use strict'; +define( + [ + 'marionette' + ], function (Marionette) { + + return Marionette.ItemView.extend({ + template: 'Series/Details/InfoViewTemplate' + }); + }); diff --git a/UI/Series/Details/InfoViewTemplate.html b/UI/Series/Details/InfoViewTemplate.html new file mode 100644 index 000000000..5c3753ea0 --- /dev/null +++ b/UI/Series/Details/InfoViewTemplate.html @@ -0,0 +1,19 @@ +{{qualityProfile qualityProfileId}} +{{network}} +{{runtime}} minutes +{{path}} + + Trakt + + {{#if imdbId}} + IMDB + {{/if}} + + {{#if tvdbId}} + TVDB + {{/if}} + + {{#if tvRageId}} + TVRage + {{/if}} + \ No newline at end of file diff --git a/UI/Series/Details/SeriesDetailsLayout.js b/UI/Series/Details/SeriesDetailsLayout.js index 7e456df90..7caf68aee 100644 --- a/UI/Series/Details/SeriesDetailsLayout.js +++ b/UI/Series/Details/SeriesDetailsLayout.js @@ -7,11 +7,12 @@ define( 'Series/SeasonCollection', 'Series/Details/SeasonCollectionView', 'Series/Details/SeasonMenu/CollectionView', + 'Series/Details/InfoView', 'Shared/LoadingView', 'Shared/Actioneer', 'backstrech', 'Mixins/backbone.signalr.mixin' - ], function (App, Marionette, EpisodeCollection, SeasonCollection, SeasonCollectionView, SeasonMenuCollectionView, LoadingView, Actioneer) { + ], function (App, Marionette, EpisodeCollection, SeasonCollection, SeasonCollectionView, SeasonMenuCollectionView, InfoView, LoadingView, Actioneer) { return Marionette.Layout.extend({ itemViewContainer: '.x-series-seasons', @@ -19,7 +20,8 @@ define( regions: { seasonMenu: '#season-menu', - seasons : '#seasons' + seasons : '#seasons', + info : '#info' }, ui: { @@ -43,7 +45,8 @@ define( $('body').addClass('backdrop'); this.listenTo(this.model, 'sync', function () { - this._setMonitoredState() + this._setMonitoredState(); + this._showInfo(); }, this); this.listenTo(App.vent, App.Events.SeriesDeleted, this._onSeriesDeleted); @@ -61,6 +64,7 @@ define( this._showSeasons(); this._setMonitoredState(); + this._showInfo(); }, _getFanArt: function () { @@ -178,6 +182,10 @@ define( episodeCollection: self.episodeCollection })); }); + }, + + _showInfo: function () { + this.info.show(new InfoView({ model: this.model })); } }); }); diff --git a/UI/Series/Details/SeriesDetailsTemplate.html b/UI/Series/Details/SeriesDetailsTemplate.html index 3a5f601d3..cef95f4e3 100644 --- a/UI/Series/Details/SeriesDetailsTemplate.html +++ b/UI/Series/Details/SeriesDetailsTemplate.html @@ -12,29 +12,11 @@ -
+
{{overview}}
-
- {{qualityProfile qualityProfileId}} - {{network}} - {{runtime}} minutes - {{path}} - - Trakt - - {{#if imdbId}} - IMDB - {{/if}} - - {{#if tvdbId}} - TVDB - {{/if}} +
- {{#if tvRageId}} - TVRage - {{/if}} -