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
.user_new
= form_for [:admin, @user], html: { class: 'form-horizontal fieldset-form' } do |f|
= form_errors(@user)
%fieldset
%legend Account
.form-group
= f.label :name, class: 'control-label'
.col-sm-10
= f.text_field :name, required: true, autocomplete: 'off', class: 'form-control'
%span.help-inline * required
.form-group
= f.label :username, class: 'control-label'
.col-sm-10
= f.text_field :username, required: true, autocomplete: 'off', autocorrect: 'off', autocapitalize: 'off', spellcheck: false, class: 'form-control'
%span.help-inline * required
.form-group
= f.label :email, class: 'control-label'
.col-sm-10
= f.text_field :email, required: true, autocomplete: 'off', class: 'form-control'
%span.help-inline * required
- if @user.new_record?
%fieldset
%legend Password
.form-group
= f.label :password, class: 'control-label'
.col-sm-10
%strong
Reset link will be generated and sent to the user.
%br
User will be forced to set the password on first sign in.
- else
%fieldset
%legend Password
.form-group
= f.label :password, class: 'control-label'
.col-sm-10= f.password_field :password, disabled: f.object.force_random_password, class: 'form-control'
.form-group
= f.label :password_confirmation, class: 'control-label'
.col-sm-10= f.password_field :password_confirmation, disabled: f.object.force_random_password, class: 'form-control'
= render partial: 'access_levels', locals: { f: f }
%fieldset
%legend Profile
.form-group
= f.label :avatar, class: 'control-label'
.col-sm-10
= f.file_field :avatar
.form-group
= f.label :skype, class: 'control-label'
.col-sm-10= f.text_field :skype, class: 'form-control'
.form-group
= f.label :linkedin, class: 'control-label'
.col-sm-10= f.text_field :linkedin, class: 'form-control'
.form-group
= f.label :twitter, class: 'control-label'
.col-sm-10= f.text_field :twitter, class: 'form-control'
.form-group
= f.label :website_url, 'Website', class: 'control-label'
.col-sm-10= f.text_field :website_url, class: 'form-control'
.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"