module Panda.View.Theme.BluePrint.Template.Body where -- env import Panda.Helper.Env import Prelude hiding ((.), (/), id, span) import qualified Panda.Config.Global as Config import qualified Panda.Type.State as State import Text.XHtml.Strict -- view import Panda.View.Theme.BluePrint.Template.Sidebar import Panda.View.Theme.BluePrint.Template.Footer html_body state x = body << container << [ body_header state , div_id "page" << [ body_content x, html_sidebar state ] , html_footer ] container = div_class "container" body_header state = toHtml [ div_class_id "column span-12 first" "header" << [ search_form , site_name ] , div_class_id "column span-12 first large" "nav" << navigation state ] -- search_form = spaceHtml search_form = div_id "search" << form ! [action "/search", method "get"] << thediv << textfield "s" -- ! [strAttr "onFocus" "clearInput('s', 'Search')", strAttr "onBlur" "clearInput('s', 'Search')"] site_name = toHtml $ [ toHtml $ hotlink "/" ! [theclass "logo"] << "" , h1 << Config.blog_title , div_class "description" << Config.blog_subtitle ] navigation state = div_class "content" << ulist << Config.navigation.map (nav_item (state.State.nav_location)) nav_item nav s = li ! [theclass (home_tag ++ "page_item" ++ current)] << link s where home_tag = if s == home_nav then "first " else "" current = if s == nav then " current_page_item" else "" link x = if x == home_nav then home_link else static_link x home_link = hotlink "/" << home_nav static_link s = hotlink ("/" / "static" / s) << s body_content x = div_class_id "column span-9 first" "maincontent" << div_class "content" << x