fixing comments

This commit is contained in:
nek0 2017-01-06 17:33:33 +01:00
parent d33ced3d4a
commit ded1d9d99e
2 changed files with 4 additions and 4 deletions

View file

@ -50,11 +50,11 @@ getMediumR mediumId = do
comments <- runDB $ selectList
[ CommentOrigin ==. mediumId
, CommentParent ==. Nothing ]
[ Desc CommentTime ]
[ Asc CommentTime ]
replies <- runDB $ selectList
[ CommentOrigin ==. mediumId
, CommentParent !=. Nothing ]
[ Desc CommentTime ]
[ Asc CommentTime ]
let tr = StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb medium) []
pr = StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumPreview medium) []
ir = StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumPath medium) []

View file

@ -56,11 +56,11 @@
$forall (Entity replyId reply) <- replies
$if commentParent reply == Just commentId
<div .comment .reply .medium>
<a href=@{ProfileR $ commentAuthor reply}>#{fromMaybe "" $ lookup (commentAuthor comment) authors}</a> replied on #{formatTime defaultTimeLocale "%A %F %H:%M" $ commentTime reply}:
<a href=@{ProfileR $ commentAuthor reply}>#{fromMaybe "" $ lookup (commentAuthor reply) authors}</a> replied on #{formatTime defaultTimeLocale "%A %F %H:%M" $ commentTime reply}:
<hr>
#{commentContent reply}
<hr>
$if userId == (Just $ commentAuthor comment)
$if userId == (Just $ commentAuthor reply)
<a href=@{CommentDeleteR replyId}>Delete this comment
$if userId /= Nothing