<commit_before><h2>Edit <%= resource_name.to_s.humanize %></h2>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, multipart: true }) do |f| %>
  <%= devise_error_messages! %>

  <% if current_user.avatar.url.present? %>
  <%= image_tag(current_user.avatar.url) %>
  <% end %>

  <div class="field">
      <%= f.label :avatar %><br />
      <%= f.file_field :avatar,  class: "form-control-file"  %>

      <small id="emailHelp" class="form-text text-muted">Non-square images will be cropped. For best results, dimensions should be at least 500x500 pixels.</small>      

      <%= f.hidden_field :avatar_cache %>
    </div>
  

  <div class="field">
      <%= f.label :name %><br />
      <%= f.text_field :name, autofocus: true,  class: "form-control"  %>
  </div>

  <div class="field">
    <%= f.label :email %><br />
    <%= f.email_field :email, autofocus: true,  class: "form-control"  %>
  </div>

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


  <% if current_user.provider == nil %>
      <div class="field">
        <%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
        <%= f.password_field :password, autocomplete: "off",  class: "form-control" %>
        <% if @minimum_password_length %>
          <br />
          <em><%= @minimum_password_length %> characters minimum</em>
        <% end %>
      </div>

      <div class="field">
        <%= f.label :password_confirmation %><br />
        <%= f.password_field :password_confirmation, autocomplete: "off",  class: "form-control" %>
      </div>

      <div class="field">
        <%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
        <%= f.password_field :current_password, autocomplete: "off",  class: "form-control" %>
      </div>

 <% else %>
      Account authenticated with <%= current_user.provider %>
 <% end %>


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

<p><%= button_to "Delete my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-sm btn-danger" %></p>

<%= link_to "Back", :back %><commit_msg>Add about field to user edit form and adjust styling<commit_after><div class="box">

    <% if current_user.avatar.url.present? %>
    <%= image_tag(current_user.avatar.url, class: "avatar-profile") %>
    <% end %>
    
    <h2>Edit <%= resource_name.to_s.humanize %></h2>
    
    <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, multipart: true }) do |f| %>
      <%= devise_error_messages! %>
    
    
      <div class="form-group">
          <%= f.label :avatar %><br />
          <%= f.file_field :avatar,  class: "form-control-file"  %>
    
          <small id="emailHelp" class="form-text text-muted">Non-square images will be cropped. For best results, dimensions should be at least 500x500 pixels.</small>      
    
          <%= f.hidden_field :avatar_cache %>
        </div>
      
      <div class="clearfix"></div>
      <div class="form-group">
          <%= f.label :name %>
          <%= f.text_field :name, autofocus: true,  class: "form-control"  %>
      </div>
    
      <div class="form-group">
        <%= f.label :email %>
        <%= f.email_field :email, autofocus: true,  class: "form-control"  %>
      </div>

      <div class="form-group">
          <%= f.label :about %>
          <%= f.text_area :about, autofocus: true,  class: "form-control"  %>
          <small class="form-text text-muted">A little bit about yourself</small>
        </div>  
      
      <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
        <div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
      <% end %>
    
    
      <% if current_user.provider == nil %>
          <div class="form-group">
            <%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
            <%= f.password_field :password, autocomplete: "off",  class: "form-control" %>
            <% if @minimum_password_length %>
            <small 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: "off",  class: "form-control" %>
          </div>
    
          <div class="form-group">
            <%= f.label :current_password %>
            <%= f.password_field :current_password, autocomplete: "off",  class: "form-control" %>
            <small class="form-text text-muted">We need your current password to confirm your changes</small>
          </div>
          
     <% else %>
          Account authenticated with <%= current_user.provider %><br><br>
     <% end %>
     
      <div class="actions">
        <%= f.submit "Update", class: "btn btn-primary" %>
      </div>
    <% end %>
    
    <p><%= button_to "Delete my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-sm btn-danger" %></p>
    
    <%= link_to "Back", :back %>
    

</div>
{'fraction_non_alphanumeric': 0.17245817245817247, 'fraction_numerical': 0.0029417172274315132, 'mean_word_length': 2.629086057371581, 'pattern_counts': {'":': 0, '<': 146, '<?xml version=': 0, '>': 146, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6976875', 'n_tokens_mistral': 1882, 'n_tokens_neox': 1710, 'n_words': 401}