From 196c929d9d159665d2cbe6cf3fce21e8aa9ea0b9 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 16 Aug 2020 18:18:03 +0200 Subject: Fix base url, no room info --- server/lib/Uplcg/Views.hs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'server') 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 -- cgit v1.2.3