<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
  <h2>Profile settings</h2>

  <%= render "devise/shared/error_messages", resource: resource %>

  <div class="form-group">
    <%= f.label :full_name %>
    <%= f.text_field :full_name, autocomplete: "full-name", class: "form-control" %>
  </div>

  <div class="form-group">
    <%= f.label :email %>
    <%= f.email_field :email, autocomplete: "email", class: "form-control" %>
    <small id="emailGravatarHelp" class="form-text text-muted">
      the email is <a href="https://gravatar.com" target="_blank">gravatar</a>ized
    </small>
  </div>

  <div class="form-group">
    <%= f.label :notifications_enabled %> <br />
    <%= f.check_box :notifications_enabled, style: "transform: scale(1.5)" %>
    <small id="notificationsHelp" class="form-text text-muted">
      if disabled, you won't receive any notification
    </small>
  </div>

  <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
    <div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
  <% end %>

  <div class="form-group">
    <%= f.label :password %>
    <%= f.password_field :password, autocomplete: "new-password", class: "form-control" %>
    <% if @minimum_password_length %>
      <small id="passwordEditHelp" class="form-text text-muted">
        leave blank if you don't want to change it
      </small>
      <small id="passwordHelp" class="form-text text-muted">
        <%= @minimum_password_length %> characters minimum
      </small>
    <% end %>
  </div>

  <div class="form-group">
    <%= f.label :password_confirmation %>
    <%= f.password_field :password_confirmation, autocomplete: "new-password", class: "form-control" %>
  </div>

  <div class="form-group">
    <%= f.label :current_password %>
    <%= f.password_field :current_password, autocomplete: "current-password", class: "form-control" %>
    <small id="currentPasswordHelp" class="form-text text-muted">
      we need your current password to confirm your changes
    </small>
  </div>

  <div class="actions">
    <%= f.submit "Update profile", class: "btn btn-dark btn-block" %>
  </div>
<% end %>

<br />

<div class="edit_user">
  <h3>Cancel my account</h3>
  <p>Unhappy?
    <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-danger btn-block" %>
  </p>
</div>
