From e0d7612908ea6171e6956cb4883e0ad11dcdce71 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Sat, 19 Oct 2019 06:35:28 +0000 Subject: [PATCH] Display SSH key example as a placeholder, not a default value (thanks zPlus!) --- src/Vervis/Form/Key.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Vervis/Form/Key.hs b/src/Vervis/Form/Key.hs index ef0a28b..e27ce01 100644 --- a/src/Vervis/Form/Key.hs +++ b/src/Vervis/Form/Key.hs @@ -18,9 +18,7 @@ module Vervis.Form.Key ) where -import Yesod.Form.Fields -import Yesod.Form.Functions -import Yesod.Form.Types +import Yesod.Form import Vervis.Field.Key import Vervis.Foundation @@ -29,14 +27,16 @@ import Vervis.Model.Ident newKeyAForm :: PersonId -> AForm Handler SshKey newKeyAForm pid = mk - <$> (text2ky <$> areq (nameField pid) "Name*" Nothing) - <*> areq sshKeyField "Content*" (Just defKey) + <$> (text2ky <$> areq (nameField pid) "Name*" Nothing) + <*> areq sshKeyField keySettings Nothing where mk n (a, c) = SshKey n pid a c + keySettings = + FieldSettings + "Content*" Nothing Nothing Nothing [("placeholder", defKey)] defKey = - ( "ssh-rsa" - , "VGhpcyBpcyBub3QgYSBrZXksIHBsZWFzZSBwYXN0ZSBhIHJlYWwgb25lIDopCg==" - ) + "ssh-rsa \ + \AAAPcyBpcyubQgYBrZkWzZSBwY..." newKeyForm :: PersonId -> Form SshKey newKeyForm = renderDivs . newKeyAForm