From a3bab4f2a0cc8a6a95753dc91d8e862f40c80dcc Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Mon, 10 Aug 2015 23:30:31 +0200 Subject: Embedding messages into the page --- src/server/View/Page.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/server/View') diff --git a/src/server/View/Page.hs b/src/server/View/Page.hs index a397a96..e0b924b 100644 --- a/src/server/View/Page.hs +++ b/src/server/View/Page.hs @@ -5,15 +5,20 @@ module View.Page ) where import Data.Text.Internal.Lazy (Text) +import Data.Text.Lazy.Encoding (decodeUtf8) +import Data.Aeson (encode) import Text.Blaze.Html import Text.Blaze.Html5 -import Text.Blaze.Html5.Attributes import qualified Text.Blaze.Html5 as H +import Text.Blaze.Html5.Attributes +import qualified Text.Blaze.Html5.Attributes as A import Text.Blaze.Html.Renderer.Text (renderHtml) import Design.Global (globalDesign) +import Model.Message (getTranslations) + page :: Text page = renderHtml . docTypeHtml $ do @@ -21,9 +26,10 @@ page = meta ! charset "UTF-8" H.title "Shared Cost" script ! src "javascripts/client.js" $ "" + script ! A.id "messages" ! type_ "application/json" $ toHtml . decodeUtf8 . encode $ getTranslations link ! rel "stylesheet" ! type_ "text/css" ! href "css/reset.css" link ! rel "stylesheet" ! href "css/font-awesome/css/font-awesome.min.css" link ! rel "icon" ! type_ "image/png" ! href "images/icon.png" H.style $ toHtml globalDesign - body $ + body $ do script ! src "javascripts/elmLauncher.js" $ "" -- cgit v1.2.3