aboutsummaryrefslogtreecommitdiff
path: root/server/lib/Uplcg/Views.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt2020-08-14 17:32:00 +0200
committerJasper Van der Jeugt2020-08-14 17:32:00 +0200
commit41622353bc3309921109f44bc0163e0987c20052 (patch)
tree499b4390daf426e7e189bfca12575b601d62a26d /server/lib/Uplcg/Views.hs
parentb250aa81e332c612551803d0d156246b853b3fd3 (diff)
List room num members
Diffstat (limited to '')
-rw-r--r--server/lib/Uplcg/Views.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/server/lib/Uplcg/Views.hs b/server/lib/Uplcg/Views.hs
index 90716c1..ef4bc09 100644
--- a/server/lib/Uplcg/Views.hs
+++ b/server/lib/Uplcg/Views.hs
@@ -1,6 +1,7 @@
{-# LANGUAGE OverloadedStrings #-}
module Uplcg.Views
- ( rooms
+ ( RoomView (..)
+ , rooms
) where
import Data.Foldable (for_)
@@ -10,7 +11,9 @@ import qualified Text.Blaze.Html5.Attributes as A
import Uplcg.BaseUrl (BaseUrl)
import qualified Uplcg.BaseUrl as BaseUrl
-rooms :: BaseUrl -> [Text] -> H.Html
+data RoomView = RoomView Text Int
+
+rooms :: BaseUrl -> [RoomView] -> H.Html
rooms base rids = H.docTypeHtml $ do
H.head $ do
H.meta H.! A.charset "UTF-8"
@@ -18,7 +21,10 @@ rooms base rids = H.docTypeHtml $ do
H.! A.href (H.toValue $ BaseUrl.render base <> "/assets/style.css")
H.body $ do
H.h1 "Rooms"
- H.ul $ for_ rids $ \rid -> H.li $
+ H.ul $ for_ rids $ \(RoomView rid num) -> H.li $ do
H.a H.! A.href (H.toValue $ BaseUrl.render base <> "/rooms/" <> rid) $
H.toHtml rid
+ " ("
+ H.toHtml num
+ ")"
H.footer $ "Untitled PL Card Game"