{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} ------------------------------------------------------------------------------- -- | -- Module : Yesod.Comments -- Copyright : (c) Patrick Brisbin 2010 -- License : as-is -- Maintainer : pbrisbin@gmail.com -- Stability : unstable -- Portability : unportable -- -- A generic Comments interface for a Yesod application. This module is -- in the early stages of development. Beware bugs, patches welcome. -- ------------------------------------------------------------------------------- module Yesod.Comments ( addComments , addCommentsAuth , module Yesod.Comments.Core ) where import Yesod import Yesod.Auth import Yesod.Comments.Core import Network.Gravatar import Data.Text (Text) -- | Comments that anyone can enter anonymously addComments :: (RenderMessage m FormMessage, YesodComments m) => ThreadId -- ^ the thread you're adding comments to -> GWidget s m () addComments tid = do comments <- lift $ loadComments (Just tid) ((res, form), enctype) <- lift $ runFormPost commentForm handleForm res tid [whamlet|
^{showComments comments showComment}
^{form}