yesod-comments-0.3.4: A generic comments interface for a Yesod application

Portabilityunportable
Stabilityunstable
Maintainerpbrisbin@gmail.com

Yesod.Comments.Core

Description

 

Synopsis

Documentation

class Yesod m => YesodComments m whereSource

Methods

getComment :: ThreadId -> CommentId -> GHandler s m (Maybe Comment)Source

storeComment :: Comment -> GHandler s m ()Source

deleteComment :: Comment -> GHandler s m ()Source

loadComments :: Maybe ThreadId -> GHandler s m [Comment]Source

Loading all comments, possibly filtered to a single thread.

getNextCommentId :: [Comment] -> GHandler s m CommentIdSource

Get the next available Id given the passed list of comments. In Handler in case there is a database call involved.

commentFilters :: [Comment -> GHandler s m Bool]Source

displayUser :: AuthId m -> GHandler s m TextSource

if using Auth, provide the function to get from a user id to the string to use as the commenter's username. This should return something friendlier than just a conversion to String

displayEmail :: AuthId m -> GHandler s m TextSource

if using Auth, provide the function to get form a user id to the string to use as the commenter's email.

commentFromForm :: ThreadId -> CommentId -> CommentForm -> GHandler s m CommentSource

Cleanse form input and create a Comment to be stored

commentForm :: GFormMonad s m (FormResult CommentForm, GWidget s m ())Source

The comment form itself

commentFormAuthSource

Arguments

:: Text

text version of uid

-> Text

friendly name

-> Text

email

-> GFormMonad s m (FormResult CommentForm, GWidget s m ()) 

The comment form if using authentication (uid is hidden and display name is shown)

showComment :: Yesod m => Comment -> GWidget s m ()Source

Show a single comment

showCommentAuth :: (Yesod m, YesodAuth m, YesodComments m) => Comment -> GWidget s m ()Source

Show a single comment, auth version