Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-13 09:08:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-13 09:08:10 +0300
commit6ede90f5dd63d4a1f5ba243b4ed5097bb1a0acab (patch)
tree6bb9e934cdd90d62e672a1d6c4a5a63995bfbb00 /app/views/profiles
parentb8e30b446d9cb91b94d2b55e5c81303c8f2d1b25 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/views/profiles')
-rw-r--r--app/views/profiles/_name.html.haml8
-rw-r--r--app/views/profiles/show.html.haml6
2 files changed, 9 insertions, 5 deletions
diff --git a/app/views/profiles/_name.html.haml b/app/views/profiles/_name.html.haml
new file mode 100644
index 00000000000..8711be5cd29
--- /dev/null
+++ b/app/views/profiles/_name.html.haml
@@ -0,0 +1,8 @@
+- if user.read_only_attribute?(:name)
+ = form.text_field :name, required: true, readonly: true, wrapper: { class: 'col-md-9 qa-full-name rspec-full-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) }
+- elsif can?(current_user, :update_name, user)
+ = form.text_field :name, label: s_('Profiles|Full name'), required: true, title: s_("Profiles|Using emojis in names seems fun, but please try to set a status message instead"), wrapper: { class: 'col-md-9 qa-full-name rspec-full-name' }, help: s_("Profiles|Enter your name, so people you know can recognize you")
+- else
+ = form.text_field :name, required: true, readonly: true, wrapper: { class: 'col-md-9 qa-full-name rspec-full-name' },
+ help: s_("Profiles|The ability to update your name has been disabled by your administrator.")
diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml
index cfad274f91d..49533c18c8f 100644
--- a/app/views/profiles/show.html.haml
+++ b/app/views/profiles/show.html.haml
@@ -88,11 +88,7 @@
= s_("Profiles|Some options are unavailable for LDAP accounts")
.col-lg-8
.row
- - if @user.read_only_attribute?(:name)
- = f.text_field :name, required: true, readonly: true, wrapper: { class: 'col-md-9 qa-full-name rspec-full-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
- = f.text_field :name, label: s_('Profiles|Full name'), required: true, title: s_("Profiles|Using emojis in names seems fun, but please try to set a status message instead"), wrapper: { class: 'col-md-9 qa-full-name rspec-full-name' }, help: s_("Profiles|Enter your name, so people you know can recognize you")
+ = render 'profiles/name', form: f, user: @user
= f.text_field :id, readonly: true, label: s_('Profiles|User ID'), wrapper: { class: 'col-md-3' }
= f.select :role, ::User.roles.keys.map { |role| [role.titleize, role] }, { prompt: _('Select your role') }, required: true, class: 'input-md'