{-# LANGUAGE NoImplicitPrelude #-} module Bamboo.Theme.Blueprint.Control.Post where import Bamboo.Helper.StateHelper import Bamboo.Model.Post import Bamboo.Type.State hiding (uid) import Bamboo.Theme.Blueprint.Atom.Post import Bamboo.Theme.Blueprint.Control.Helper import Bamboo.Theme.Blueprint.Env hiding (p) import Bamboo.Theme.Blueprint.Widget.Template import qualified Bamboo.Model.Comment as Comment import qualified Bamboo.Type as C import qualified Bamboo.Theme.Blueprint.Control.Comment as CommentV -- entry view view :: Widget view s = (x.render +++ comment_view ).page s where x = s.posts.first render = entry' s Full xs = s.comments comment_view = html_only_for Comment $ CommentV.list xs +++ CommentV.create s (x.uid.Comment.from_post_id) -- list view list :: Widget list s = s.posts.(map render > (+++ nav p (s.env.slashed_script_name)) > page s) where p = s.pager render = entry s