.container

.row
  .profile.large_panel
    = panel title: 'Edit Profile', context: :primary do
      = simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
        .panel-body
          = f.error_notification

          .form-inputs
            = f.input :email, required: true, autofocus: true

            = if devise_mapping.confirmable? && resource.pending_reconfirmation?
              %p
                Currently waiting confirmation for:
                = resource.unconfirmed_email

            = f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false
            = f.input :password_confirmation, required: false
            = f.input :current_password, hint: "we need your current password to confirm your changes", required: true
        .panel-footer
          .form-actions
            = f.button :submit, "Update", class: "btn-primary"

    - if devise_mapping.omniauthable?
      = panel title: 'Connect your accounts', context: :primary do
        .panel-body
          - resource_class.omniauth_providers.each do |provider|
            - if resource.identities.where( :provider => provider ).first
              %p= link_to "Reconnect with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), class: "btn btn-default"
            - else
              %p= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), class: "btn btn-default"

  .profile.sidebar
    = panel title: "Cancel my Account", context: :danger do
      .panel-body
        %p
          Unhappy?
          = link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-danger"