diff options
author | Joris Guyonvarch | 2015-08-10 23:30:31 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-08-10 23:30:31 +0200 |
commit | a3bab4f2a0cc8a6a95753dc91d8e862f40c80dcc (patch) | |
tree | 3f8083a4f35fa959fc1a80479432c3b78a55e09e /src/server/View | |
parent | f860b59644e84b84b6d7b4af309161ca7c5499ee (diff) |
Embedding messages into the page
Diffstat (limited to 'src/server/View')
-rw-r--r-- | src/server/View/Page.hs | 10 |
1 files changed, 8 insertions, 2 deletions
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" $ "" |