From 08b7480f51f6072ba70b8739301b1ba5d1df1213 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 20 Sep 2016 09:43:31 +0100 Subject: Uses variable Added red text if overdue --- app/views/dashboard/todos/_todo.html.haml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/views/dashboard') diff --git a/app/views/dashboard/todos/_todo.html.haml b/app/views/dashboard/todos/_todo.html.haml index c729bbec5b5..06ea5675a0f 100644 --- a/app/views/dashboard/todos/_todo.html.haml +++ b/app/views/dashboard/todos/_todo.html.haml @@ -21,10 +21,12 @@ · #{time_ago_with_tooltip(todo.created_at)} - if todo.target.try(:due_date) + - is_due_today = todo.target.due_date.try(:today?) + - is_overdue = todo.target.try(:overdue?) · - %span{ class: ('text-warning' if todo.target.due_date.try(:today?)) } + %span{ class: [('text-warning' if is_due_today), ('text-danger' if is_overdue)] } Due - - if todo.target.due_date.try(:today?) + - if is_due_today today - else = todo.target.due_date.to_s(:medium) -- cgit v1.2.1