about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorVincent Ambo <v.ambo@me.com>2012-03-14T00·36+0100
committerVincent Ambo <v.ambo@me.com>2012-03-14T00·36+0100
commit47e1be1f7852c141f604c36199dd767d3a5c3d86 (patch)
tree4262ce50e9e19cccdb26e3bbcedc8cb0259aab55 /src
parent36c4d7e84e1b2e18389eeda66c33d25fc7819f15 (diff)
* fixed entry-adding
* temporarily removed adminHandler and merged it into tazBlog :: ServerPart Response
Diffstat (limited to 'src')
-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"