_form.html.haml 2.51 KB
Newer Older
gitlabhq's avatar
gitlabhq committed
1 2 3 4 5 6 7 8
.user_new
  = form_for [:admin, @admin_user] do |f|
    -if @admin_user.errors.any?
      #error_explanation
        %ul
          - @admin_user.errors.full_messages.each do |msg|
            %li= msg

9 10 11 12 13 14
    .row
      .span6
        .clearfix
          = f.label :name
          .input
            = f.text_field :name
Tiago Ribeiro's avatar
Tiago Ribeiro committed
15
            %span.help-inline * required
16 17 18 19
        .clearfix
          = f.label :email
          .input
            = f.text_field :email
Tiago Ribeiro's avatar
Tiago Ribeiro committed
20
            %span.help-inline * required
21 22 23 24 25
        %hr

        -if f.object.new_record?
          .clearfix 
            = f.label :admin, :class => "checkbox" do
Jakub Troszok's avatar
Jakub Troszok committed
26
              = f.check_box :force_random_password, {}, true, nil
27 28 29 30 31 32 33 34 35
            %span Generate random password
        
        %div.password-fields
          .clearfix
            = f.label :password
            .input= f.password_field :password, :disabled => f.object.force_random_password 
          .clearfix
            = f.label :password_confirmation
            .input= f.password_field :password_confirmation, :disabled => f.object.force_random_password
36 37 38 39 40 41 42 43 44 45 46 47 48 49
        %hr
        .clearfix
          = f.label :skype
          .input= f.text_field :skype
        .clearfix
          = f.label :linkedin
          .input= f.text_field :linkedin
        .clearfix
          = f.label :twitter
          .input= f.text_field :twitter
      .span6
        .clearfix
          = f.label :projects_limit
          .input= f.text_field :projects_limit, :class => "small_input"
50

51 52
        .alert
          .clearfix
53
            %p Make the user a GitLab administrator.
Tiago Ribeiro's avatar
Tiago Ribeiro committed
54
            = f.label :admin, :class => "checkbox" do
55 56
              = f.check_box :admin
              %span Administrator
Tiago Ribeiro's avatar
Tiago Ribeiro committed
57
        - unless @admin_user.new_record?
58 59 60 61
          .alert.alert-error
            - if @admin_user.blocked
              %span
                = link_to 'Unblock', unblock_admin_user_path(@admin_user), :method => :put, :class => "btn small"
62
                This user is blocked and is not able to login to GitLab
63 64 65
            - else
              %span
                = link_to 'Block', block_admin_user_path(@admin_user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger"
66
                Blocked users will be removed from all projects & will not be able to login to GitLab.
gitlabhq's avatar
gitlabhq committed
67
    .actions
68
      = f.submit 'Save', :class => "btn primary"
Tiago Ribeiro's avatar
Tiago Ribeiro committed
69
      - if @admin_user.new_record?
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
70
        = link_to 'Cancel', admin_users_path, :class => "btn"
Tiago Ribeiro's avatar
Tiago Ribeiro committed
71
      - else
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
72
        = link_to 'Cancel', admin_user_path(@admin_user), :class => "btn"