about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/Blog.hs2
-rw-r--r--src/Main.hs32
2 files changed, 20 insertions, 14 deletions
diff --git a/src/Blog.hs b/src/Blog.hs
index 48b67a93b0d8..8e53046edddf 100644
--- a/src/Blog.hs
+++ b/src/Blog.hs
@@ -85,7 +85,7 @@ renderEntry (Entry{..}) = H.div ! A.class_ "innerBox" $ do
     H.div ! A.class_ "innerBoxMiddle" $ do
         H.article $ H.ul $ H.li $ do
             preEscapedText $ btext
-            preEscapedText $ mtext
+            H.p $ preEscapedText $ mtext
         H.div ! A.class_ "innerBoxComments" $ do
             H.div ! A.class_ "cHead" $ toHtml $ cHead lang -- ! A.style "font-size:large;font-weight:bold;"
             H.ul $ renderComments comments lang
diff --git a/src/Main.hs b/src/Main.hs
index 43faeac93f5c..b05599de588a 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -54,13 +54,29 @@ tazBlog acid =
          , path $ \(year :: Int) -> path $ \(month :: Int) -> path $ \(id_ :: String) -> formatOldLink year month id_
          , dir "res" $ serveDirectory DisableBrowsing [] "../res"
          , dir "notice" $ ok $ toResponse showSiteNotice
-         , do dir "admin" $ guardSession acid
-              adminHandler acid
+         , do dirs "admin/postentry" $ nullDir
+              guardSession acid
+              postEntry acid
+         , do dir "admin" $ nullDir
+              guardSession acid
+              ok $ toResponse $ adminIndex ("tazjin" :: Text)
          , dir "admin" $ ok $ toResponse $ adminLogin 
          , dir "dologin" $ processLogin acid
          , serveDirectory DisableBrowsing [] "../res"
          ]
 
+{-
+adminHandler :: AcidState Blog -> ServerPart Response
+adminHandler acid = 
+  msum [ dir "postentry" $ postEntry acid
+       , dir "entrylist" $ dir (show DE) $ entryList DE
+       , dir "entrylist" $ dir (show EN) $ entryList EN
+       , dir "edit" $ path $ \(eId :: Integer) -> editEntry eId 
+       , dir "doedit" $ updateEntry 
+       , ok $ toResponse $ adminIndex ("tazjin" :: Text) --User NYI
+       ]
+-}
+
 blogHandler :: AcidState Blog -> BlogLang -> ServerPart Response
 blogHandler acid lang = 
     msum [ path $ \(eId :: Integer) -> showEntry acid lang $ EntryId eId
@@ -110,23 +126,13 @@ addComment acid lang eId = do
 
 {- ADMIN stuff -}
 
-adminHandler :: AcidState Blog -> ServerPart Response
-adminHandler acid = 
-  msum [ dir "postentry" $ postEntry acid
-       , dir "entrylist" $ dir (show DE) $ entryList DE
-       , dir "entrylist" $ dir (show EN) $ entryList EN
-       , dir "edit" $ path $ \(eId :: Integer) -> editEntry eId 
-       , dir "doedit" $ updateEntry 
-       , ok $ toResponse $ adminIndex ("tazjin" :: Text) --User NYI
-       ]
 
 updateEntry :: ServerPart Response
 updateEntry = undefined
 
 postEntry :: AcidState Blog -> ServerPart Response
 postEntry acid = do
-    liftIO $ putStrLn "postEntry called"
-    --decodeBody tmpPolicy
+    decodeBody tmpPolicy
     now <- liftIO $ getCurrentTime
     let eId = timeToId now
     lang <- lookText' "lang"