use tooltips instead of a list

This commit is contained in:
Filip Gralinski 2017-09-23 15:04:40 +02:00
parent 8be73e73a1
commit e3a3f28da0
3 changed files with 13 additions and 12 deletions

View File

@ -48,15 +48,18 @@ checkPassword Nothing = True
checkPassword (Just "") = True checkPassword (Just "") = True
checkPassword (Just passwd) = isPasswordAcceptable passwd checkPassword (Just passwd) = isPasswordAcceptable passwd
autocompleteOff name = setts { fsAttrs = (fsAttrs setts) ++ [("autocomplete", "nope")]} autocompleteOff name tooltip = setts { fsAttrs = (fsAttrs setts) ++ [("autocomplete", "nope")]}
where setts = (bfs name) 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 :: 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 $ (,,,,,) yourAccountForm maybeName maybeLocalId maybeSshPubKey anonimised = renderBootstrap3 BootstrapBasicForm $ (,,,,,)
<$> aopt textField (bfs MsgAccountName) (Just maybeName) <$> aopt textField (fieldWithTooltip MsgAccountName MsgAccountNameTooltip) (Just maybeName)
<*> aopt textField (autocompleteOff MsgId) (Just maybeLocalId) <*> aopt textField (autocompleteOff MsgId MsgIdTooltip) (Just maybeLocalId)
<*> aopt passwordConfirmField (bfs MsgPassword) Nothing <*> aopt passwordConfirmField (bfs MsgPassword) Nothing
<*> aopt textField (bfs MsgSshPubKey) (Just maybeSshPubKey) <*> aopt textField (fieldWithTooltip MsgSshPubKey MsgSshPubKeyTooltip) (Just maybeSshPubKey)
<*> fileAFormOpt (bfs MsgAvatar) <*> fileAFormOpt (bfs MsgAvatar)
<*> areq checkBoxField (bfs MsgWantToBeAnonimised) (Just anonimised) <*> areq checkBoxField (bfs MsgWantToBeAnonimised) (Just anonimised)

View File

@ -17,8 +17,11 @@ SubmissionTags: Submission tags
YourAccount: your account YourAccount: your account
AboutMe: about me AboutMe: about me
AccountName: name AccountName: name
AccountNameTooltip: your human-readable name (to be shown on the leaderboard)
Id: ID 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 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 Home: home
Search: search Search: search
GitCommitSha1: Git commit SHA1 hash GitCommitSha1: Git commit SHA1 hash

View File

@ -6,7 +6,7 @@
$nothing $nothing
<div class="alert alert-info" role="alert"> <div class="alert alert-info" role="alert">
<p> <p>
<strong>Please set up your password below so that you could log in when <a href="https://developer.mozilla.org/en-US/Persona">Persona</a> authentication system is shut down. <strong>Please set up your password below so that you could log in.
<img style="max-width:80px;padding-bottom:30px" src=@{AvatarR userId}> <img style="max-width:80px;padding-bottom:30px" src=@{AvatarR userId}>
<form method=post action=@{YourAccountR}#form enctype=#{formEnctype} autocomplete="off"> <form method=post action=@{YourAccountR}#form enctype=#{formEnctype} autocomplete="off">
^{formWidget} ^{formWidget}
@ -14,9 +14,4 @@
_{MsgSubmit} <span class="glyphicon glyphicon-upload"></span> _{MsgSubmit} <span class="glyphicon glyphicon-upload"></span>
<hr> <hr>
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item"><b>Name</b> is your human-readable name (to be shown on the leaderboard).
<li class="list-group-item"><b>ID</b> is used in the URLs for your repos (must be composed of lower-case letters, digits or hyphyns, must start with a lower-case letter).
<li class="list-group-item"><b>Password</b> is needed when Persona is closed.
<li class="list-group-item"><b>SSH public key</b> is needed if you want to access repos hosted on Gonito.net (usually it is <tt>.ssh/id_rsa.pub</tt> in your home directory after you generated private/public key pair).
<li class="list-group-item">ID cannot be changed once it is set up.
<li class="list-group-item">You don't need to specify your ID and SSH public key, if you don't use private repos hosted on Gonito.net. <li class="list-group-item">You don't need to specify your ID and SSH public key, if you don't use private repos hosted on Gonito.net.