38 lines
1.5 KiB
Text
38 lines
1.5 KiB
Text
= semantic_form_for [:admin, @user] do |f|
|
|
= f.inputs 'Basic Information' do
|
|
- unless @user.new_record?
|
|
.pull-right
|
|
%b
|
|
Confirmed?
|
|
- if can? :toggle_confirmation, @user
|
|
= check_box_tag @user.id, @user.id, @user.confirmed?,
|
|
url: "#{toggle_confirmation_admin_user_path(@user.id)}?user[to_confirm]=",
|
|
class: 'switch-checkbox',
|
|
readonly: false
|
|
- else
|
|
= check_box_tag @user.id, @user.id, @user.confirmed?,
|
|
url: "#{toggle_confirmation_admin_user_path(@user.id)}?user[to_confirm]=",
|
|
class: 'switch-checkbox',
|
|
readonly: true
|
|
= f.input :is_admin, hint: 'An admin can create a new conference, manage users and make other users admins.'
|
|
= f.input :name, as: :string
|
|
= f.input :username, :as => :string if @user.new_record?
|
|
= f.input :email
|
|
= f.input :password if @user.new_record?
|
|
.control-label
|
|
Gravatar
|
|
= image_tag(@user.profile_picture(size: '48'), alt: '')
|
|
%p
|
|
Or upload a picture.
|
|
= f.input :picture, hint: 'If you upload a picture, it will be used in place of Gravatar.'
|
|
- if @user.picture?
|
|
%p
|
|
Current Picture
|
|
%br
|
|
= image_tag(@user.picture.url, width: '20%')
|
|
|
|
= f.input :affiliation, as: :string
|
|
= f.input :biography, input_html: { rows: 10, data: { provide: 'markdown' } },
|
|
hint: markdown_hint
|
|
= f.actions do
|
|
= f.action :submit, button_html: {class: 'btn btn-primary'}
|