about summary refs log tree commit diff
path: root/src/Blog.hs
diff options
context:
space:
mode:
author"Vincent Ambo ext:(%22) <tazjin@me.com>2012-02-23T23·03+0100
committer"Vincent Ambo ext:(%22) <tazjin@me.com>2012-02-23T23·03+0100
commit066762051abe5739e956aeb5f369c58c02703010 (patch)
tree7e3ffb0a75e79588a8de39d37459de0254a561ac /src/Blog.hs
parentd04d693eb9047d0ce10ae1244f4de1678d0d117a (diff)
* rendering comments
Diffstat (limited to 'src/Blog.hs')
-rw-r--r--src/Blog.hs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Blog.hs b/src/Blog.hs
index 1caa021d54..80d6c45871 100644
--- a/src/Blog.hs
+++ b/src/Blog.hs
@@ -91,17 +91,20 @@ renderEntry entry = H.div ! A.class_ "innerBox" $ do
 renderComments :: [Comment] -> BlogLang -> Html
 renderComments [] DE = H.li $ toHtml (" Keine Kommentare" :: String)
 renderComments [] EN = H.li $ toHtml (" No comments yet" :: String)
-renderComments comments _ = sequence_ $ map showComment comments
+renderComments comments lang = sequence_ $ map showComment comments
     where
         showComment :: Comment -> Html
         showComment c = H.li $ do
-            H.a ! A.name (toValue $ cdate c) ! A.href (toValue $ "#" ++ show c) $
+            H.a ! A.name (toValue $ cdate c) ! A.href (toValue $ "#" ++ (show $ cdate c)) ! A.class_ "cl" $
                H.i $ toHtml $ (cauthor c ++ ": ")
             preEscapedString $ ctext c
+            H.p ! A.class_ "tt" $ toHtml (timeString $ cdate c)
         getTime :: Integer -> Maybe UTCTime
-        getTime = parseTime defaultTimeLocale "%s" (show )
-        showTime (Just t) = formatTime defaultTimeLocale "[Am %d.%m.%y um %H:%M Uhr]" t
-        showTime Nothing = "???" -- this can not happen??
+        getTime t = parseTime defaultTimeLocale "%s" (show t)
+        showTime DE (Just t) = formatTime defaultTimeLocale "[Am %d.%m.%y um %H:%M Uhr]" t
+        showTime EN (Just t) = formatTime defaultTimeLocale "[On %D at %H:%M Uhr]" t
+        showTime _ Nothing = "[???]" -- this can not happen??
+        timeString = (showTime lang) . getTime
 
 --[Am %d.%m.%y um %H:%M Uhr]