= 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?
    = 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'}
