diff options
-rw-r--r-- | Dockerfile | 2 | ||||
-rw-r--r-- | server/lib/Uplcg/Views.hs | 16 |
2 files changed, 10 insertions, 8 deletions
@@ -5,6 +5,6 @@ RUN stack build --only-dependencies COPY .git server /opt/uplcg/ RUN stack build ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 -ENV UPLCG_HOSTNAME=0.0.0.0 UPLCG_PORT=8002 UPLCG_BASE=/uplcg +ENV UPLCG_HOSTNAME=0.0.0.0 UPLCG_PORT=8002 UPLCG_BASE= EXPOSE 8002 CMD stack exec uplcg-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 |