From b6edb5b7a5d3f07000f382b2679d7dc5848f1519 Mon Sep 17 00:00:00 2001 From: Chris Done Date: Wed, 28 May 2014 22:59:14 +0200 Subject: [PATCH] Make footer content-dependent --- src/HL/V/Template.hs | 32 +++++++++++++++++++++++++++++--- static/css/hl.css | 8 ++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/HL/V/Template.hs b/src/HL/V/Template.hs index 6fde5a0..4d3a07f 100644 --- a/src/HL/V/Template.hs +++ b/src/HL/V/Template.hs @@ -59,9 +59,7 @@ skeleton ptitle innerhead innerbody mroute url = bodyinner = do div [class_ "wrap"] (innerbody mroute url) - div [class_ "footer"] - (div [class_ "container"] - (p [] (do "Copyright © 2014 haskell-lang.org"))) + footer mroute scripts url [js_jquery_js ,js_bootstrap_min_js] @@ -183,3 +181,31 @@ routeToSlug r = background :: (Route App -> AttributeValue) -> Route Static -> Attribute background url route = style ("background-image: url(" <> url (StaticR route) <> ")") + +-- | Footer across the whole site. +footer :: Maybe (Route App) -> Senza +footer r = + div [class_ "footer"] + (div [class_ "container"] + (p [] (do case r of + Just (WikiR page) -> wikiLicense (Just page) + Just (WikiHomeR{}) -> wikiLicense (Nothing :: Maybe Text) + _ -> "Copyright © 2014 haskell-lang.org" + ""))) + where + wikiLicense page = + do span [class_ "item"] + wikiLink + span [class_ "item"] + (do "Wiki content is available under " + a [href "http://www.haskell.org/haskellwiki/HaskellWiki:Copyrights"] + "a simple permissive license.") + where + wikiLink = + case page of + Nothing -> + a [href "http://www.haskell.org/haskellwiki/"] + "Go to haskell.org wiki" + Just page -> + a [href (toValue ("http://www.haskell.org/haskellwiki/index.php?title=" <> page <> "&action=edit"))] + "Edit this page" diff --git a/static/css/hl.css b/static/css/hl.css index 1bc40f5..8856aa8 100644 --- a/static/css/hl.css +++ b/static/css/hl.css @@ -49,6 +49,14 @@ h2 { font-size:13px; } +.footer a { + color: #fff; +} + +.footer .item + .item { + margin-left: 2em; +} + .logo { font-family:haskell; font-weight:400;