Fix Post rendering, thanks andy

This commit is contained in:
Christine Dodrill 2015-07-28 10:06:09 -07:00
parent 99567b586b
commit b663980b4b
1 changed files with 9 additions and 8 deletions

View File

@ -23,13 +23,14 @@ instance FromRow Post where
fromRow = Post <$> field <*> field <*> field <*> field <*> field <*> field fromRow = Post <$> field <*> field <*> field <*> field <*> field <*> field
render :: Post -> H.Html render :: Post -> H.Html
render post = do render post =
H.div ! A.class_ "card blue-grey darken-1" $ do let state = case readTextile def (unpack $ body post) of
H.div ! A.class_ "card-content white-text" $ do Right v -> v
H.span ! A.class_ "card-title" $ H.toHtml $ unpack (author post) Left err -> error (show err)
state <- case readTextile def (unpack $ body post) of in do
Right v -> return v H.div ! A.class_ "card blue-grey darken-1" $ do
Left err -> error (show err) H.div ! A.class_ "card-content white-text" $ do
H.span ! A.class_ "card-title" $ H.toHtml $ unpack (author post)
H.p $ writeHtml def state H.p $ writeHtml def state