aboutsummaryrefslogtreecommitdiff
path: root/server/lib/Uplcg
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/Uplcg')
-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