diff options
author | Jasper Van der Jeugt | 2020-08-22 14:47:58 +0200 |
---|---|---|
committer | Jasper Van der Jeugt | 2020-08-22 14:47:58 +0200 |
commit | 7f5e0db31447cc612cf469ef07854677f9d25b83 (patch) | |
tree | a066c0ba7f22c32632c2427b6c17c5fa0c357e24 /server/lib/Uplcg/Views.hs | |
parent | 5a2a71cb50fd892585c7e5f3af726ac750ecb097 (diff) |
Multiple card sets
Diffstat (limited to 'server/lib/Uplcg/Views.hs')
-rw-r--r-- | server/lib/Uplcg/Views.hs | 9 |
1 files changed, 7 insertions, 2 deletions
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 |