From 8d2fc4945b0635baf9a3a2e1e0d25c0149108bc6 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 17 Jul 2013 22:52:13 -0700 Subject: [PATCH] Calendar past events are grayed out, today's background is gray --- UI/Calendar/CalendarView.js | 20 ++++++++++++++------ UI/Calendar/calendar.less | 8 ++++++++ UI/Cells/EpisodeStatusCell.js | 2 +- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/UI/Calendar/CalendarView.js b/UI/Calendar/CalendarView.js index 5a33ba980..beb91f929 100644 --- a/UI/Calendar/CalendarView.js +++ b/UI/Calendar/CalendarView.js @@ -85,19 +85,27 @@ define( var start = Moment(element.get('airDate')); var end = Moment(element.get('end')); + var statusLevel = 'primary'; + if (currentTime.isAfter(start) && currentTime.isBefore(end)) { - return 'warning'; + statusLevel = 'warning'; } - if (start.isBefore(currentTime) && !hasFile) { - return 'danger'; + else if (start.isBefore(currentTime) && !hasFile) { + statusLevel = 'danger'; } - if (hasFile) { - return 'success'; + else if (hasFile) { + statusLevel = 'success'; } - return 'primary'; + var test = currentTime.startOf('day').format('LLLL'); + + if (end.isBefore(currentTime.startOf('day'))) { + statusLevel += ' past' + } + + return statusLevel; } }); }); diff --git a/UI/Calendar/calendar.less b/UI/Calendar/calendar.less index c3dd3b5b7..6e45f181a 100644 --- a/UI/Calendar/calendar.less +++ b/UI/Calendar/calendar.less @@ -26,6 +26,14 @@ h2 { font-size : 17.5px; } + + .fc-state-highlight { + background: #f1f1f1; + } + + .past { + opacity: 0.8; + } } .event { diff --git a/UI/Cells/EpisodeStatusCell.js b/UI/Cells/EpisodeStatusCell.js index 8fa3855a2..b467c3d07 100644 --- a/UI/Cells/EpisodeStatusCell.js +++ b/UI/Cells/EpisodeStatusCell.js @@ -39,7 +39,7 @@ define( tooltip = 'Episode has not aired'; } } - + this.$el.html(''.format(icon, tooltip)); }