gitlab-org--gitlab-foss/app/views/admin/users/_form.html.haml

95 lines
3.1 KiB
Text
Raw Normal View History

2011-10-08 17:36:38 -04:00
.user_new
= form_for [:admin, @user] do |f|
-if @user.errors.any?
2011-10-08 17:36:38 -04:00
#error_explanation
2012-08-25 13:31:19 -04:00
%ul.unstyled.alert.alert-error
- @user.errors.full_messages.each do |msg|
2011-10-08 17:36:38 -04:00
%li= msg
%fieldset
%legend Account
.control-group
= f.label :name
.controls
2013-02-06 09:26:46 -05:00
= f.text_field :name, required: true, autocomplete: "off"
%span.help-inline * required
.control-group
= f.label :username
.controls
2013-02-06 09:26:46 -05:00
= 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
.span8
.control-group
2012-08-25 13:31:19 -04:00
= f.label :projects_limit
.controls= f.number_field :projects_limit
.control-group
2013-01-25 04:30:49 -05:00
= f.label :can_create_group
.controls= f.check_box :can_create_group
2013-01-25 04:30:49 -05:00
.control-group
2013-01-25 04:30:49 -05:00
= f.label :can_create_team
.controls= f.check_box :can_create_team
2013-01-25 04:30:49 -05:00
.control-group
2012-08-25 13:31:19 -04:00
= f.label :admin do
%strong.cred Administrator
.controls= f.check_box :admin
.span4
- 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"
2012-08-25 13:31:19 -04:00
- 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), 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
2012-08-25 13:31:19 -04:00
2011-10-08 17:36:38 -04:00
.actions
- if @user.new_record?
2013-04-18 10:28:09 -04:00
= f.submit 'Create user', class: "btn btn-create"
2013-01-29 15:18:19 -05:00
= link_to 'Cancel', admin_users_path, class: "btn btn-cancel"
2012-04-17 21:34:14 -04:00
- else
2013-04-18 10:28:09 -04:00
= f.submit 'Save changes', class: "btn btn-save"
= link_to 'Cancel', admin_user_path(@user), class: "btn btn-cancel"