From b846aa65f8f21189f39236f88908267167004a35 Mon Sep 17 00:00:00 2001 From: Joris Date: Thu, 14 Jul 2016 15:47:33 +0200 Subject: Add isPro info --- src/View/Html/Ad.hs | 16 ++++++++++++---- src/View/Html/Design.hs | 24 +++++++++++++++--------- 2 files changed, 27 insertions(+), 13 deletions(-) (limited to 'src/View/Html') diff --git a/src/View/Html/Ad.hs b/src/View/Html/Ad.hs index d8a3bae..53e63bf 100644 --- a/src/View/Html/Ad.hs +++ b/src/View/Html/Ad.hs @@ -32,7 +32,7 @@ import Model.URL import Conf (Conf) import qualified Conf -import View.Html.Design +import qualified View.Html.Design as Design renderAds :: Conf -> [Ad] -> Text renderAds conf = toStrict . renderHtml . (adsHtml conf) @@ -56,10 +56,18 @@ resumeHtml resume = do Just price -> H.span ! A.class_ "price" - ! A.style (textValue . toStrict $ priceDesign) + ! A.style (textValue . toStrict $ Design.price) $ toHtml price Nothing -> H.span "" + if Resume.isPro resume + then + H.span + ! A.class_ "pro" + ! A.style (textValue . toStrict $ Design.pro) + $ "PRO" + else + "" linkHtml (Resume.url resume) detailHtml :: Conf -> Detail -> Html @@ -75,7 +83,7 @@ detailHtml conf detail = do propertiesHtml :: [Text] -> Map Text Text -> Html propertiesHtml keys properties = H.dl - ! A.style (textValue . toStrict $ dlDesign) + ! A.style (textValue . toStrict $ Design.definitionList) $ sequence_ (catMaybes $ map (propertyHtml properties) keys) propertyHtml :: Map Text Text -> Text -> Maybe Html @@ -83,7 +91,7 @@ propertyHtml properties key = fmap (\value -> do H.dt $ (toHtml key) - H.dd ! A.style (textValue . toStrict $ ddDesign) $ (toHtml value) + H.dd ! A.style (textValue . toStrict $ Design.definitionDescription) $ (toHtml value) ) (M.lookup key properties) diff --git a/src/View/Html/Design.hs b/src/View/Html/Design.hs index 6ef5659..71fa09d 100644 --- a/src/View/Html/Design.hs +++ b/src/View/Html/Design.hs @@ -1,9 +1,10 @@ {-# LANGUAGE OverloadedStrings #-} module View.Html.Design - ( dlDesign - , ddDesign - , priceDesign + ( definitionList + , definitionDescription + , price + , pro ) where import Data.Text.Lazy (Text) @@ -11,19 +12,24 @@ import qualified Data.Text.Lazy as T import Clay -dlDesign :: Text -dlDesign = inlineRender $ do +definitionList :: Text +definitionList = inlineRender $ do fontWeight bold fontSize (px 16) -ddDesign :: Text -ddDesign = inlineRender $ do +definitionDescription :: Text +definitionDescription = inlineRender $ do marginLeft (px 0) marginBottom (px 10) color orangered -priceDesign :: Text -priceDesign = inlineRender $ do +pro :: Text +pro = inlineRender $ do + marginLeft (px 10) + color blue + +price :: Text +price = inlineRender $ do marginLeft (px 10) color orangered -- cgit v1.2.3