module Panda.View.Control.Comment where
  
import Panda.Helper.Env hiding (body, date)
import Prelude hiding ((.), (/), (^), id, span)
import qualified Panda.Type.State as State

import Panda.Model.Comment hiding (create)
import qualified Panda.Model.Post as Post

-- view
import Panda.View.Control.Helper
import Panda.View.Widget.Template
import Panda.View.Atom.Comment as Comment


-- api
styled_entry alt x = li ! [theclass alt] << x.render_data

list [] = []
list xs = 
  [ h2 ! [id "comments"] << "Responses"
  , olist ! [theclass "commentlist" ] << xs.zip (cycle ["comments-alt", ""]).map (splash styled_entry)
  ]
  
create = Comment.create