2011-10-08 21:36:38 +00:00
.user_new
2014-01-10 12:39:45 +00:00
= form_for [:admin, @user], html: { class: 'form-horizontal' } do |f|
2013-06-26 12:57:02 +00:00
-if @user.errors.any?
2011-10-08 21:36:38 +00:00
#error_explanation
2013-12-31 14:34:14 +00:00
%ul.unstyled.alert.alert-danger
2013-06-26 12:57:02 +00:00
- @user.errors.full_messages.each do |msg|
2011-10-08 21:36:38 +00:00
%li= msg
2012-11-27 06:31:15 +00:00
%fieldset
%legend Account
2013-12-30 23:27:02 +00:00
.form-group
2014-01-10 12:39:45 +00:00
= f.label :name, class: 'control-label'
2013-12-30 23:27:02 +00:00
.col-sm-10
2014-01-10 12:39:45 +00:00
= f.text_field :name, required: true, autocomplete: "off", class: 'form-control'
2012-11-27 06:31:15 +00:00
%span.help-inline * required
2013-12-30 23:27:02 +00:00
.form-group
2014-01-10 12:39:45 +00:00
= f.label :username, class: 'control-label'
2013-12-30 23:27:02 +00:00
.col-sm-10
2014-01-10 12:39:45 +00:00
= f.text_field :username, required: true, autocomplete: "off", class: 'form-control'
2012-11-27 06:31:15 +00:00
%span.help-inline * required
2013-12-30 23:27:02 +00:00
.form-group
2014-01-10 12:39:45 +00:00
= f.label :email, class: 'control-label'
2013-12-30 23:27:02 +00:00
.col-sm-10
2014-01-10 12:39:45 +00:00
= f.text_field :email, required: true, autocomplete: "off", class: 'form-control'
2012-11-27 06:31:15 +00:00
%span.help-inline * required
2012-11-23 06:11:09 +00:00
2013-06-26 12:57:02 +00:00
- if @user.new_record?
2013-06-13 18:06:27 +00:00
%fieldset
%legend Password
2013-12-30 23:27:02 +00:00
.form-group
2014-01-10 12:39:45 +00:00
= f.label :password, class: 'control-label'
2013-12-30 23:27:02 +00:00
.col-sm-10
2013-06-13 18:06:27 +00:00
%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
2013-12-30 23:27:02 +00:00
.form-group
2014-01-10 12:39:45 +00:00
= f.label :password, class: 'control-label'
.col-sm-10= f.password_field :password, disabled: f.object.force_random_password, class: 'form-control'
2013-12-30 23:27:02 +00:00
.form-group
2014-01-10 12:39:45 +00:00
= f.label :password_confirmation, class: 'control-label'
.col-sm-10= f.password_field :password_confirmation, disabled: f.object.force_random_password, class: 'form-control'
2012-11-27 06:31:15 +00:00
%fieldset
%legend Access
2014-01-10 12:39:45 +00:00
.form-group
= f.label :projects_limit, class: 'control-label'
.col-sm-10= f.number_field :projects_limit, class: 'form-control'
2011-10-19 22:34:05 +00:00
2014-01-10 12:39:45 +00:00
.form-group
= f.label :can_create_group, class: 'control-label'
.col-sm-10= f.check_box :can_create_group
2013-01-25 09:30:49 +00:00
2014-01-10 12:39:45 +00:00
.form-group
= f.label :admin, class: 'control-label'
2014-01-11 13:54:49 +00:00
- if current_user == @user
.col-sm-10= f.check_box :admin, disabled: true
.col-sm-10 You cannot remove your own admin rights
- else
.col-sm-10= f.check_box :admin
- unless @user.new_record? || current_user == @user
2014-01-10 12:39:45 +00:00
.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 & 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"
2012-11-27 06:31:15 +00:00
%fieldset
%legend Profile
2013-12-30 23:27:02 +00:00
.form-group
2014-01-10 12:39:45 +00:00
= f.label :skype, class: 'control-label'
.col-sm-10= f.text_field :skype, class: 'form-control'
2013-12-30 23:27:02 +00:00
.form-group
2014-01-10 12:39:45 +00:00
= f.label :linkedin, class: 'control-label'
.col-sm-10= f.text_field :linkedin, class: 'form-control'
2013-12-30 23:27:02 +00:00
.form-group
2014-01-10 12:39:45 +00:00
= f.label :twitter, class: 'control-label'
.col-sm-10= f.text_field :twitter, class: 'form-control'
2012-08-25 17:31:19 +00:00
2013-08-07 20:35:24 +00:00
.form-actions
2013-06-26 12:57:02 +00:00
- if @user.new_record?
2013-04-18 14:28:09 +00:00
= f.submit 'Create user', class: "btn btn-create"
2013-01-29 20:18:19 +00:00
= link_to 'Cancel', admin_users_path, class: "btn btn-cancel"
2012-04-18 01:34:14 +00:00
- else
2013-04-18 14:28:09 +00:00
= f.submit 'Save changes', class: "btn btn-save"
2013-06-26 12:57:02 +00:00
= link_to 'Cancel', admin_user_path(@user), class: "btn btn-cancel"