Commit 31c963edb137055c1fe7a67c31b63fabbfd8c0bd

Authored by Dmitriy Zaporozhets
1 parent fc43c4e7

Improve admin/user form

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/assets/stylesheets/generic/forms.scss
... ... @@ -98,3 +98,7 @@ label {
98 98 z-index: 2;
99 99 }
100 100 }
  101 +
  102 +.fieldset-form fieldset {
  103 + margin-bottom: 20px;
  104 +}
... ...
app/views/admin/users/_form.html.haml
1 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 3 -if @user.errors.any?
4 4 #error_explanation
5 5 .alert.alert-danger
... ... @@ -61,17 +61,14 @@
61 61 .col-sm-10 You cannot remove your own admin rights
62 62 - else
63 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 &amp; 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 64 %fieldset
73 65 %legend Profile
74 66 .form-group
  67 + = f.label :avatar, class: 'control-label'
  68 + .col-sm-10
  69 + = f.file_field :avatar
  70 +
  71 + .form-group
75 72 = f.label :skype, class: 'control-label'
76 73 .col-sm-10= f.text_field :skype, class: 'form-control'
77 74 .form-group
... ...
app/views/admin/users/edit.html.haml
1 1 %h3.page-title
2   - #{@user.name} &rarr;
3   - %i.icon-edit
4   - Edit user
  2 + Edit user: #{@user.name}
  3 +.back-link
  4 + = link_to admin_user_path(@user) do
  5 + &larr; Back to user page
5 6 %hr
6 7 = render 'form'
... ...
app/views/admin/users/new.html.haml
1 1 %h3.page-title
2   - %i.icon-plus
3 2 New user
4 3 %hr
5 4 = render 'form'
... ...