7f8a520f8a
Rename btn-new, btn-create and btn-save to btn-success Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
82 lines
3.1 KiB
Text
82 lines
3.1 KiB
Text
.user_new
|
|
= form_for [:admin, @user], html: { class: 'fieldset-form' } do |f|
|
|
= form_errors(@user)
|
|
|
|
%fieldset
|
|
%legend Account
|
|
.form-group.row
|
|
.col-sm-2.text-right
|
|
= f.label :name, class: 'col-form-label'
|
|
.col-sm-10
|
|
= f.text_field :name, required: true, autocomplete: 'off', class: 'form-control'
|
|
%span.help-inline * required
|
|
.form-group.row
|
|
.col-sm-2.text-right
|
|
= f.label :username, class: 'col-form-label'
|
|
.col-sm-10
|
|
= f.text_field :username, required: true, autocomplete: 'off', autocorrect: 'off', autocapitalize: 'off', spellcheck: false, class: 'form-control'
|
|
%span.help-inline * required
|
|
.form-group.row
|
|
.col-sm-2.text-right
|
|
= f.label :email, class: 'col-form-label'
|
|
.col-sm-10
|
|
= f.text_field :email, required: true, autocomplete: 'off', class: 'form-control'
|
|
%span.help-inline * required
|
|
|
|
- if @user.new_record?
|
|
%fieldset
|
|
%legend Password
|
|
.form-group.row
|
|
.col-sm-2.text-right
|
|
= f.label :password, class: 'col-form-label'
|
|
.col-sm-10
|
|
%strong
|
|
Reset link will be generated and sent to the user.
|
|
%br
|
|
User will be forced to set the password on first sign in.
|
|
- else
|
|
%fieldset
|
|
%legend Password
|
|
.form-group.row
|
|
.col-sm-2.text-right
|
|
= f.label :password, class: 'col-form-label'
|
|
.col-sm-10= f.password_field :password, disabled: f.object.force_random_password, class: 'form-control'
|
|
.form-group.row
|
|
.col-sm-2.text-right
|
|
= f.label :password_confirmation, class: 'col-form-label'
|
|
.col-sm-10= f.password_field :password_confirmation, disabled: f.object.force_random_password, class: 'form-control'
|
|
|
|
= render partial: 'access_levels', locals: { f: f }
|
|
|
|
%fieldset
|
|
%legend Profile
|
|
.form-group.row
|
|
.col-sm-2.text-right
|
|
= f.label :avatar, class: 'col-form-label'
|
|
.col-sm-10
|
|
= f.file_field :avatar
|
|
|
|
.form-group.row
|
|
.col-sm-2.text-right
|
|
= f.label :skype, class: 'col-form-label'
|
|
.col-sm-10= f.text_field :skype, class: 'form-control'
|
|
.form-group.row
|
|
.col-sm-2.text-right
|
|
= f.label :linkedin, class: 'col-form-label'
|
|
.col-sm-10= f.text_field :linkedin, class: 'form-control'
|
|
.form-group.row
|
|
.col-sm-2.text-right
|
|
= f.label :twitter, class: 'col-form-label'
|
|
.col-sm-10= f.text_field :twitter, class: 'form-control'
|
|
.form-group.row
|
|
.col-sm-2.text-right
|
|
= f.label :website_url, 'Website', class: 'col-form-label'
|
|
.col-sm-10= f.text_field :website_url, class: 'form-control'
|
|
|
|
.form-actions
|
|
- if @user.new_record?
|
|
= f.submit 'Create user', class: "btn btn-success"
|
|
= link_to 'Cancel', admin_users_path, class: "btn btn-cancel"
|
|
- else
|
|
= f.submit 'Save changes', class: "btn btn-success"
|
|
= link_to 'Cancel', admin_user_path(@user), class: "btn btn-cancel"
|