summaryrefslogtreecommitdiff
path: root/app/views/profiles
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-18 09:59:24 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-18 09:59:24 -0800
commite049e187809a31ff908d49e5ff70828a12623b04 (patch)
tree6e0bdc5a5b1b0dde1129d817d636f0ce1229b60a /app/views/profiles
parentea28519f5704c8dab74cba4d1e2039331504aafd (diff)
parentba65f2910b1285217326028655de057a702572af (diff)
downloadgitlab-ce-e049e187809a31ff908d49e5ff70828a12623b04.tar.gz
Merge pull request #2991 from raphendyr/username_change_disablation
Add option to disable username changing
Diffstat (limited to 'app/views/profiles')
-rw-r--r--app/views/profiles/account.html.haml49
1 files changed, 25 insertions, 24 deletions
diff --git a/app/views/profiles/account.html.haml b/app/views/profiles/account.html.haml
index 5465d1f96e9..5b6c298df4a 100644
--- a/app/views/profiles/account.html.haml
+++ b/app/views/profiles/account.html.haml
@@ -53,29 +53,30 @@
-%fieldset.update-username
- %legend
- Username
- %small.cred.pull-right
- Changing your username can have unintended side effects!
- = form_for @user, url: update_username_profile_path, method: :put, remote: true do |f|
- .padded
- = f.label :username
- .input
- = f.text_field :username, required: true
- &nbsp;
- %span.loading-gif.hide= image_tag "ajax_loader.gif"
- %span.update-success.cgreen.hide
- %i.icon-ok
- Saved
- %span.update-failed.cred.hide
- %i.icon-remove
- Failed
- %ul.cred
- %li It will change web url for personal projects.
- %li It will change the git path to repositories for personal projects.
- .input
- = f.submit 'Save username', class: "btn btn-save"
+- if current_user.can_change_username?
+ %fieldset.update-username
+ %legend
+ Username
+ %small.cred.pull-right
+ Changing your username can have unintended side effects!
+ = form_for @user, url: update_username_profile_path, method: :put, remote: true do |f|
+ .padded
+ = f.label :username
+ .input
+ = f.text_field :username, required: true
+ &nbsp;
+ %span.loading-gif.hide= image_tag "ajax_loader.gif"
+ %span.update-success.cgreen.hide
+ %i.icon-ok
+ Saved
+ %span.update-failed.cred.hide
+ %i.icon-remove
+ Failed
+ %ul.cred
+ %li It will change web url for personal projects.
+ %li It will change the git path to repositories for personal projects.
+ .input
+ = f.submit 'Save username', class: "btn btn-save"
- if Gitlab.config.gitlab.signup_enabled
%fieldset.remove-account
@@ -83,4 +84,4 @@
Remove account
%small.cred.pull-right
Before removing the account you must remove all projects!
- = link_to 'Delete account', user_registration_path, confirm: "REMOVE #{current_user.name}? Are you sure?", method: :delete, class: "btn btn-remove delete-key btn-small pull-right" \ No newline at end of file
+ = link_to 'Delete account', user_registration_path, confirm: "REMOVE #{current_user.name}? Are you sure?", method: :delete, class: "btn btn-remove delete-key btn-small pull-right"