diff --git a/UI/Calendar/CalendarView.js b/UI/Calendar/CalendarView.js index 91976be28..6ba4f40cc 100644 --- a/UI/Calendar/CalendarView.js +++ b/UI/Calendar/CalendarView.js @@ -60,12 +60,14 @@ define( var episodeTitle = element.get('title'); var seriesTitle = element.get('series').get('title'); var start = element.get('airDate'); + var statusLevel = _instance.getStatusLevel(element); element.set({ - 'title': seriesTitle, + title : seriesTitle, episodeTitle: episodeTitle, - start: start, - allDay: false + start : start, + allDay : false, + statusLevel : statusLevel }); element.set('model', element); @@ -74,6 +76,27 @@ define( callback(calendarCollection.toJSON()); } }); + }, + + getStatusLevel: function (element) { + var hasFile = element.get('hasFile'); + var currentTime = Date.create(); + var start = Date.create(element.get('airDate')); + var end = Date.create(element.get('end')); + + if (currentTime.isBetween(start, end)) { + return 'warning'; + } + + if (start.isBefore(currentTime) && !hasFile) { + return 'danger'; + } + + if (hasFile) { + return 'success'; + } + + return 'primary'; } }); }); diff --git a/UI/Calendar/UpcomingItemTemplate.html b/UI/Calendar/UpcomingItemTemplate.html index af9fd5854..f8b4a8ee9 100644 --- a/UI/Calendar/UpcomingItemTemplate.html +++ b/UI/Calendar/UpcomingItemTemplate.html @@ -1,11 +1,11 @@ 
-
-

{{day}}

-

{{month}}

+
+

{{Day airDate}}

+

{{Month airDate}}

{{series.title}}

-

{{startTime}} {{ShortDate airDate}}{{seasonNumber}}x{{paddedEpisodeNumber}}
{{episodeTitle}}

+

{{StartTime airDate}} {{ShortDate airDate}}{{seasonNumber}}x{{Pad2 episodeNumber}}
{{episodeTitle}}

{{title}}

diff --git a/UI/Episode/LayoutTemplate.html b/UI/Episode/LayoutTemplate.html index 35048ed7a..7cbe5ba2b 100644 --- a/UI/Episode/LayoutTemplate.html +++ b/UI/Episode/LayoutTemplate.html @@ -3,9 +3,9 @@ {{#if episodeTitle}} -

{{episodeTitle}} - {{episodeNumberHelper}}

+

{{episodeTitle}} - {{EpisodeNumber}}

{{else}} -

{{title}} - {{episodeNumberHelper}}

+

{{title}} - {{EpisodeNumber}}

{{/if}}