2015-08-20 22:33:38 +02:00
|
|
|
module Handler.Home where
|
|
|
|
|
|
|
|
import Import
|
|
|
|
|
2016-01-10 20:32:11 +01:00
|
|
|
import Handler.Shared
|
|
|
|
|
2015-08-20 22:33:38 +02:00
|
|
|
-- This is a handler function for the GET request method on the HomeR
|
|
|
|
-- resource pattern. All of your resource patterns are defined in
|
|
|
|
-- config/routes
|
|
|
|
--
|
|
|
|
-- The majority of the code you will write in Yesod lives in these handler
|
|
|
|
-- functions. You can spread them across multiple files if you are so
|
|
|
|
-- inclined, or create a single monolithic file.
|
|
|
|
getHomeR :: Handler Html
|
|
|
|
getHomeR = do
|
2015-11-11 13:25:09 +01:00
|
|
|
maybeUser <- maybeAuth
|
2017-01-28 11:22:56 +01:00
|
|
|
master <- getYesod
|
2015-11-11 13:25:09 +01:00
|
|
|
let maybeLocalId = case maybeUser of
|
|
|
|
Just user -> userLocalId $ entityVal user
|
|
|
|
Nothing -> Nothing
|
|
|
|
defaultLayout $ do
|
2015-08-20 22:33:38 +02:00
|
|
|
aDomId <- newIdent
|
2015-11-11 13:25:09 +01:00
|
|
|
setTitle "Welcome To Gonito.net!"
|
2015-08-20 22:33:38 +02:00
|
|
|
$(widgetFile "homepage")
|