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

9 10
    %fieldset
      %legend Account
11
      .control-group
12
        = f.label :name
13
        .controls
Jon Evans's avatar
Jon Evans committed
14
          = f.text_field :name, required: true, autocomplete: "off"
15
          %span.help-inline * required
16
      .control-group
17
        = f.label :username
18
        .controls
Jon Evans's avatar
Jon Evans committed
19
          = f.text_field :username, required: true, autocomplete: "off"
20
          %span.help-inline * required
21
      .control-group
22
        = f.label :email
23
        .controls
24
          = f.text_field :email, required: true, autocomplete: "off"
25
          %span.help-inline * required
26

27
    - if @user.new_record?
28 29
      %fieldset
        %legend Password
30
        .control-group
31
          = f.label :password
32
          .controls
33 34 35 36 37 38 39
            %strong
              A temporary password will be generated and sent to user.
              %br
              User will be forced to change it after first sign in
    - else
      %fieldset
        %legend Password
40
        .control-group
41
          = f.label :password
42 43
          .controls= f.password_field :password, disabled: f.object.force_random_password
        .control-group
44
          = f.label :password_confirmation
45
          .controls= f.password_field :password_confirmation, disabled: f.object.force_random_password
46 47 48 49 50

    %fieldset
      %legend Access
      .row
        .span8
51
          .control-group
randx's avatar
randx committed
52
            = f.label :projects_limit
53
            .controls= f.number_field :projects_limit
54

55
          .control-group
56
            = f.label :can_create_group
57
            .controls= f.check_box :can_create_group
58

59
          .control-group
randx's avatar
randx committed
60 61
            = f.label :admin do
              %strong.cred Administrator
62
            .controls= f.check_box :admin
63
        .span4
64
          - unless @user.new_record?
65
            .alert.alert-error
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"
randx's avatar
randx committed
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), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn btn-small btn-remove"
72 73
    %fieldset
      %legend Profile
74
      .control-group
75
        = f.label :skype
76 77
        .controls= f.text_field :skype
      .control-group
78
        = f.label :linkedin
79 80
        .controls= f.text_field :linkedin
      .control-group
81
        = f.label :twitter
82
        .controls= f.text_field :twitter
randx's avatar
randx committed
83

84
    .form-actions
85
      - if @user.new_record?
86
        = f.submit 'Create user', class: "btn btn-create"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
87
        = link_to 'Cancel', admin_users_path, class: "btn btn-cancel"
Tiago Ribeiro's avatar
Tiago Ribeiro committed
88
      - else
89
        = f.submit 'Save changes', class: "btn btn-save"
90
        = link_to 'Cancel', admin_user_path(@user), class: "btn btn-cancel"