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

95 lines
3.0 KiB
Plaintext

.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
.clearfix
= f.label :name
.input
= f.text_field :name, required: true, autocomplete: "off"
%span.help-inline * required
.clearfix
= f.label :username
.input
= f.text_field :username, required: true, autocomplete: "off"
%span.help-inline * required
.clearfix
= f.label :email
.input
= f.text_field :email, required: true, autocomplete: "off"
%span.help-inline * required
- if @user.new_record?
%fieldset
%legend Password
.clearfix
= f.label :password
.input
%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
.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
%fieldset
%legend Access
.row
.span8
.clearfix
= f.label :projects_limit
.input= f.number_field :projects_limit
.clearfix
= f.label :can_create_group
.input= f.check_box :can_create_group
.clearfix
= f.label :can_create_team
.input= f.check_box :can_create_team
.clearfix
= f.label :admin do
%strong.cred Administrator
.input= 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"
- 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
.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
.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"