bamboo-2009.4.30: src/Bamboo/View/Atom/Album.hs
{-# LANGUAGE NoImplicitPrelude #-}
module Bamboo.View.Atom.Album where
import Bamboo.Helper.Env hiding (name, id)
import Bamboo.Model.Album
import Bamboo.Helper.Html
instance DataRenderer Album where
render_data = show_album
show_album x = case x.album_type of
Fade -> show_fade x
Galleria -> show_galleria x
SlideViewer -> show_slide_viewer x
Popeye -> show_popeye x
show_popeye x = c "popeye" << ul << x.data_list.map picture_li where
picture_li (l, t, i) = li <<
link l << img ! [src i, alt t]
show_slide_viewer x = ul ! [id "slide-viewer", klass "svw"] << x.data_list.map picture_li where
picture_li (_, t, i) = li <<
img ! [src i, alt t]
show_galleria x = ul ! [klass "gallery"] << x.data_list.map picture_li where
picture_li (_, t, i) = li <<
img ! [src i, alt t]
show_fade x = ul ! [klass "fade-album"] << x.data_list.map picture_li where
picture_li (l, t, i) = li <<
[ toHtml $ link l << img ! [src i, alt t]
, if x.show_description then p << t else empty_html
]