gitlab-org--gitlab-foss/app/views/admin/users/_form.html.haml
Dmitriy Zaporozhets d7a48443ce
alert-error to alert-danger
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-12-31 16:34:14 +02:00

90 lines
3 KiB
Text

.user_new
= form_for [:admin, @user] do |f|
-if @user.errors.any?
#error_explanation
%ul.unstyled.alert.alert-danger
- @user.errors.full_messages.each do |msg|
%li= msg
%fieldset
%legend Account
.form-group
= f.label :name
.col-sm-10
= f.text_field :name, required: true, autocomplete: "off"
%span.help-inline * required
.form-group
= f.label :username
.col-sm-10
= f.text_field :username, required: true, autocomplete: "off"
%span.help-inline * required
.form-group
= f.label :email
.col-sm-10
= f.text_field :email, required: true, autocomplete: "off"
%span.help-inline * required
- if @user.new_record?
%fieldset
%legend Password
.form-group
= f.label :password
.col-sm-10
%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
.form-group
= f.label :password
.col-sm-10= f.password_field :password, disabled: f.object.force_random_password
.form-group
= f.label :password_confirmation
.col-sm-10= f.password_field :password_confirmation, disabled: f.object.force_random_password
%fieldset
%legend Access
.row
.col-md-8
.form-group
= f.label :projects_limit
.col-sm-10= f.number_field :projects_limit
.form-group
= f.label :can_create_group
.col-sm-10= f.check_box :can_create_group
.form-group
= f.label :admin do
%strong.cred Administrator
.col-sm-10= f.check_box :admin
.col-md-4
- unless @user.new_record?
.alert.alert-danger
- 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 &amp; 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
.form-group
= f.label :skype
.col-sm-10= f.text_field :skype
.form-group
= f.label :linkedin
.col-sm-10= f.text_field :linkedin
.form-group
= f.label :twitter
.col-sm-10= 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"