aboutsummaryrefslogtreecommitdiff
path: root/server/lib
diff options
context:
space:
mode:
authorJasper Van der Jeugt2020-08-16 18:18:03 +0200
committerJasper Van der Jeugt2020-08-16 18:18:03 +0200
commit196c929d9d159665d2cbe6cf3fce21e8aa9ea0b9 (patch)
treef1f43686dfa462a313469fa027b3739a7c932365 /server/lib
parentbc0541a94cc4372be598bfd7a9e43a3f9a446b29 (diff)
Fix base url, no room info
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/Uplcg/Views.hs16
1 files changed, 9 insertions, 7 deletions
diff --git a/server/lib/Uplcg/Views.hs b/server/lib/Uplcg/Views.hs
index 8241158..348a92d 100644
--- a/server/lib/Uplcg/Views.hs
+++ b/server/lib/Uplcg/Views.hs
@@ -34,13 +34,15 @@ rooms :: Config -> [RoomView] -> H.Html
rooms conf rids = template conf "Untitled PL Card Game" $
H.div H.! A.class_ "rooms" $ do
H.h1 "Rooms"
- H.ul $ for_ rids $ \(RoomView rid num) -> H.li $ do
- H.a H.! A.href (H.toValue $
- BaseUrl.render (cBaseUrl conf) <> "/rooms/" <> rid) $
- H.toHtml rid
- " ("
- H.toHtml num
- ")"
+ if null rids
+ then H.p "No rooms online."
+ else H.ul $ for_ rids $ \(RoomView rid num) -> H.li $ do
+ H.a H.! A.href (H.toValue $
+ BaseUrl.render (cBaseUrl conf) <> "/rooms/" <> rid) $
+ H.toHtml rid
+ " ("
+ H.toHtml num
+ ")"
client :: Config -> Text -> H.Html
client conf roomId = template conf "Untitled PL Card Game" $ do