packages feed

bamboo-2009.6.6: src/Bamboo/View/Control/Comment.hs

{-# LANGUAGE NoImplicitPrelude #-}
module Bamboo.View.Control.Comment where
  
import Bamboo.Model.Comment (Comment)
import Bamboo.View.Env hiding (body, date, alt, create)
import qualified Bamboo.View.Atom.Comment as CommentVA

list :: [Comment] -> [Html]
list [] = []
list xs = 
  [ h2 ! [id "comments"] << "Responses"
  , olist ! [theclass "commentlist" ] << xs.zip (cycle ["comments-alt", ""]).map (splash styled_entry)
  ]
  where
    styled_entry alt x = li ! [theclass alt] << x.CommentVA.entry

create :: State -> Comment -> Html
create = CommentVA.create