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
86
87
88
89
90
|
.user_new
= form_for [:admin, @user] do |f|
-if @user.errors.any?
#error_explanation
%ul.unstyled.alert.alert-error
- @user.errors.full_messages.each do |msg|
%li= msg
%fieldset
%legend Account
.control-group
= f.label :name
.controls
= f.text_field :name, required: true, autocomplete: "off"
%span.help-inline * required
.control-group
= f.label :username
.controls
= f.text_field :username, required: true, autocomplete: "off"
%span.help-inline * required
.control-group
= f.label :email
.controls
= f.text_field :email, required: true, autocomplete: "off"
%span.help-inline * required
- if @user.new_record?
%fieldset
%legend Password
.control-group
= f.label :password
.controls
%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
.control-group
= f.label :password
.controls= f.password_field :password, disabled: f.object.force_random_password
.control-group
= f.label :password_confirmation
.controls= f.password_field :password_confirmation, disabled: f.object.force_random_password
%fieldset
%legend Access
.row
.col-md-8
.control-group
= f.label :projects_limit
.controls= f.number_field :projects_limit
.control-group
= f.label :can_create_group
.controls= f.check_box :can_create_group
.control-group
= f.label :admin do
%strong.cred Administrator
.controls= f.check_box :admin
.col-md-4
- unless @user.new_record?
.alert.alert-error
- if @user.blocked?
%p This user is blocked and is not able to login to GitLab
= link_to 'Unblock User', unblock_admin_user_path(@user), method: :put, class: "btn btn-small"
- else
%p Blocked users will be removed from all projects & will not be able to login to GitLab.
= 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"
%fieldset
%legend Profile
.control-group
= f.label :skype
.controls= f.text_field :skype
.control-group
= f.label :linkedin
.controls= f.text_field :linkedin
.control-group
= f.label :twitter
.controls= f.text_field :twitter
.form-actions
- if @user.new_record?
= f.submit 'Create user', class: "btn btn-create"
= link_to 'Cancel', admin_users_path, class: "btn btn-cancel"
- else
= f.submit 'Save changes', class: "btn btn-save"
= link_to 'Cancel', admin_user_path(@user), class: "btn btn-cancel"
|