about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--res/blogstyle.css9
-rw-r--r--src/Blog.hs13
-rw-r--r--src/Server.hs4
3 files changed, 19 insertions, 7 deletions
diff --git a/res/blogstyle.css b/res/blogstyle.css
index 63330a97751b..5a27f550930f 100644
--- a/res/blogstyle.css
+++ b/res/blogstyle.css
@@ -52,6 +52,15 @@ body {
 	margin-top: 20px;
 }
 
+.tt { 
+	font-family: "courier new",courier,monospace; 
+	font-size: 13px;
+}
+
+.cl {
+	text-decoration:none;color:black;
+}
+
 .innerBoxTop {
 	height: 28px;
 	color: #000000;
diff --git a/src/Blog.hs b/src/Blog.hs
index 1caa021d545a..80d6c45871c1 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]
 
diff --git a/src/Server.hs b/src/Server.hs
index 310c2ea1220c..a95b72cd7bba 100644
--- a/src/Server.hs
+++ b/src/Server.hs
@@ -85,8 +85,8 @@ stripResult :: Result a -> a
 stripResult (Ok z) = z
 stripResult (Error s) = error $ "JSON error: " ++ s
 -- CouchDB View Setup
-latestDEView = "function(doc){ if(doc.lang == \"de\"){ emit([doc.year, doc.month, doc.day, doc.id_], doc); } }"
-latestENView = "function(doc){ if(doc.lang == \"en\"){ emit([doc.year, doc.month, doc.day, doc.id_]], doc); } }"
+latestDEView = "function(doc){ if(doc.lang == \"DE\"){ emit([doc.year, doc.month, doc.day, doc.id_], doc); } }"
+latestENView = "function(doc){ if(doc.lang == \"EN\"){ emit([doc.year, doc.month, doc.day, doc.id_]], doc); } }"
 
 latestDE = ViewMap "latestDE" latestDEView
 latestEN = ViewMap "latestEN" latestENView