Commit dad41aef authored by Martin Wortschack's avatar Martin Wortschack Committed by Kushal Pandya

Add explanatory help text to text inputs on user profile settings page

parent 4a6c5546
...@@ -256,7 +256,12 @@ label { ...@@ -256,7 +256,12 @@ label {
} }
} }
.input-md {
max-width: $input-md-width;
width: 100%;
}
.input-lg { .input-lg {
max-width: 320px; max-width: $input-lg-width;
width: 100%; width: 100%;
} }
/** Select2 selectbox style override **/ /** Select2 selectbox style override **/
.select2-container { .select2-container {
width: 100% !important; width: 100% !important;
&.input-md,
&.input-lg {
display: block;
}
} }
.select2-container, .select2-container,
......
...@@ -509,6 +509,8 @@ $gl-field-focus-shadow: rgba(0, 0, 0, 0.075); ...@@ -509,6 +509,8 @@ $gl-field-focus-shadow: rgba(0, 0, 0, 0.075);
$gl-field-focus-shadow-error: rgba($red-500, 0.6); $gl-field-focus-shadow-error: rgba($red-500, 0.6);
$input-short-width: 200px; $input-short-width: 200px;
$input-short-md-width: 280px; $input-short-md-width: 280px;
$input-md-width: 240px;
$input-lg-width: 320px;
/* /*
* Help * Help
......
...@@ -456,4 +456,15 @@ table.u2f-registrations { ...@@ -456,4 +456,15 @@ table.u2f-registrations {
} }
} }
} }
@include media-breakpoint-down(sm) {
.input-md,
.input-lg {
max-width: 100%;
}
}
}
.help-block {
color: $gl-text-color-secondary;
} }
...@@ -8,7 +8,7 @@ module UsersHelper ...@@ -8,7 +8,7 @@ module UsersHelper
end end
def user_email_help_text(user) def user_email_help_text(user)
return 'We also use email for avatar detection if no avatar is uploaded.' unless user.unconfirmed_email.present? return 'We also use email for avatar detection if no avatar is uploaded' unless user.unconfirmed_email.present?
confirmation_link = link_to 'Resend confirmation e-mail', user_confirmation_path(user: { email: @user.unconfirmed_email }), method: :post confirmation_link = link_to 'Resend confirmation e-mail', user_confirmation_path(user: { email: @user.unconfirmed_email }), method: :post
......
...@@ -71,43 +71,43 @@ ...@@ -71,43 +71,43 @@
%h4.prepend-top-0 %h4.prepend-top-0
= s_("Profiles|Main settings") = s_("Profiles|Main settings")
%p %p
= s_("Profiles|This information will appear on your profile.") = s_("Profiles|This information will appear on your profile")
- if current_user.ldap_user? - if current_user.ldap_user?
= s_("Profiles|Some options are unavailable for LDAP accounts") = s_("Profiles|Some options are unavailable for LDAP accounts")
.col-lg-8 .col-lg-8
.row .row
- if @user.read_only_attribute?(:name) - if @user.read_only_attribute?(:name)
= f.text_field :name, required: true, readonly: true, wrapper: { class: 'col-md-9' }, = f.text_field :name, required: true, readonly: true, wrapper: { class: 'col-md-9' },
help: s_("Profiles|Your name was automatically set based on your %{provider_label} account, so people you know can recognize you.") % { provider_label: attribute_provider_label(:name) } help: s_("Profiles|Your name was automatically set based on your %{provider_label} account, so people you know can recognize you") % { provider_label: attribute_provider_label(:name) }
- else - else
= f.text_field :name, label: 'Full name', required: true, wrapper: { class: 'col-md-9' }, help: "Enter your name, so people you know can recognize you." = f.text_field :name, label: 'Full name', required: true, wrapper: { class: 'col-md-9' }, help: s_("Profiles|Enter your name, so people you know can recognize you")
= f.text_field :id, readonly: true, label: 'User ID', wrapper: { class: 'col-md-3' } = f.text_field :id, readonly: true, label: 'User ID', wrapper: { class: 'col-md-3' }
- if @user.read_only_attribute?(:email) - if @user.read_only_attribute?(:email)
= f.text_field :email, required: true, readonly: true, help: s_("Profiles|Your email address was automatically set based on your %{provider_label} account.") % { provider_label: attribute_provider_label(:email) } = f.text_field :email, required: true, class: 'input-lg', readonly: true, help: s_("Profiles|Your email address was automatically set based on your %{provider_label} account") % { provider_label: attribute_provider_label(:email) }
- else - else
= f.text_field :email, required: true, value: (@user.email unless @user.temp_oauth_email?), = f.text_field :email, required: true, class: 'input-lg', value: (@user.email unless @user.temp_oauth_email?),
help: user_email_help_text(@user) help: user_email_help_text(@user)
= f.select :public_email, options_for_select(@user.all_emails, selected: @user.public_email), = f.select :public_email, options_for_select(@user.all_emails, selected: @user.public_email),
{ help: s_("Profiles|This email will be displayed on your public profile."), include_blank: s_("Profiles|Do not show on profile") }, { help: s_("Profiles|This email will be displayed on your public profile"), include_blank: s_("Profiles|Do not show on profile") },
control_class: 'select2' control_class: 'select2 input-lg'
- commit_email_docs_link = link_to s_('Profiles|Learn more'), help_page_path('user/profile/index', anchor: 'commit-email', target: '_blank') - commit_email_docs_link = link_to s_('Profiles|Learn more'), help_page_path('user/profile/index', anchor: 'commit-email', target: '_blank')
= f.select :commit_email, options_for_select(commit_email_select_options(@user), selected: selected_commit_email(@user)), = f.select :commit_email, options_for_select(commit_email_select_options(@user), selected: selected_commit_email(@user)),
{ help: s_("Profiles|This email will be used for web based operations, such as edits and merges. %{learn_more}").html_safe % { learn_more: commit_email_docs_link } }, { help: s_("Profiles|This email will be used for web based operations, such as edits and merges. %{learn_more}").html_safe % { learn_more: commit_email_docs_link } },
control_class: 'select2' control_class: 'select2 input-lg'
= f.select :preferred_language, Gitlab::I18n::AVAILABLE_LANGUAGES.map { |value, label| [label, value] }, = f.select :preferred_language, Gitlab::I18n::AVAILABLE_LANGUAGES.map { |value, label| [label, value] },
{ help: s_("Profiles|This feature is experimental and translations are not complete yet.") }, { help: s_("Profiles|This feature is experimental and translations are not complete yet") },
control_class: 'select2' control_class: 'select2 input-lg'
= f.text_field :skype = f.text_field :skype, class: 'input-md', placeholder: s_("Profiles|username")
= f.text_field :linkedin = f.text_field :linkedin, class: 'input-md', help: s_("Profiles|Your LinkedIn profile name from linkedin.com/in/profilename")
= f.text_field :twitter = f.text_field :twitter, class: 'input-md', placeholder: s_("Profiles|@username")
= f.text_field :website_url, label: s_("Profiles|Website") = f.text_field :website_url, class: 'input-lg', placeholder: s_("Profiles|website.com")
- if @user.read_only_attribute?(:location) - if @user.read_only_attribute?(:location)
= f.text_field :location, readonly: true, help: s_("Profiles|Your location was automatically set based on your %{provider_label} account.") % { provider_label: attribute_provider_label(:location) } = f.text_field :location, readonly: true, help: s_("Profiles|Your location was automatically set based on your %{provider_label} account") % { provider_label: attribute_provider_label(:location) }
- else - else
= f.text_field :location = f.text_field :location, class: 'input-lg', placeholder: s_("Profiles|City, country")
= f.text_field :organization = f.text_field :organization, class: 'input-md', help: s_("Profiles|Who you represent or work for")
= f.text_area :bio, rows: 4, maxlength: 250, help: s_("Profiles|Tell us about yourself in fewer than 250 characters.") = f.text_area :bio, rows: 4, maxlength: 250, help: s_("Profiles|Tell us about yourself in fewer than 250 characters")
%hr %hr
%h5= ("Private profile") %h5= ("Private profile")
.checkbox-icon-inline-wrapper .checkbox-icon-inline-wrapper
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
%h5= s_("Profiles|Private contributions") %h5= s_("Profiles|Private contributions")
= f.check_box :include_private_contributions, label: 'Include private contributions on my profile' = f.check_box :include_private_contributions, label: 'Include private contributions on my profile'
.help-block .help-block
= s_("Profiles|Choose to show contributions of private projects on your public profile without any project, repository or organization information.") = s_("Profiles|Choose to show contributions of private projects on your public profile without any project, repository or organization information")
.prepend-top-default.append-bottom-default .prepend-top-default.append-bottom-default
= f.submit s_("Profiles|Update profile settings"), class: 'btn btn-success' = f.submit s_("Profiles|Update profile settings"), class: 'btn btn-success'
= link_to _("Cancel"), user_path(current_user), class: 'btn btn-cancel' = link_to _("Cancel"), user_path(current_user), class: 'btn btn-cancel'
......
---
title: Adds explanatory text to input fields on user profile settings page
merge_request: 23673
author:
type: other
...@@ -5006,6 +5006,9 @@ msgstr "" ...@@ -5006,6 +5006,9 @@ msgstr ""
msgid "Profiles| You are going to change the username %{currentUsernameBold} to %{newUsernameBold}. Profile and projects will be redirected to the %{newUsername} namespace but this redirect will expire once the %{currentUsername} namespace is registered by another user or group. Please update your Git repository remotes as soon as possible." msgid "Profiles| You are going to change the username %{currentUsernameBold} to %{newUsernameBold}. Profile and projects will be redirected to the %{newUsername} namespace but this redirect will expire once the %{currentUsername} namespace is registered by another user or group. Please update your Git repository remotes as soon as possible."
msgstr "" msgstr ""
msgid "Profiles|@username"
msgstr ""
msgid "Profiles|Account scheduled for removal." msgid "Profiles|Account scheduled for removal."
msgstr "" msgstr ""
...@@ -5027,7 +5030,10 @@ msgstr "" ...@@ -5027,7 +5030,10 @@ msgstr ""
msgid "Profiles|Choose file..." msgid "Profiles|Choose file..."
msgstr "" msgstr ""
msgid "Profiles|Choose to show contributions of private projects on your public profile without any project, repository or organization information." msgid "Profiles|Choose to show contributions of private projects on your public profile without any project, repository or organization information"
msgstr ""
msgid "Profiles|City, country"
msgstr "" msgstr ""
msgid "Profiles|Clear status" msgid "Profiles|Clear status"
...@@ -5060,6 +5066,9 @@ msgstr "" ...@@ -5060,6 +5066,9 @@ msgstr ""
msgid "Profiles|Edit Profile" msgid "Profiles|Edit Profile"
msgstr "" msgstr ""
msgid "Profiles|Enter your name, so people you know can recognize you"
msgstr ""
msgid "Profiles|Invalid password" msgid "Profiles|Invalid password"
msgstr "" msgstr ""
...@@ -5099,7 +5108,7 @@ msgstr "" ...@@ -5099,7 +5108,7 @@ msgstr ""
msgid "Profiles|Some options are unavailable for LDAP accounts" msgid "Profiles|Some options are unavailable for LDAP accounts"
msgstr "" msgstr ""
msgid "Profiles|Tell us about yourself in fewer than 250 characters." msgid "Profiles|Tell us about yourself in fewer than 250 characters"
msgstr "" msgstr ""
msgid "Profiles|The maximum file size allowed is 200KB." msgid "Profiles|The maximum file size allowed is 200KB."
...@@ -5108,7 +5117,7 @@ msgstr "" ...@@ -5108,7 +5117,7 @@ msgstr ""
msgid "Profiles|This doesn't look like a public SSH key, are you sure you want to add it?" msgid "Profiles|This doesn't look like a public SSH key, are you sure you want to add it?"
msgstr "" msgstr ""
msgid "Profiles|This email will be displayed on your public profile." msgid "Profiles|This email will be displayed on your public profile"
msgstr "" msgstr ""
msgid "Profiles|This email will be used for web based operations, such as edits and merges. %{learn_more}" msgid "Profiles|This email will be used for web based operations, such as edits and merges. %{learn_more}"
...@@ -5117,10 +5126,10 @@ msgstr "" ...@@ -5117,10 +5126,10 @@ msgstr ""
msgid "Profiles|This emoji and message will appear on your profile and throughout the interface." msgid "Profiles|This emoji and message will appear on your profile and throughout the interface."
msgstr "" msgstr ""
msgid "Profiles|This feature is experimental and translations are not complete yet." msgid "Profiles|This feature is experimental and translations are not complete yet"
msgstr "" msgstr ""
msgid "Profiles|This information will appear on your profile." msgid "Profiles|This information will appear on your profile"
msgstr "" msgstr ""
msgid "Profiles|Type your %{confirmationValue} to confirm:" msgid "Profiles|Type your %{confirmationValue} to confirm:"
...@@ -5147,10 +5156,10 @@ msgstr "" ...@@ -5147,10 +5156,10 @@ msgstr ""
msgid "Profiles|Username successfully changed" msgid "Profiles|Username successfully changed"
msgstr "" msgstr ""
msgid "Profiles|Website" msgid "Profiles|What's your status?"
msgstr "" msgstr ""
msgid "Profiles|What's your status?" msgid "Profiles|Who you represent or work for"
msgstr "" msgstr ""
msgid "Profiles|You can change your avatar here" msgid "Profiles|You can change your avatar here"
...@@ -5171,16 +5180,19 @@ msgstr "" ...@@ -5171,16 +5180,19 @@ msgstr ""
msgid "Profiles|You must transfer ownership or delete these groups before you can delete your account." msgid "Profiles|You must transfer ownership or delete these groups before you can delete your account."
msgstr "" msgstr ""
msgid "Profiles|Your LinkedIn profile name from linkedin.com/in/profilename"
msgstr ""
msgid "Profiles|Your account is currently an owner in these groups:" msgid "Profiles|Your account is currently an owner in these groups:"
msgstr "" msgstr ""
msgid "Profiles|Your email address was automatically set based on your %{provider_label} account." msgid "Profiles|Your email address was automatically set based on your %{provider_label} account"
msgstr "" msgstr ""
msgid "Profiles|Your location was automatically set based on your %{provider_label} account." msgid "Profiles|Your location was automatically set based on your %{provider_label} account"
msgstr "" msgstr ""
msgid "Profiles|Your name was automatically set based on your %{provider_label} account, so people you know can recognize you." msgid "Profiles|Your name was automatically set based on your %{provider_label} account, so people you know can recognize you"
msgstr "" msgstr ""
msgid "Profiles|Your status" msgid "Profiles|Your status"
...@@ -5189,6 +5201,12 @@ msgstr "" ...@@ -5189,6 +5201,12 @@ msgstr ""
msgid "Profiles|e.g. My MacBook key" msgid "Profiles|e.g. My MacBook key"
msgstr "" msgstr ""
msgid "Profiles|username"
msgstr ""
msgid "Profiles|website.com"
msgstr ""
msgid "Profiles|your account" msgid "Profiles|your account"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment