From 7f5e0db31447cc612cf469ef07854677f9d25b83 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sat, 22 Aug 2020 14:47:58 +0200 Subject: Multiple card sets --- server/lib/Uplcg/Views.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'server/lib/Uplcg/Views.hs') diff --git a/server/lib/Uplcg/Views.hs b/server/lib/Uplcg/Views.hs index d25a9ce..9e453e8 100644 --- a/server/lib/Uplcg/Views.hs +++ b/server/lib/Uplcg/Views.hs @@ -13,6 +13,7 @@ import qualified Data.Text.Encoding as T import qualified Network.HTTP.Types.URI as HttpUri import qualified Text.Blaze.Html5 as H import qualified Text.Blaze.Html5.Attributes as A +import Uplcg.Cards import Uplcg.Version (version) data RoomView = RoomView Text Bool Int @@ -29,8 +30,8 @@ template title body = H.docTypeHtml $ do body H.footer $ "Untitled PL Card Game version " <> H.toHtml version -rooms :: [RoomView] -> H.Html -rooms rids = template "Untitled PL Card Game" $ +rooms :: [RoomView] -> [Deck] -> H.Html +rooms rids decks = template "Untitled PL Card Game" $ H.div H.! A.class_ "rooms" $ do H.h1 "Rooms" if null rids @@ -52,6 +53,10 @@ rooms rids = template "Untitled PL Card Game" $ H.label H.! A.for "name" $ "Password (optional): " H.input H.! A.type_ "text" H.! A.name "password" H.br + H.label H.! A.for "deck" $ "Cards: " + H.select H.! A.name "deck" $ for_ decks $ \deck -> + H.option H.! A.value (H.toValue deck) $ H.toHtml deck + H.br H.input H.! A.type_ "submit" H.! A.value "Create room" client :: Text -> Maybe Text -> H.Html -- cgit v1.2.3