From e4dafcd5c6ac0fad207ba120453332b3598089fc Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Mon, 15 Feb 2016 20:36:01 +0100 Subject: [PATCH] generate correct Bootstrap forms --- Handler/ShowChallenge.hs | 8 ++++---- Handler/YourAccount.hs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Handler/ShowChallenge.hs b/Handler/ShowChallenge.hs index f0b3121..4bd1314 100644 --- a/Handler/ShowChallenge.hs +++ b/Handler/ShowChallenge.hs @@ -2,7 +2,7 @@ module Handler.ShowChallenge where import Import import Yesod.Form.Bootstrap3 (BootstrapFormLayout (..), renderBootstrap3, - withSmallInput) + withSmallInput, bfs) import Data.Monoid @@ -241,9 +241,9 @@ challengeSubmissionWidget formWidget formEnctype challenge = $(widgetFile "chall submissionForm :: Maybe Text -> Form (Text, Text, Text) submissionForm defaultUrl = renderBootstrap3 BootstrapBasicForm $ (,,) - <$> areq textField (fieldSettingsLabel MsgSubmissionDescription) Nothing - <*> areq textField (fieldSettingsLabel MsgSubmissionUrl) defaultUrl - <*> areq textField (fieldSettingsLabel MsgSubmissionBranch) (Just "master") + <$> areq textField (bfs MsgSubmissionDescription) Nothing + <*> areq textField (bfs MsgSubmissionUrl) defaultUrl + <*> areq textField (bfs MsgSubmissionBranch) (Just "master") getChallengeMySubmissionsR :: Text -> Handler Html getChallengeMySubmissionsR name = do diff --git a/Handler/YourAccount.hs b/Handler/YourAccount.hs index 6653d43..84d2d93 100644 --- a/Handler/YourAccount.hs +++ b/Handler/YourAccount.hs @@ -2,7 +2,7 @@ module Handler.YourAccount where import Import import Yesod.Form.Bootstrap3 (BootstrapFormLayout (..), renderBootstrap3, - withSmallInput) + withSmallInput, bfs) import Handler.Shared import Handler.Extract @@ -41,9 +41,9 @@ postYourAccountR = do yourAccountForm :: Maybe Text -> Maybe Text -> Maybe Text -> Form (Maybe Text, Maybe Text, Maybe Text) yourAccountForm maybeName maybeLocalId maybeSshPubKey = renderBootstrap3 BootstrapBasicForm $ (,,) - <$> aopt textField (fieldSettingsLabel MsgAccountName) (Just maybeName) - <*> aopt textField (fieldSettingsLabel MsgId) (Just maybeLocalId) - <*> aopt textField (fieldSettingsLabel MsgSshPubKey) (Just maybeSshPubKey) + <$> aopt textField (bfs MsgAccountName) (Just maybeName) + <*> aopt textField (bfs MsgId) (Just maybeLocalId) + <*> aopt textField (bfs MsgSshPubKey) (Just maybeSshPubKey) localIdRegexp = makeRegexOpts defaultCompOpt{newSyntax=True} defaultExecOpt ("\\`[a-z][-a-z0-9]{0,31}\\'" ::String)