Commit 31c963edb137055c1fe7a67c31b63fabbfd8c0bd
1 parent
fc43c4e7
Exists in
spb-stable
and in
2 other branches
Improve admin/user form
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
4 changed files
with
14 additions
and
13 deletions
Show diff stats
app/assets/stylesheets/generic/forms.scss
app/views/admin/users/_form.html.haml
1 | .user_new | 1 | .user_new |
2 | - = form_for [:admin, @user], html: { class: 'form-horizontal' } do |f| | 2 | + = form_for [:admin, @user], html: { class: 'form-horizontal fieldset-form' } do |f| |
3 | -if @user.errors.any? | 3 | -if @user.errors.any? |
4 | #error_explanation | 4 | #error_explanation |
5 | .alert.alert-danger | 5 | .alert.alert-danger |
@@ -61,17 +61,14 @@ | @@ -61,17 +61,14 @@ | ||
61 | .col-sm-10 You cannot remove your own admin rights | 61 | .col-sm-10 You cannot remove your own admin rights |
62 | - else | 62 | - else |
63 | .col-sm-10= f.check_box :admin | 63 | .col-sm-10= f.check_box :admin |
64 | - - unless @user.new_record? || current_user == @user | ||
65 | - .alert.alert-danger | ||
66 | - - if @user.blocked? | ||
67 | - %p This user is blocked and is not able to login to GitLab | ||
68 | - = link_to 'Unblock User', unblock_admin_user_path(@user), method: :put, class: "btn btn-small" | ||
69 | - - else | ||
70 | - %p Blocked users will be removed from all projects & will not be able to login to GitLab. | ||
71 | - = link_to 'Block User', block_admin_user_path(@user), data: {confirm: 'USER WILL BE BLOCKED! Are you sure?'}, method: :put, class: "btn btn-small btn-remove" | ||
72 | %fieldset | 64 | %fieldset |
73 | %legend Profile | 65 | %legend Profile |
74 | .form-group | 66 | .form-group |
67 | + = f.label :avatar, class: 'control-label' | ||
68 | + .col-sm-10 | ||
69 | + = f.file_field :avatar | ||
70 | + | ||
71 | + .form-group | ||
75 | = f.label :skype, class: 'control-label' | 72 | = f.label :skype, class: 'control-label' |
76 | .col-sm-10= f.text_field :skype, class: 'form-control' | 73 | .col-sm-10= f.text_field :skype, class: 'form-control' |
77 | .form-group | 74 | .form-group |
app/views/admin/users/edit.html.haml