aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2015-03-17 13:05:38 +0000
committerSean Whitton <spwhitton@spwhitton.name>2015-03-17 13:05:38 +0000
commit12a5b10a1989366b840d304cf185fe9bf3d8a5ee (patch)
treeddf1c8c77ac210e6eafc92b52ae1694a3ba2e3df
parent9e18ea7128a4a5160d7f6ed1a1f609b763e455f6 (diff)
downloadsariulclocks-12a5b10a1989366b840d304cf185fe9bf3d8a5ee.tar.gz
change page order when no class in session
To emphasise the rankings
-rw-r--r--src/sariulclocks.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sariulclocks.hs b/src/sariulclocks.hs
index 78d2a8c..81afc2b 100644
--- a/src/sariulclocks.hs
+++ b/src/sariulclocks.hs
@@ -115,7 +115,12 @@ makePage = do
theNavBar <- navBar
theClocks <- clocks
theRankings <- rankings
- return (theNavBar +++ theClocks +++ theDate +++ theRankings)
+ currentClass <- liftM (currentClass) getSession
+ let page =
+ case currentClass of
+ Just _ -> theNavBar +++ theClocks +++ theDate +++ theRankings
+ Nothing -> theNavBar +++ br +++ theRankings +++ theDate +++ theClocks
+ return page
cgiMain :: CGI CGIResult
cgiMain = do
@@ -144,6 +149,9 @@ cgiMain = do
setCookie $ makeClassCookie clockTime newSession
setCookie $ makeClockCookie clockTime newSession
+ -- debug
+ -- let html' = html +++ (paragraph << (show cookieClock)) +++ paragraph << (show $ makeClockCookie clockTime newSession)
+
output $ templateInject htmlTemplate html
main = runCGI . handleErrors $ cgiMain