diff --git a/Handler/YourAccount.hs b/Handler/YourAccount.hs index 1e99ce1..03e3e81 100644 --- a/Handler/YourAccount.hs +++ b/Handler/YourAccount.hs @@ -48,15 +48,18 @@ checkPassword Nothing = True checkPassword (Just "") = True checkPassword (Just passwd) = isPasswordAcceptable passwd -autocompleteOff name = setts { fsAttrs = (fsAttrs setts) ++ [("autocomplete", "nope")]} - where setts = (bfs name) +autocompleteOff name tooltip = setts { fsAttrs = (fsAttrs setts) ++ [("autocomplete", "nope")]} + where setts = (bfs name) { fsTooltip = Just $ SomeMessage tooltip } + +fieldWithTooltip :: forall master msg msg1. (RenderMessage master msg, RenderMessage master msg1) => msg -> msg1 -> FieldSettings master +fieldWithTooltip name tooltip = (bfs name) { fsTooltip = Just $ SomeMessage tooltip } yourAccountForm :: Maybe Text -> Maybe Text -> Maybe Text -> Bool -> Form (Maybe Text, Maybe Text, Maybe Text, Maybe Text, Maybe FileInfo, Bool) yourAccountForm maybeName maybeLocalId maybeSshPubKey anonimised = renderBootstrap3 BootstrapBasicForm $ (,,,,,) - <$> aopt textField (bfs MsgAccountName) (Just maybeName) - <*> aopt textField (autocompleteOff MsgId) (Just maybeLocalId) + <$> aopt textField (fieldWithTooltip MsgAccountName MsgAccountNameTooltip) (Just maybeName) + <*> aopt textField (autocompleteOff MsgId MsgIdTooltip) (Just maybeLocalId) <*> aopt passwordConfirmField (bfs MsgPassword) Nothing - <*> aopt textField (bfs MsgSshPubKey) (Just maybeSshPubKey) + <*> aopt textField (fieldWithTooltip MsgSshPubKey MsgSshPubKeyTooltip) (Just maybeSshPubKey) <*> fileAFormOpt (bfs MsgAvatar) <*> areq checkBoxField (bfs MsgWantToBeAnonimised) (Just anonimised) diff --git a/messages/en.msg b/messages/en.msg index c8efede..50a12fc 100644 --- a/messages/en.msg +++ b/messages/en.msg @@ -17,8 +17,11 @@ SubmissionTags: Submission tags YourAccount: your account AboutMe: about me AccountName: name +AccountNameTooltip: your human-readable name (to be shown on the leaderboard) Id: ID +IdTooltip: to be used in the URLs for your repos (only lower-case letters, digits or hyphens, must start with a lower-case letter), once set cannot be changed! SshPubKey: your SSH public key +SshPubKeyTooltip: needed if you want to access repos hosted on Gonito.net (usually ".ssh/id_rsa.pub" in your home directory after you generated private/public key pair) Home: home Search: search GitCommitSha1: Git commit SHA1 hash diff --git a/templates/your-account.hamlet b/templates/your-account.hamlet index 44ed996..47a3d24 100644 --- a/templates/your-account.hamlet +++ b/templates/your-account.hamlet @@ -6,7 +6,7 @@ $nothing