diff --git a/Assistant/WebApp/Configurators/AWS.hs b/Assistant/WebApp/Configurators/AWS.hs index bb8935b8b2..a7250d8cce 100644 --- a/Assistant/WebApp/Configurators/AWS.hs +++ b/Assistant/WebApp/Configurators/AWS.hs @@ -68,8 +68,8 @@ s3InputAForm defcreds = AWSInput <$> accessKeyIDFieldWithHelp (T.pack . fst <$> defcreds) <*> secretAccessKeyField (T.pack . snd <$> defcreds) <*> datacenterField AWS.S3 - <*> areq (selectFieldList storageclasses) "Storage class" (Just StandardRedundancy) - <*> areq textField "Repository name" (Just "S3") + <*> areq (selectFieldList storageclasses) (bfs "Storage class") (Just StandardRedundancy) + <*> areq textField (bfs "Repository name") (Just "S3") <*> enableEncryptionField where storageclasses :: [(Text, StorageClass)] @@ -84,7 +84,7 @@ glacierInputAForm defcreds = AWSInput <*> secretAccessKeyField (T.pack . snd <$> defcreds) <*> datacenterField AWS.Glacier <*> pure StandardRedundancy - <*> areq textField "Repository name" (Just "glacier") + <*> areq textField (bfs "Repository name") (Just "glacier") <*> enableEncryptionField awsCredsAForm :: Maybe CredPair -> MkAForm AWSCreds @@ -93,7 +93,7 @@ awsCredsAForm defcreds = AWSCreds <*> secretAccessKeyField (T.pack . snd <$> defcreds) accessKeyIDField :: Widget -> Maybe Text -> MkAForm Text -accessKeyIDField help = areq (textField `withNote` help) "Access Key ID" +accessKeyIDField help = areq (textField `withNote` help) (bfs "Access Key ID") accessKeyIDFieldWithHelp :: Maybe Text -> MkAForm Text accessKeyIDFieldWithHelp = accessKeyIDField help @@ -104,10 +104,10 @@ accessKeyIDFieldWithHelp = accessKeyIDField help |] secretAccessKeyField :: Maybe Text -> MkAForm Text -secretAccessKeyField = areq passwordField "Secret Access Key" +secretAccessKeyField = areq passwordField (bfs "Secret Access Key") datacenterField :: AWS.Service -> MkAForm Text -datacenterField service = areq (selectFieldList list) "Datacenter" defregion +datacenterField service = areq (selectFieldList list) (bfs "Datacenter") defregion where list = M.toList $ AWS.regionMap service defregion = Just $ AWS.defaultRegion service @@ -120,7 +120,7 @@ postAddS3R :: Handler Html postAddS3R = awsConfigurator $ do defcreds <- liftAnnex previouslyUsedAWSCreds ((result, form), enctype) <- liftH $ - runFormPostNoToken $ renderBootstrap $ s3InputAForm defcreds + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout $ s3InputAForm defcreds case result of FormSuccess input -> liftH $ do let name = T.unpack $ repoName input @@ -143,7 +143,7 @@ postAddGlacierR :: Handler Html postAddGlacierR = glacierConfigurator $ do defcreds <- liftAnnex previouslyUsedAWSCreds ((result, form), enctype) <- liftH $ - runFormPostNoToken $ renderBootstrap $ glacierInputAForm defcreds + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout $ glacierInputAForm defcreds case result of FormSuccess input -> liftH $ do let name = T.unpack $ repoName input @@ -186,7 +186,7 @@ enableAWSRemote :: RemoteType -> UUID -> Widget enableAWSRemote remotetype uuid = do defcreds <- liftAnnex previouslyUsedAWSCreds ((result, form), enctype) <- liftH $ - runFormPostNoToken $ renderBootstrap $ awsCredsAForm defcreds + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout $ awsCredsAForm defcreds case result of FormSuccess creds -> liftH $ do m <- liftAnnex readRemoteLog diff --git a/Assistant/WebApp/Configurators/Delete.hs b/Assistant/WebApp/Configurators/Delete.hs index 093ccda2ba..168f5edd12 100644 --- a/Assistant/WebApp/Configurators/Delete.hs +++ b/Assistant/WebApp/Configurators/Delete.hs @@ -89,8 +89,8 @@ deleteCurrentRepository = dangerPage $ do havegitremotes <- haveremotes syncGitRemotes havedataremotes <- haveremotes syncDataRemotes ((result, form), enctype) <- liftH $ - runFormPostNoToken $ renderBootstrap $ sanityVerifierAForm $ - SanityVerifier magicphrase + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout $ + sanityVerifierAForm $ SanityVerifier magicphrase case result of FormSuccess _ -> liftH $ do dir <- liftAnnex $ fromRepo Git.repoPath @@ -122,7 +122,7 @@ data SanityVerifier = SanityVerifier T.Text sanityVerifierAForm :: SanityVerifier -> MkAForm SanityVerifier sanityVerifierAForm template = SanityVerifier - <$> areq checksanity "Confirm deletion?" Nothing + <$> areq checksanity (bfs "Confirm deletion?") Nothing where checksanity = checkBool (\input -> SanityVerifier input == template) insane textField diff --git a/Assistant/WebApp/Configurators/Edit.hs b/Assistant/WebApp/Configurators/Edit.hs index 22483dd024..17dc5f1564 100644 --- a/Assistant/WebApp/Configurators/Edit.hs +++ b/Assistant/WebApp/Configurators/Edit.hs @@ -142,9 +142,9 @@ setRepoConfig uuid mremote oldc newc = do editRepositoryAForm :: Maybe Remote -> RepoConfig -> MkAForm RepoConfig editRepositoryAForm mremote def = RepoConfig <$> areq (if ishere then readonlyTextField else textField) - "Name" (Just $ repoName def) - <*> aopt textField "Description" (Just $ repoDescription def) - <*> areq (selectFieldList groups `withNote` help) "Repository group" (Just $ repoGroup def) + (bfs "Name") (Just $ repoName def) + <*> aopt textField (bfs "Description") (Just $ repoDescription def) + <*> areq (selectFieldList groups `withNote` help) (bfs "Repository group") (Just $ repoGroup def) <*> associateddirectory <*> areq checkBoxField "Syncing enabled" (Just $ repoSyncable def) where @@ -166,7 +166,7 @@ editRepositoryAForm mremote def = RepoConfig associateddirectory = case repoAssociatedDirectory def of Nothing -> aopt hiddenField "" Nothing - Just d -> aopt textField "Associated directory" (Just $ Just d) + Just d -> aopt textField (bfs "Associated directory") (Just $ Just d) getEditRepositoryR :: RepoId -> Handler Html getEditRepositoryR = postEditRepositoryR @@ -195,7 +195,7 @@ editForm new (RepoUUID uuid) = page "Edit repository" (Just Configuration) $ do curr <- liftAnnex $ getRepoConfig uuid mremote liftAnnex $ checkAssociatedDirectory curr mremote ((result, form), enctype) <- liftH $ - runFormPostNoToken $ renderBootstrap $ editRepositoryAForm mremote curr + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout $ editRepositoryAForm mremote curr case result of FormSuccess input -> liftH $ do setRepoConfig uuid mremote curr input diff --git a/Assistant/WebApp/Configurators/Fsck.hs b/Assistant/WebApp/Configurators/Fsck.hs index c443dec891..84764f17bf 100644 --- a/Assistant/WebApp/Configurators/Fsck.hs +++ b/Assistant/WebApp/Configurators/Fsck.hs @@ -64,10 +64,10 @@ runFsckForm new activity = case activity of u <- liftAnnex getUUID repolist <- liftAssistant (getrepolist ru) runFormPostNoToken $ \msg -> do - (reposRes, reposView) <- mreq (selectFieldList repolist) "" (Just ru) - (durationRes, durationView) <- mreq intField "" (Just $ durationSeconds d `quot` 60 ) - (timeRes, timeView) <- mreq (selectFieldList times) "" (Just t) - (recurranceRes, recurranceView) <- mreq (selectFieldList recurrances) "" (Just r) + (reposRes, reposView) <- mreq (selectFieldList repolist) (bfs "") (Just ru) + (durationRes, durationView) <- mreq intField (bfs "") (Just $ durationSeconds d `quot` 60 ) + (timeRes, timeView) <- mreq (selectFieldList times) (bfs "") (Just t) + (recurranceRes, recurranceView) <- mreq (selectFieldList recurrances) (bfs "") (Just r) let form = do webAppFormAuthToken $(widgetFile "configurators/fsck/formcontent") @@ -175,7 +175,8 @@ fsckPreferencesAForm def = FsckPreferences runFsckPreferencesForm :: Handler ((FormResult FsckPreferences, Widget), Enctype) runFsckPreferencesForm = do prefs <- liftAnnex getFsckPreferences - runFormPostNoToken $ renderBootstrap $ fsckPreferencesAForm prefs + runFormPostNoToken $ renderBootstrap3 formLayout $ fsckPreferencesAForm prefs + where formLayout = BootstrapHorizontalForm (ColSm 0) (ColSm 2) (ColSm 0) (ColSm 10) showFsckPreferencesForm :: Widget showFsckPreferencesForm = do diff --git a/Assistant/WebApp/Configurators/IA.hs b/Assistant/WebApp/Configurators/IA.hs index f7fe3cb74c..90d27c4f92 100644 --- a/Assistant/WebApp/Configurators/IA.hs +++ b/Assistant/WebApp/Configurators/IA.hs @@ -83,8 +83,8 @@ iaInputAForm :: Maybe CredPair -> MkAForm IAInput iaInputAForm defcreds = IAInput <$> accessKeyIDFieldWithHelp (T.pack . fst <$> defcreds) <*> AWS.secretAccessKeyField (T.pack . snd <$> defcreds) - <*> areq (selectFieldList mediatypes) "Media Type" (Just MediaOmitted) - <*> areq (textField `withExpandableNote` ("Help", itemNameHelp)) "Item Name" Nothing + <*> areq (selectFieldList mediatypes) (bfs "Media Type") (Just MediaOmitted) + <*> areq (textField `withExpandableNote` ("Help", itemNameHelp)) (bfs "Item Name") Nothing where mediatypes :: [(Text, MediaType)] mediatypes = map (\t -> (T.pack $ showMediaType t, t)) [minBound..] @@ -126,7 +126,7 @@ postAddIAR :: Handler Html postAddIAR = iaConfigurator $ do defcreds <- liftAnnex previouslyUsedIACreds ((result, form), enctype) <- liftH $ - runFormPostNoToken $ renderBootstrap $ iaInputAForm defcreds + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout $ iaInputAForm defcreds case result of FormSuccess input -> liftH $ do let name = escapeBucket $ T.unpack $ itemName input @@ -165,7 +165,7 @@ enableIARemote :: UUID -> Widget enableIARemote uuid = do defcreds <- liftAnnex previouslyUsedIACreds ((result, form), enctype) <- liftH $ - runFormPostNoToken $ renderBootstrap $ iaCredsAForm defcreds + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout $ iaCredsAForm defcreds case result of FormSuccess creds -> liftH $ do m <- liftAnnex readRemoteLog diff --git a/Assistant/WebApp/Configurators/Local.hs b/Assistant/WebApp/Configurators/Local.hs index 5dcb920a7d..5e8654389c 100644 --- a/Assistant/WebApp/Configurators/Local.hs +++ b/Assistant/WebApp/Configurators/Local.hs @@ -143,7 +143,7 @@ defaultRepositoryPath firstrun = do newRepositoryForm :: FilePath -> Hamlet.Html -> MkMForm RepositoryPath newRepositoryForm defpath msg = do - (pathRes, pathView) <- mreq (repositoryPathField True) "" + (pathRes, pathView) <- mreq (repositoryPathField True) (bfs "") (Just $ T.pack $ addTrailingPathSeparator defpath) let (err, errmsg) = case pathRes of FormMissing -> (False, "") @@ -217,10 +217,10 @@ getCombineRepositoryR newrepopath newrepouuid = do remotename = takeFileName newrepopath selectDriveForm :: [RemovableDrive] -> Hamlet.Html -> MkMForm RemovableDrive -selectDriveForm drives = renderBootstrap $ RemovableDrive +selectDriveForm drives = renderBootstrap3 bootstrapFormLayout $ RemovableDrive <$> pure Nothing - <*> areq (selectFieldList pairs `withNote` onlywritable) "Select drive:" Nothing - <*> areq textField "Use this directory on the drive:" + <*> areq (selectFieldList pairs `withNote` onlywritable) (bfs "Select drive:") Nothing + <*> areq textField (bfs "Use this directory on the drive:") (Just $ T.pack gitAnnexAssistantDefaultDir) where pairs = zip (map describe drives) (map mountPoint drives) diff --git a/Assistant/WebApp/Configurators/Pairing.hs b/Assistant/WebApp/Configurators/Pairing.hs index c364346b49..899af579e5 100644 --- a/Assistant/WebApp/Configurators/Pairing.hs +++ b/Assistant/WebApp/Configurators/Pairing.hs @@ -265,8 +265,8 @@ data InputSecret = InputSecret { secretText :: Maybe Text } promptSecret :: Maybe PairMsg -> (Text -> Secret -> Widget) -> Handler Html promptSecret msg cont = pairPage $ do ((result, form), enctype) <- liftH $ - runFormPostNoToken $ renderBootstrap $ - InputSecret <$> aopt textField "Secret phrase" Nothing + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout $ + InputSecret <$> aopt textField (bfs "Secret phrase") Nothing case result of FormSuccess v -> do let rawsecret = fromMaybe "" $ secretText v diff --git a/Assistant/WebApp/Configurators/Preferences.hs b/Assistant/WebApp/Configurators/Preferences.hs index d4783e7422..0f9ac09954 100644 --- a/Assistant/WebApp/Configurators/Preferences.hs +++ b/Assistant/WebApp/Configurators/Preferences.hs @@ -36,13 +36,13 @@ data PrefsForm = PrefsForm prefsAForm :: PrefsForm -> MkAForm PrefsForm prefsAForm def = PrefsForm <$> areq (storageField `withNote` diskreservenote) - "Disk reserve" (Just $ diskReserve def) + (bfs "Disk reserve") (Just $ diskReserve def) <*> areq (positiveIntField `withNote` numcopiesnote) - "Number of copies" (Just $ numCopies def) + (bfs "Number of copies") (Just $ numCopies def) <*> areq (checkBoxField `withNote` autostartnote) "Auto start" (Just $ autoStart def) <*> areq (selectFieldList autoUpgradeChoices) - autoUpgradeLabel (Just $ autoUpgrade def) + (bfs autoUpgradeLabel) (Just $ autoUpgrade def) <*> areq (checkBoxField `withNote` debugnote) "Enable debug logging" (Just $ debugEnabled def) where @@ -109,7 +109,7 @@ postPreferencesR :: Handler Html postPreferencesR = page "Preferences" (Just Configuration) $ do ((result, form), enctype) <- liftH $ do current <- liftAnnex getPrefs - runFormPostNoToken $ renderBootstrap $ prefsAForm current + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout $ prefsAForm current case result of FormSuccess new -> liftH $ do liftAnnex $ storePrefs new diff --git a/Assistant/WebApp/Configurators/Ssh.hs b/Assistant/WebApp/Configurators/Ssh.hs index d5bde622f3..3b4c9ac8b3 100644 --- a/Assistant/WebApp/Configurators/Ssh.hs +++ b/Assistant/WebApp/Configurators/Ssh.hs @@ -76,10 +76,10 @@ sshInputAForm :: Field Handler Text -> SshInput -> AForm Handler SshInput sshInputAForm :: Field WebApp WebApp Text -> SshInput -> AForm WebApp WebApp SshInput #endif sshInputAForm hostnamefield def = SshInput - <$> aopt check_hostname "Host name" (Just $ inputHostname def) - <*> aopt check_username "User name" (Just $ inputUsername def) - <*> aopt textField "Directory" (Just $ Just $ fromMaybe (T.pack gitAnnexAssistantDefaultDir) $ inputDirectory def) - <*> areq intField "Port" (Just $ inputPort def) + <$> aopt check_hostname (bfs "Host name") (Just $ inputHostname def) + <*> aopt check_username (bfs "User name") (Just $ inputUsername def) + <*> aopt textField (bfs "Directory") (Just $ Just $ fromMaybe (T.pack gitAnnexAssistantDefaultDir) $ inputDirectory def) + <*> areq intField (bfs "Port") (Just $ inputPort def) where check_username = checkBool (all (`notElem` "/:@ \t") . T.unpack) bad_username textField @@ -121,7 +121,7 @@ postAddSshR :: Handler Html postAddSshR = sshConfigurator $ do username <- liftIO $ T.pack <$> myUserName ((result, form), enctype) <- liftH $ - runFormPostNoToken $ renderBootstrap $ sshInputAForm textField $ + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout $ sshInputAForm textField $ SshInput Nothing (Just username) Nothing 22 case result of FormSuccess sshinput -> do @@ -173,7 +173,7 @@ enableSpecialSshRemote getsshinput rsyncnetsetup genericsetup u = do case (mkSshInput . unmangle <$> getsshinput m, M.lookup "name" m) of (Just sshinput, Just reponame) -> sshConfigurator $ do ((result, form), enctype) <- liftH $ - runFormPostNoToken $ renderBootstrap $ sshInputAForm textField sshinput + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout $ sshInputAForm textField sshinput case result of FormSuccess sshinput' | isRsyncNet (inputHostname sshinput') -> @@ -450,7 +450,7 @@ getAddRsyncNetR = postAddRsyncNetR postAddRsyncNetR :: Handler Html postAddRsyncNetR = do ((result, form), enctype) <- runFormPostNoToken $ - renderBootstrap $ sshInputAForm hostnamefield $ + renderBootstrap3 bootstrapFormLayout $ sshInputAForm hostnamefield $ SshInput Nothing Nothing Nothing 22 let showform status = inpage $ $(widgetFile "configurators/rsync.net/add") diff --git a/Assistant/WebApp/Configurators/Unused.hs b/Assistant/WebApp/Configurators/Unused.hs index 1f2fc87291..39bb0bd2f1 100644 --- a/Assistant/WebApp/Configurators/Unused.hs +++ b/Assistant/WebApp/Configurators/Unused.hs @@ -27,9 +27,9 @@ data UnusedForm = UnusedForm unusedForm :: UnusedForm -> Hamlet.Html -> MkMForm UnusedForm unusedForm def msg = do - (enableRes, enableView) <- mreq (selectFieldList enabledisable) "" + (enableRes, enableView) <- mreq (selectFieldList enabledisable) (bfs "") (Just $ enableExpire def) - (whenRes, whenView) <- mreq intField "" + (whenRes, whenView) <- mreq intField (bfs "") (Just $ expireWhen def) let form = do webAppFormAuthToken diff --git a/Assistant/WebApp/Configurators/WebDAV.hs b/Assistant/WebApp/Configurators/WebDAV.hs index 9da2d5ccaf..a0ed8f4037 100644 --- a/Assistant/WebApp/Configurators/WebDAV.hs +++ b/Assistant/WebApp/Configurators/WebDAV.hs @@ -45,16 +45,16 @@ toCredPair input = (T.unpack $ user input, T.unpack $ password input) boxComAForm :: Maybe CredPair -> MkAForm WebDAVInput boxComAForm defcreds = WebDAVInput - <$> areq textField "Username or Email" (T.pack . fst <$> defcreds) - <*> areq passwordField "Box.com Password" (T.pack . snd <$> defcreds) - <*> areq checkBoxField "Share this account with other devices and friends?" (Just True) - <*> areq textField "Directory" (Just "annex") + <$> areq textField (bfs "Username or Email") (T.pack . fst <$> defcreds) + <*> areq passwordField (bfs "Box.com Password") (T.pack . snd <$> defcreds) + <*> areq checkBoxField (bfs "Share this account with other devices and friends?") (Just True) + <*> areq textField (bfs "Directory") (Just "annex") <*> enableEncryptionField webDAVCredsAForm :: Maybe CredPair -> MkAForm WebDAVInput webDAVCredsAForm defcreds = WebDAVInput - <$> areq textField "Username or Email" (T.pack . fst <$> defcreds) - <*> areq passwordField "Password" (T.pack . snd <$> defcreds) + <$> areq textField (bfs "Username or Email") (T.pack . fst <$> defcreds) + <*> areq passwordField (bfs "Password") (T.pack . snd <$> defcreds) <*> pure False <*> pure T.empty <*> pure NoEncryption -- not used! @@ -66,7 +66,8 @@ postAddBoxComR :: Handler Html postAddBoxComR = boxConfigurator $ do defcreds <- liftAnnex $ previouslyUsedWebDAVCreds "box.com" ((result, form), enctype) <- liftH $ - runFormPostNoToken $ renderBootstrap $ boxComAForm defcreds + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout + $ boxComAForm defcreds case result of FormSuccess input -> liftH $ makeWebDavRemote initSpecialRemote "box.com" (toCredPair input) $ M.fromList @@ -109,7 +110,8 @@ postEnableWebDAVR uuid = do maybe (pure Nothing) previouslyUsedWebDAVCreds $ urlHost url ((result, form), enctype) <- liftH $ - runFormPostNoToken $ renderBootstrap $ webDAVCredsAForm defcreds + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout $ + webDAVCredsAForm defcreds case result of FormSuccess input -> liftH $ makeWebDavRemote enableSpecialRemote name (toCredPair input) M.empty diff --git a/Assistant/WebApp/Configurators/XMPP.hs b/Assistant/WebApp/Configurators/XMPP.hs index 047e86a76f..1c40af08bc 100644 --- a/Assistant/WebApp/Configurators/XMPP.hs +++ b/Assistant/WebApp/Configurators/XMPP.hs @@ -99,7 +99,7 @@ xmppform :: Route WebApp -> Handler Html xmppform next = xmppPage $ do ((result, form), enctype) <- liftH $ do oldcreds <- liftAnnex getXMPPCreds - runFormPostNoToken $ renderBootstrap $ xmppAForm $ + runFormPostNoToken $ renderBootstrap3 bootstrapFormLayout $ xmppAForm $ creds2Form <$> oldcreds let showform problem = $(widgetFile "configurators/xmpp") case result of @@ -162,8 +162,8 @@ creds2Form c = XMPPForm (xmppJID c) (xmppPassword c) xmppAForm :: (Maybe XMPPForm) -> MkAForm XMPPForm xmppAForm def = XMPPForm - <$> areq jidField "Jabber address" (formJID <$> def) - <*> areq passwordField "Password" Nothing + <$> areq jidField (bfs "Jabber address") (formJID <$> def) + <*> areq passwordField (bfs "Password") Nothing jidField :: MkField Text jidField = checkBool (isJust . parseJID) bad textField diff --git a/Assistant/WebApp/Form.hs b/Assistant/WebApp/Form.hs index d5922ea21f..4cc814a741 100644 --- a/Assistant/WebApp/Form.hs +++ b/Assistant/WebApp/Form.hs @@ -17,6 +17,8 @@ import Assistant.Gpg import Yesod hiding (textField, passwordField) import Yesod.Form.Fields as F +import Yesod.Form.Bootstrap3 hiding (bfs) +import Data.String (IsString (..)) import Data.Text (Text) {- Yesod's textField sets the required attribute for required fields. @@ -80,10 +82,27 @@ enableEncryptionField :: (RenderMessage site FormMessage) => AForm (HandlerT sit #else enableEncryptionField :: RenderMessage master FormMessage => AForm sub master EnableEncryption #endif -enableEncryptionField = areq (selectFieldList choices) "Encryption" (Just SharedEncryption) +enableEncryptionField = areq (selectFieldList choices) (bfs "Encryption") (Just SharedEncryption) where choices :: [(Text, EnableEncryption)] choices = [ ("Encrypt all data", SharedEncryption) , ("Disable encryption", NoEncryption) ] + +{- Defines the layout used by the Bootstrap3 form helper -} +bootstrapFormLayout :: BootstrapFormLayout +bootstrapFormLayout = BootstrapHorizontalForm (ColSm 0) (ColSm 2) (ColSm 0) (ColSm 5) + +{- Adds the form-control class used by Bootstrap3 for layout to a field + - This is the same as Yesod.Form.Bootstrap3.bfs except it takes just a Text + - parameter as I couldn't get the original bfs to compile due to type ambiguities. + -} +bfs :: Text -> FieldSettings master +bfs msg = FieldSettings + { fsLabel = SomeMessage msg + , fsName = Nothing + , fsId = Nothing + , fsAttrs = [("class", "form-control")] + , fsTooltip = Nothing + } diff --git a/Utility/Yesod.hs b/Utility/Yesod.hs index 2853b3369d..f8eb2c6dd3 100644 --- a/Utility/Yesod.hs +++ b/Utility/Yesod.hs @@ -25,6 +25,7 @@ module Utility.Yesod #if MIN_VERSION_yesod(1,2,0) import Yesod as Y +import Yesod.Form.Bootstrap3 as Y hiding (bfs) #else import Yesod as Y hiding (Html) #endif diff --git a/templates/configurators/addbox.com.hamlet b/templates/configurators/addbox.com.hamlet index 7217a22341..c6f2ca8074 100644 --- a/templates/configurators/addbox.com.hamlet +++ b/templates/configurators/addbox.com.hamlet @@ -12,9 +12,10 @@
^{form} ^{webAppFormAuthToken} -
- # - - Rescan for removable drives +
+
+ # + + Rescan for removable drives diff --git a/templates/configurators/addglacier.hamlet b/templates/configurators/addglacier.hamlet index a4748d502c..44c9ec1297 100644 --- a/templates/configurators/addglacier.hamlet +++ b/templates/configurators/addglacier.hamlet @@ -20,9 +20,10 @@
^{form} ^{webAppFormAuthToken} -
-