forked from nbartlomiej/tfoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Application.hs
35 lines (27 loc) · 1.07 KB
/
Application.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{-# LANGUAGE TypeFamilies, QuasiQuotes, TemplateHaskell, OverloadedStrings,
MultiParamTypeClasses, ViewPatterns #-}
module Application where
import Tfoo.Foundation
import Yesod
import Yesod.Static
import Text.Hamlet (hamletFile)
mkYesodData "Tfoo" [parseRoutes|
/ HomeR GET
/games GamesR POST
/games/#Int GameR GET
/games/#Int/join/o PlayerOR POST
/games/#Int/join/x PlayerXR POST
/games/#Int/mark/#Int/#Int MarkR POST
/games/#Int/listen ChannelR GET
/static StaticR Static tfooStatic
|]
instance Yesod Tfoo where
defaultLayout widget = do
pageContent <- widgetToPageContent $ do
widget
addStylesheet $ StaticR $ StaticRoute ["styles", "tfoo.css"] []
addScript $ StaticR $ StaticRoute ["scripts","jquery-1.7.1.min.js"] []
addScript $ StaticR $ StaticRoute ["scripts","jquery.wiggle.js"] []
withUrlRenderer $(hamletFile "templates/layout.hamlet")
instance RenderMessage Tfoo FormMessage where
renderMessage _ _ = defaultFormMessage