Commit 9404a109 authored by Nicolas Lenz's avatar Nicolas Lenz
Browse files

Misc, config

parent aa8b6a15
Pipeline #864 passed with stages
in 6 minutes and 55 seconds
import ClassyPrelude
import Application () -- for YesodDispatch instance
import Foundation
import Yesod.Core
......
......@@ -19,7 +19,7 @@ forms:
type: quiz
success:
file: winner.html
fail:
failure:
file: loser.html
questions:
- id: coord1
......
/ HomeR GET
/add/#Int/#Int AddR GET
/ HomeR GET
/add/#Int/#Int AddR GET
/form/#String FormR GET POST
......@@ -4,7 +4,13 @@ license: Apache-2.0
dependencies:
- base
- classy-prelude
- yesod-core
- yesod-form
default-extensions:
- NoImplicitPrelude
- OverloadedStrings
library:
source-dirs: src
......
......@@ -2,6 +2,8 @@
{-# LANGUAGE QuasiQuotes #-}
module Add where
import ClassyPrelude hiding (Handler)
import Foundation
import Yesod.Core
......
......@@ -5,10 +5,12 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Application where
import ClassyPrelude
import Foundation
import Yesod.Core
import Add
import Form
import Home
mkYesodDispatch "App" resourcesApp
module Config where
import ClassyPrelude
data Config = Config
{ configAdmin :: ConfigAdmin
, configForms :: [ConfigForm]
}
data ConfigAdmin = ConfigAdmin
{ configAdminUser :: Text
, configAdminHash :: ByteString
}
data ConfigForm = ConfigForm
{ configFormId :: Text
, configFormContent :: ConfigFormContent
}
data ConfigFormContent
= ConfigFormSurvey
{ configFormSurveyHandler :: ConfigFormHandler
, configFormSurveyQuestions :: [ConfigFormSurveyQuestion]
}
| ConfigFormQuiz
{ configFormQuizSuccess :: ConfigFormHandler
, configFormQuizFail :: ConfigFormHandler
, configFormQuizQuestions :: [ConfigFormQuizQuestion]
}
data ConfigFormHandler = ConfigFormHandlerSuccess | ConfigFormHandlerFailure
data ConfigFormSurveyQuestion = ConfigFormSurveyQuestion
{ configFormSurveyQuestionId :: Text
, configFormSurveyQuestionType :: ConfigFormQuestionType
}
data ConfigFormQuizQuestion = ConfigFormQuizQuestion
{ configFormQuizQuestionId :: Text
, configFormQuizQuestionType :: ConfigFormQuestionType
}
data ConfigFormQuestionType = ConfigFormQuestionTypeString | ConfigFormQuestionTypeInt
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module Form where
import ClassyPrelude hiding (Handler)
import Foundation
import Yesod.Core
getFormR :: String -> Handler TypedContent
getFormR id = undefined
postFormR :: String -> Handler TypedContent
postFormR id = undefined
......@@ -4,6 +4,7 @@
{-# LANGUAGE ViewPatterns #-}
module Foundation where
import ClassyPrelude
import Yesod.Core
data App = App
......
......@@ -2,6 +2,7 @@
{-# LANGUAGE QuasiQuotes #-}
module Home where
import ClassyPrelude hiding (Handler)
import Foundation
import Yesod.Core
......
......@@ -14,15 +14,20 @@ library
exposed-modules:
Add
Application
Config
Form
Foundation
Home
other-modules:
Paths_surver
hs-source-dirs:
src
default-extensions: NoImplicitPrelude OverloadedStrings
build-depends:
base
, classy-prelude
, yesod-core
, yesod-form
default-language: Haskell2010
executable surver
......@@ -31,9 +36,12 @@ executable surver
Paths_surver
hs-source-dirs:
app
default-extensions: NoImplicitPrelude OverloadedStrings
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
base
, classy-prelude
, surver
, yesod-core
, yesod-form
default-language: Haskell2010
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment