packages feed

bamboo-theme-blueprint-2009.6.8: src/Bamboo/Theme/Blueprint/Control/Helper.hs

{-# LANGUAGE NoImplicitPrelude #-}
module Bamboo.Theme.Blueprint.Control.Helper where

import Bamboo.Theme.Blueprint.Env hiding (p)
import Bamboo.Theme.Blueprint.Helper

nav :: Pager -> String -> [Html]
nav p r = 
  [ div_class "alignleft" << nav_previous
  , div_class "alignright" << nav_next
  ]
  where
    nav_previous = 
      if p.has_previous 
      then
        toHtml $ hotlink ( r' ++ "page=" ++ p.previous.show )
          << previous_sign
      else space_html
      
      where r' = if isSuffixOf "&" r then r else r ++ "?"
    
    nav_next = 
      if p.has_next
      then toHtml $ hotlink ( r' ++ "page=" ++ p.next.show ) << next_sign
      else space_html
      where r' = if isSuffixOf "&" r then r else r ++ "?"