about summary refs log tree commit diff
path: root/src/Blog.hs
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@googlemail.com>2012-04-04T02·10+0200
committerVincent Ambo <tazjin@googlemail.com>2012-04-04T02·10+0200
commitd15a01007ee50d5b7c75a186b6c4d72fc47b45b7 (patch)
tree52b620d165357fab8fe12cba484b86af4e6d312c /src/Blog.hs
parent533463511fea14385f7e35498f52dd7199e1ce54 (diff)
* comment deletion (this doesn't look nice, but nobody except for me sees the admin page so I DON'T CARE :D)
Diffstat (limited to 'src/Blog.hs')
-rw-r--r--src/Blog.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Blog.hs b/src/Blog.hs
index 2d3fe305bf85..a63d0039eb4c 100644
--- a/src/Blog.hs
+++ b/src/Blog.hs
@@ -266,9 +266,26 @@ editPage (Entry{..}) = adminTemplate "Index" $
                   H.td $ H.textarea ! A.name "mtext" ! A.cols "100" ! A.rows "15" $ toHtml mtext
       H.input ! A.type_ "hidden" ! A.name "eid" ! A.value (toValue $ unEntryId entryId)
       H.input ! A.style "margin-left: 20px" ! A.type_ "submit" ! A.value "Absenden"
+      H.div ! A.class_ "editComments" $ editComments comments entryId
       H.p $ do preEscapedText "<a href=/>Startseite</a> -- Entrylist: <a href=/admin/entrylist/de>DE</a>"
                preEscapedText " & <a href=/admin/entrylist/en>EN</a> -- <a href=#>Backup</a> (NYI)"
 
+editComments :: [Comment] -> EntryId -> Html
+editComments clist eId = H.table $ mapM_ editComment clist
+    where
+        editComment (Comment{..}) = H.tr $ do H.td $ toHtml cauthor
+                                              H.td $ toHtml $ formatTime defaultTimeLocale "%c" cdate
+                                              H.td $ cDeleteLink cdate
+        cDeleteLink cdate = H.a ! A.href (toValue $ "/admin/cdelete/" ++ show eId 
+                                         ++ formatTime defaultTimeLocale "/%s%Q" cdate) $ "Löschen"
+
+commentDeleted :: EntryId -> Html
+commentDeleted eId = adminTemplate "Kommentar gelöscht" $ do
+    H.div $ "Der Kommentar wurde gelöscht."
+    H.br
+    H.a ! A.href (toValue $ "/de/" ++ show eId) $ "Eintrag ansehen | "
+    H.a ! A.href (toValue $ "/admin/edit/" ++ show eId) $ "Eintrag bearbeiten"
+
 -- Error pages
 showError :: BlogError -> BlogLang -> Html
 showError NotFound l = blogTemplate l (T.append ": " $ notFoundTitle l) $ do