aboutsummaryrefslogtreecommitdiff
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
parentbc0541a94cc4372be598bfd7a9e43a3f9a446b29 (diff)
Fix base url, no room info
-rw-r--r--Dockerfile2
-rw-r--r--server/lib/Uplcg/Views.hs16
2 files changed, 10 insertions, 8 deletions
diff --git a/Dockerfile b/Dockerfile
index 66fffc4..4673ac8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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