diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-17 05:24:33 +0000 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-17 05:24:38 +0000 |
commit | a73fc10e13832cb847d05a751485245f853e3cbb (patch) | |
tree | 5adc4eb5722e3423061396b97c67dc49255ce57b | |
parent | 7125a7a2895679bb03824b736f9841fd6893b357 (diff) | |
download | sariulclocks-a73fc10e13832cb847d05a751485245f853e3cbb.tar.gz |
start filling out the clocks
-rw-r--r-- | src/Text/XHtml/Bootstrap.hs | 8 | ||||
-rw-r--r-- | src/sariulclocks.hs | 39 |
2 files changed, 45 insertions, 2 deletions
diff --git a/src/Text/XHtml/Bootstrap.hs b/src/Text/XHtml/Bootstrap.hs new file mode 100644 index 0000000..625572c --- /dev/null +++ b/src/Text/XHtml/Bootstrap.hs @@ -0,0 +1,8 @@ +module Text.XHtml.Bootstrap where + +import Text.XHtml + +button :: String -> String -> String -> Html +button id theClass label = anchor ! [ strAttr "id" id + , strAttr "class" theClass] + << label diff --git a/src/sariulclocks.hs b/src/sariulclocks.hs index d3ab6ba..8196993 100644 --- a/src/sariulclocks.hs +++ b/src/sariulclocks.hs @@ -14,19 +14,54 @@ import Types.Session import Types.Clocks import Control.Monad.Page import Utils.Classes +import Text.XHtml.Bootstrap navBar :: Page Html navBar = return $ paragraph << "navbar here" +makeClockToggle :: Clock -> Html +makeClockToggle = undefined + +makeLeftClockButtons :: Clock -> Html +makeLeftClockButtons CountUpClock = undefined +makeLeftClockButtons CountDownClock = undefined + +makeRightClockButtons :: Html +makeRightClockButtons = primHtml $ "<a id=\"timeWastingClockGo\" class=\"btn btn-primary btn-lg btn-block\">Start <u>t</u>imer</a> <a id=\"timeWastingClockReset\" class=\"btn btn-default btn-lg btn-block\">Re<u>s</u>et timer (end of class)</a>" + clocks :: Page Html -clocks = return $ paragraph << "clocks here" +clocks = do + leftClockType <- liftM (currentClock) getSession + let leftClockToggle = makeClockToggle leftClockType + let leftClockClockDiv = + case leftClockType of + CountUpClock -> "activity-countup" + CountDownClock -> "activity-countdown" + let leftClockClock = thediv ! [strAttr "class" leftClockClockDiv] << noHtml + let leftClockButtons = makeLeftClockButtons leftClockType + let leftClock = (<<) clockColumn $ + (h1 << "Activity time") + +++ leftClockToggle +++ br + +++ leftClockClock + +++ leftClockButtons + let rightClock = (<<) clockColumn $ + (h1 << "Time wasting clock") +++ br + +++ (thediv ! [strAttr "class" "time-wasting-clock"] << noHtml) +++ br + +++ makeRightClockButtons + return $ thediv ! [strAttr "class" "container"] + << thediv ! [strAttr "class" "row"] + << (leftClock +++ rightClock) + +clockColumn :: Html -> Html +clockColumn = thediv ! [strAttr "class" "col-md-6"] makePage :: Page Html makePage = do theNavBar <- navBar theClocks <- clocks + let theDate = paragraph << "date here" theRankings <- rankings - return (theNavBar +++ theClocks +++ theRankings) + return (theNavBar +++ theClocks +++ theDate +++ theRankings) -- makePage :: Session -> ScoresList -> (Session, ScoresList, Html) -- makePage session scores = (session, scores, (h1 << "Hello World!") +++ rankings (Just $ lookupSariulClass 5 3) scores) |