From 6fa510d35f0ca8738df7274bf6f02ad75a987f60 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Fri, 26 Aug 2022 02:36:39 +0200 Subject: controlroom: some styling --- lib/Server/ControlRoom.hs | 121 ++++++++++++++++++++++++++++++++-------------- messages/de.msg | 13 ++--- messages/en.msg | 3 +- tracktrain.cabal | 2 + 4 files changed, 95 insertions(+), 44 deletions(-) diff --git a/lib/Server/ControlRoom.hs b/lib/Server/ControlRoom.hs index e3af33f..9ebea42 100644 --- a/lib/Server/ControlRoom.hs +++ b/lib/Server/ControlRoom.hs @@ -46,8 +46,10 @@ import Persist (AmendmentStatus, Announcement (..), runSql) import Server.Util (Service) import Text.Blaze.Html (ToMarkup (..)) +import Text.Blaze.Internal (MarkupM(Empty)) import Text.ProtocolBuffers (Default (defaultValue)) import Text.Read (readMaybe) +import Text.Shakespeare.Text import Yesod import Yesod.Form @@ -72,25 +74,61 @@ mkYesod "ControlRoom" [parseRoutes| /trip/#TripID TripViewR GET |] +emptyMarkup :: MarkupM a -> Bool +emptyMarkup (Empty _) = True +emptyMarkup _ = False + instance Yesod ControlRoom where approot = ApprootMaster (\cr -> getBaseurl cr) defaultLayout w = do - p <- widgetToPageContent w + PageContent{..} <- widgetToPageContent w msgs <- getMessages + withUrlRenderer [hamlet| $newline never $doctype 5
-