2011-10-08 17:36:38 -04:00
.user_new
2013-06-26 08:57:02 -04:00
= 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
2013-06-26 08:57:02 -04:00
- @user.errors.full_messages.each do |msg|
2011-10-08 17:36:38 -04:00
%li= msg
2012-11-27 01:31:15 -05:00
%fieldset
%legend Account
2013-08-07 16:20:10 -04:00
.control-group
2012-11-27 01:31:15 -05:00
= f.label :name
2013-08-07 16:20:10 -04:00
.controls
2013-02-06 09:26:46 -05:00
= f.text_field :name, required: true, autocomplete: "off"
2012-11-27 01:31:15 -05:00
%span.help-inline * required
2013-08-07 16:20:10 -04:00
.control-group
2012-11-27 01:31:15 -05:00
= f.label :username
2013-08-07 16:20:10 -04:00
.controls
2013-02-06 09:26:46 -05:00
= f.text_field :username, required: true, autocomplete: "off"
2012-11-27 01:31:15 -05:00
%span.help-inline * required
2013-08-07 16:20:10 -04:00
.control-group
2012-11-27 01:31:15 -05:00
= f.label :email
2013-08-07 16:20:10 -04:00
.controls
2013-02-06 09:27:09 -05:00
= f.text_field :email, required: true, autocomplete: "off"
2012-11-27 01:31:15 -05:00
%span.help-inline * required
2012-11-23 01:11:09 -05:00
2013-06-26 08:57:02 -04:00
- if @user.new_record?
2013-06-13 14:06:27 -04:00
%fieldset
%legend Password
2013-08-07 16:20:10 -04:00
.control-group
2013-06-13 14:06:27 -04:00
= f.label :password
2013-08-07 16:20:10 -04:00
.controls
2013-06-13 14:06:27 -04: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-08-07 16:20:10 -04:00
.control-group
2013-06-13 14:06:27 -04:00
= f.label :password
2013-08-07 16:20:10 -04:00
.controls= f.password_field :password, disabled: f.object.force_random_password
.control-group
2013-06-13 14:06:27 -04:00
= f.label :password_confirmation
2013-08-07 16:20:10 -04:00
.controls= f.password_field :password_confirmation, disabled: f.object.force_random_password
2012-11-27 01:31:15 -05:00
%fieldset
%legend Access
.row
2013-12-30 16:55:15 -05:00
.col-md-8
2013-08-07 16:20:10 -04:00
.control-group
2012-08-25 13:31:19 -04:00
= f.label :projects_limit
2013-08-07 16:20:10 -04:00
.controls= f.number_field :projects_limit
2011-10-19 18:34:05 -04:00
2013-08-07 16:20:10 -04:00
.control-group
2013-01-25 04:30:49 -05:00
= f.label :can_create_group
2013-08-07 16:20:10 -04:00
.controls= f.check_box :can_create_group
2013-01-25 04:30:49 -05:00
2013-08-07 16:20:10 -04:00
.control-group
2012-08-25 13:31:19 -04:00
= f.label :admin do
%strong.cred Administrator
2013-08-07 16:20:10 -04:00
.controls= f.check_box :admin
2013-12-30 16:55:15 -05:00
.col-md-4
2013-06-26 08:57:02 -04:00
- unless @user.new_record?
2012-11-27 01:31:15 -05:00
.alert.alert-error
2013-06-26 08:57:02 -04:00
- if @user.blocked?
2012-11-27 01:31:15 -05:00
%p This user is blocked and is not able to login to GitLab
2013-06-26 08:57:02 -04:00
= link_to 'Unblock User', unblock_admin_user_path(@user), method: :put, class: "btn btn-small"
2012-08-25 13:31:19 -04:00
- else
2012-11-27 01:31:15 -05:00
%p Blocked users will be removed from all projects & will not be able to login to GitLab.
2013-12-10 14:33:21 -05:00
= 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 01:31:15 -05:00
%fieldset
%legend Profile
2013-08-07 16:20:10 -04:00
.control-group
2012-11-27 01:31:15 -05:00
= f.label :skype
2013-08-07 16:20:10 -04:00
.controls= f.text_field :skype
.control-group
2012-11-27 01:31:15 -05:00
= f.label :linkedin
2013-08-07 16:20:10 -04:00
.controls= f.text_field :linkedin
.control-group
2012-11-27 01:31:15 -05:00
= f.label :twitter
2013-08-07 16:20:10 -04:00
.controls= f.text_field :twitter
2012-08-25 13:31:19 -04:00
2013-08-07 16:35:24 -04:00
.form-actions
2013-06-26 08:57:02 -04:00
- 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"
2013-06-26 08:57:02 -04:00
= link_to 'Cancel', admin_user_path(@user), class: "btn btn-cancel"