made signup TOS configurable

This commit is contained in:
nek0 2015-04-04 10:34:19 +02:00
parent 297df5d12f
commit 823d00ba8e
4 changed files with 10 additions and 2 deletions

View file

@ -29,6 +29,7 @@ getSignupR = do
case block of
False -> do
formLayout $ do
master <- getYesod
setTitle "Eidolon :: Signup"
$(widgetFile "signup")
True -> do

View file

@ -70,6 +70,9 @@ data AppSettings = AppSettings
-- ^ Google Analytics code
, appSignupBlocked :: Bool
-- ^ block signup site
, appTos1 :: Text
, appTos2 :: Text
-- ^ Terms of Service
}
instance FromJSON AppSettings where
@ -97,6 +100,8 @@ instance FromJSON AppSettings where
appAnalytics <- o .:? "analytics"
appSignupBlocked <- o .: "signupBlocked"
appTos1 <- o .: "tos1"
appTos2 <- o .: "tos2"
return AppSettings {..}

View file

@ -42,3 +42,5 @@ copyright: Insert copyright statement here
# block signup process
signupBlocked: "_env:SIGNUP_BLOCK:false"
tos1: "Terms of Service 1"
tos2: "Terms of Service 2"

View file

@ -11,10 +11,10 @@ $newline always
<input id="email" name="email" type="email" required>
<p class="tos">
<input type="checkbox" id="tos-1" name="tos-1" value="tos-1" required>
<label for="tos-1">terms of service 1
<label for="tos-1">#{appTos1 $ appSettings master}
<p class="tos">
<input type="checkbox" id="tos-2" name="tos-2" value="tos-2" required>
<label for="tos-2">terms of service 2
<label for="tos-2">#{appTos2 $ appSettings master}
<input id="signup" type="submit" value="Signup">
<script src="/static/js/jquery.min.js" type="text/javascript">
<script src="/static/js/signup.js" type="text/javascript">