{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}

module Templates where

import Data.Monoid ((<>))
import Lucid
import Data.Text.Lazy (Text)

page :: Text -> Html () -> Text
page title content = renderText $ do
  head_ $ do
    title_ ("scrapboard: " <> toHtml title)
    meta_ [ httpEquiv_ "content-type"
          , content_ "text/html; charset=utf-8"
          ]
  body_ $ do
    div_ [id_ "content"] $ do
      banner
      div_ [id_ "main_column"] ""
      div_ [id_ "right_bar"] ""
      div_ [id_ "tag_cloud"] ""

banner :: Html ()
banner = div_ [id_ "banner"] $ do
  div_ [id_ "logo"] $ do
    a_ [href_ "/recent"] $ img_ [ class_ "logo"
                                , src_ "/static/thumb.png"
                                ]
    a_ [id_ "scrapboard_name", href_ "/"] "Scrapboard"
  div_ [id_ "top_menu"] $ do
    a_ [href_ "/history/"] "history"
    a_ [href_ "/add/"] "add"
    a_ [href_ "/settings/"] "settings"
    a_ [href_ "/logout/"] "logout"
