summaryrefslogtreecommitdiff
path: root/app/views/admin/users/_form.html.haml
blob: 312398565c97a52239f08b1837779aa0375b09c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
.user_new
  = form_for [:admin, @admin_user] do |f|
    -if @admin_user.errors.any?
      #error_explanation
        %ul.unstyled.alert.alert-error
          - @admin_user.errors.full_messages.each do |msg|
            %li= msg

    .row
      .span7
        .ui-box
          %br
          .clearfix
            = f.label :name
            .input
              = f.text_field :name
              %span.help-inline * required
          .clearfix
            = f.label :username
            .input
              = f.text_field :username
              %span.help-inline * required
          .clearfix
            = f.label :email
            .input
              = f.text_field :email
              %span.help-inline * required
          %hr
          -if f.object.new_record?
            .clearfix
              = f.label :force_random_password do
                %span Generate random password
              .input= f.check_box :force_random_password, {}, true, nil

          %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
          %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
      .span5
        .ui-box
          %br
          .clearfix
            = f.label :projects_limit
            .input= f.number_field :projects_limit

          .clearfix
            = f.label :admin do
              %strong.cred Administrator
            .input= f.check_box :admin
          - unless @admin_user.new_record?
            %hr
            .padded.cred
              - if @admin_user.blocked
                %span
                  This user is blocked and is not able to login to GitLab
                  .clearfix
                    = link_to 'Unblock User', unblock_admin_user_path(@admin_user), method: :put, class: "btn small right"
              - else
                %span
                  Blocked users will be removed from all projects & will not be able to login to GitLab.
                  .clearfix
                    = link_to 'Block User', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small right danger"

    .row
      .span6
      .span6
    .actions
      = f.submit 'Save', class: "btn save-btn"
      - if @admin_user.new_record?
        = link_to 'Cancel', admin_users_path, class: "btn cancel-btn"
      - else
        = link_to 'Cancel', admin_user_path(@admin_user), class: "btn cancel-btn"