summaryrefslogtreecommitdiff
path: root/Omni/Jr/Web.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Jr/Web.hs')
-rw-r--r--Omni/Jr/Web.hs13
1 files changed, 11 insertions, 2 deletions
diff --git a/Omni/Jr/Web.hs b/Omni/Jr/Web.hs
index 88e0442..d191454 100644
--- a/Omni/Jr/Web.hs
+++ b/Omni/Jr/Web.hs
@@ -1624,7 +1624,16 @@ instance Lucid.ToHtml TaskDetailPage where
renderComment currentTime c =
Lucid.div_ [Lucid.class_ "comment-card"] <| do
Lucid.p_ [Lucid.class_ "comment-text"] (Lucid.toHtml (TaskCore.commentText c))
- Lucid.span_ [Lucid.class_ "comment-time"] (renderRelativeTimestamp currentTime (TaskCore.commentCreatedAt c))
+ Lucid.div_ [Lucid.class_ "comment-meta"] <| do
+ Lucid.span_ [Lucid.class_ ("comment-author " <> authorClass)] (Lucid.toHtml (authorLabel (TaskCore.commentAuthor c)))
+ Lucid.span_ [Lucid.class_ "comment-time"] (renderRelativeTimestamp currentTime (TaskCore.commentCreatedAt c))
+ where
+ authorClass = case TaskCore.commentAuthor c of
+ TaskCore.Human -> "author-human"
+ TaskCore.Junior -> "author-junior"
+ authorLabel author = case author of
+ TaskCore.Human -> "Human" :: Text
+ TaskCore.Junior -> "Junior" :: Text
commentForm :: (Monad m) => Text -> Lucid.HtmlT m ()
commentForm tid =
@@ -2880,7 +2889,7 @@ server =
taskCommentHandler :: Text -> CommentForm -> Servant.Handler (Headers '[Header "Location" Text] NoContent)
taskCommentHandler tid (CommentForm commentText) = do
- _ <- liftIO (TaskCore.addComment tid commentText)
+ _ <- liftIO (TaskCore.addComment tid commentText TaskCore.Human)
pure <| addHeader ("/tasks/" <> tid) NoContent
taskReviewHandler :: Text -> Servant.Handler TaskReviewPage