diff --git a/UI/Calendar/CalendarView.js b/UI/Calendar/CalendarView.js index 042960ca1..4c85e7325 100644 --- a/UI/Calendar/CalendarView.js +++ b/UI/Calendar/CalendarView.js @@ -57,14 +57,17 @@ define( success: function (calendarCollection) { _.each(calendarCollection.models, function (element) { var episodeTitle = element.get('title'); - var seriesTitle = element.get('series').get('title'); + var seriesTitle = element.get('series').title; var start = element.get('airDateUtc'); var statusLevel = _instance.getStatusLevel(element); + var runtime = element.get('series').runtime; + var end = Moment(start).add('minutes', runtime); element.set({ title : seriesTitle, episodeTitle: episodeTitle, start : start, + end : end, allDay : false, statusLevel : statusLevel }); diff --git a/UI/Cells/EpisodeStatusCell.js b/UI/Cells/EpisodeStatusCell.js index 3f335cefa..36ab0b72d 100644 --- a/UI/Cells/EpisodeStatusCell.js +++ b/UI/Cells/EpisodeStatusCell.js @@ -2,11 +2,11 @@ define( [ - 'backgrid', + 'Cells/NzbDroneCell', 'moment', 'Shared/FormatHelpers' - ], function (Backgrid, Moment, FormatHelpers) { - return Backgrid.Cell.extend({ + ], function (NzbDroneCell, Moment, FormatHelpers) { + return NzbDroneCell.extend({ className: 'episode-status-cell', diff --git a/UI/Cells/EpisodeTitleCell.js b/UI/Cells/EpisodeTitleCell.js index 578952623..f5e2651c9 100644 --- a/UI/Cells/EpisodeTitleCell.js +++ b/UI/Cells/EpisodeTitleCell.js @@ -25,7 +25,9 @@ define( }, _showDetails: function () { - App.vent.trigger(App.Commands.ShowEpisodeDetails, {episode: this.cellValue}); + var hideSeriesLink = this.column.get('hideSeriesLink'); + + App.vent.trigger(App.Commands.ShowEpisodeDetails, {episode: this.cellValue, hideSeriesLink: hideSeriesLink }); } }); }); diff --git a/UI/Episode/Layout.js b/UI/Episode/Layout.js index bfb75aca9..15f819a48 100644 --- a/UI/Episode/Layout.js +++ b/UI/Episode/Layout.js @@ -3,8 +3,9 @@ define( [ 'marionette', 'Episode/Summary/Layout', - 'Episode/Search/Layout' - ], function (Marionette, SummaryLayout, SearchLayout) { + 'Episode/Search/Layout', + 'Series/SeriesCollection' + ], function (Marionette, SummaryLayout, SearchLayout, SeriesCollection) { return Marionette.Layout.extend({ template: 'Episode/LayoutTemplate', @@ -30,6 +31,16 @@ define( 'click .x-episode-monitored': '_toggleMonitored' }, + templateHelpers: {}, + + initialize: function (options) { + this.templateHelpers.hideSeriesLink = options.hideSeriesLink; + + var series = SeriesCollection.find({ id: this.model.get('seriesId') }); + this.templateHelpers.series = series.toJSON(); + var test = 1; + }, + onShow: function () { this._showSummary(); this.searchLayout = new SearchLayout({ model: this.model }); diff --git a/UI/Episode/LayoutTemplate.html b/UI/Episode/LayoutTemplate.html index 982110d6a..c93e1f98c 100644 --- a/UI/Episode/LayoutTemplate.html +++ b/UI/Episode/LayoutTemplate.html @@ -3,6 +3,7 @@