Display SSH key example as a placeholder, not a default value (thanks zPlus!)
This commit is contained in:
parent
339c2253f9
commit
e0d7612908
1 changed files with 8 additions and 8 deletions
|
@ -18,9 +18,7 @@ module Vervis.Form.Key
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
||||||
import Yesod.Form.Fields
|
import Yesod.Form
|
||||||
import Yesod.Form.Functions
|
|
||||||
import Yesod.Form.Types
|
|
||||||
|
|
||||||
import Vervis.Field.Key
|
import Vervis.Field.Key
|
||||||
import Vervis.Foundation
|
import Vervis.Foundation
|
||||||
|
@ -29,14 +27,16 @@ import Vervis.Model.Ident
|
||||||
|
|
||||||
newKeyAForm :: PersonId -> AForm Handler SshKey
|
newKeyAForm :: PersonId -> AForm Handler SshKey
|
||||||
newKeyAForm pid = mk
|
newKeyAForm pid = mk
|
||||||
<$> (text2ky <$> areq (nameField pid) "Name*" Nothing)
|
<$> (text2ky <$> areq (nameField pid) "Name*" Nothing)
|
||||||
<*> areq sshKeyField "Content*" (Just defKey)
|
<*> areq sshKeyField keySettings Nothing
|
||||||
where
|
where
|
||||||
mk n (a, c) = SshKey n pid a c
|
mk n (a, c) = SshKey n pid a c
|
||||||
|
keySettings =
|
||||||
|
FieldSettings
|
||||||
|
"Content*" Nothing Nothing Nothing [("placeholder", defKey)]
|
||||||
defKey =
|
defKey =
|
||||||
( "ssh-rsa"
|
"ssh-rsa \
|
||||||
, "VGhpcyBpcyBub3QgYSBrZXksIHBsZWFzZSBwYXN0ZSBhIHJlYWwgb25lIDopCg=="
|
\AAAPcyBpcyubQgYBrZkWzZSBwY..."
|
||||||
)
|
|
||||||
|
|
||||||
newKeyForm :: PersonId -> Form SshKey
|
newKeyForm :: PersonId -> Form SshKey
|
||||||
newKeyForm = renderDivs . newKeyAForm
|
newKeyForm = renderDivs . newKeyAForm
|
||||||
|
|
Loading…
Reference in a new issue