diff --git a/Foundation.hs b/Foundation.hs index ecc1c42..bcbe1bf 100644 --- a/Foundation.hs +++ b/Foundation.hs @@ -104,6 +104,7 @@ instance Yesod App where isAuthorized (AuthR _) _ = return Authorized isAuthorized FaviconR _ = return Authorized isAuthorized RobotsR _ = return Authorized + isAuthorized HomeR _ = return Authorized -- Default to Authorized for now. isAuthorized _ _ = isTrustedAuthorized diff --git a/Handler/Home.hs b/Handler/Home.hs index 78190e8..32724a5 100644 --- a/Handler/Home.hs +++ b/Handler/Home.hs @@ -13,29 +13,12 @@ import Yesod.Form.Bootstrap3 (BootstrapFormLayout (..), renderBootstrap3, -- inclined, or create a single monolithic file. getHomeR :: Handler Html getHomeR = do - (formWidget, formEnctype) <- generateFormPost sampleForm - let submission = Nothing :: Maybe (FileInfo, Text) - handlerName = "getHomeR" :: Text - defaultLayout $ do + maybeUser <- maybeAuth + let maybeLocalId = case maybeUser of + Just user -> userLocalId $ entityVal user + Nothing -> Nothing + defaultLayout $ do aDomId <- newIdent - setTitle "Welcome To Yesod!" + setTitle "Welcome To Gonito.net!" $(widgetFile "homepage") $(fayFile "Home") - -postHomeR :: Handler Html -postHomeR = do - ((result, formWidget), formEnctype) <- runFormPost sampleForm - let handlerName = "postHomeR" :: Text - submission = case result of - FormSuccess res -> Just res - _ -> Nothing - - defaultLayout $ do - aDomId <- newIdent - setTitle "Welcome To Yesod!" - $(widgetFile "homepage") - -sampleForm :: Form (FileInfo, Text) -sampleForm = renderBootstrap3 BootstrapBasicForm $ (,) - <$> fileAFormReq "Choose a file" - <*> areq textField (withSmallInput "What's on the file?") Nothing diff --git a/config/routes b/config/routes index 12153f6..2865b13 100644 --- a/config/routes +++ b/config/routes @@ -5,7 +5,7 @@ /favicon.ico FaviconR GET /robots.txt RobotsR GET -/ HomeR GET POST +/ HomeR GET /create-challenge CreateChallengeR GET POST /view-progress/#Int ViewProgressR GET diff --git a/messages/en.msg b/messages/en.msg index c29d31b..b241569 100644 --- a/messages/en.msg +++ b/messages/en.msg @@ -18,3 +18,4 @@ AboutMe: about me AccountName: name Id: ID SshPubKey: your SSH public key +Home: home diff --git a/templates/default-layout.hamlet b/templates/default-layout.hamlet index 5e9f5bf..5b24463 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -1,6 +1,7 @@
Gonito (pronounced ɡɔ̃ˈɲitɔ) is a Kaggle-like platform for machine learning competitions. -
What's so special about Gonito: -
Go to the challenge list and choose a challenge for you! + $nothing +
Click your account to setup your name, ID and SSH public key. +$nothing +
Gonito uses Persona authentication system available in Mozilla Firefox. Other authentication systems are on the way, but for the time being you need to use Firefox. -