about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--frontend/Main.elm21
1 files changed, 16 insertions, 5 deletions
diff --git a/frontend/Main.elm b/frontend/Main.elm
index 905dc2256320..8c5a8e1a5e0e 100644
--- a/frontend/Main.elm
+++ b/frontend/Main.elm
@@ -126,12 +126,22 @@ taskColor task =
         Color.Yellow
 
 
+within : Task -> String
 within task =
-    String.concat
-        [ "This task should be completed within "
-        , toString task.remaining
-        , " days."
-        ]
+    if task.remaining < 0 then
+        "This task is overdue!"
+    else if task.remaining > 2 then
+        String.concat
+            [ "Relax, this task has "
+            , toString task.remaining
+            , " days left before it is due."
+            ]
+    else
+        String.concat
+            [ "This task should be completed within "
+            , toString task.remaining
+            , " days. Consider doing it now!"
+            ]
 
 
 renderTask : Task -> Html Msg
@@ -141,6 +151,7 @@ renderTask task =
         [ Card.title [] [ Card.head [ white ] [ text task.name ] ]
         , Card.text [ white ]
             [ text (Maybe.withDefault "" task.description)
+            , Html.br [] []
             , text (within task)
             ]
         , Card.actions