<commit_before><header class="append-bottom title">
  <h1>Account settings</h1>

  <div class="clearfix"></div>

  <div class="tabs">
    <ul>
      <li class="account active"><a>Account</a></li>
      <li class="password"><a>Change password</a></li>
    </ul>
  </div>
</header>

<div class="row" id="edit_user">
  <%= form_for(@user, :as => @user, :url => edit_user_path(@user), :html => { :method => :put, :class => "form-horizontal" }) do |f| %>
    <fieldset>
      <legend></legend>
      <div class="control-group">
        <%= f.label :username, class: "control-label" %>
        <div class="controls">
          <%= f.text_field :username %>
        </div>
      </div>

      <div class="control-group">
        <label class="control-label">Picture</label>
        <div class="controls">
          <%= image_tag @user.avatar_url, class: "avatar" %>
          <span class="help-inline">This image is automatically grabbed from <a>Gravatar</a>. Edit your Gravatar account to edit the profile picture.</span>
        </div>
      </div>

      <div class="control-group">
        <%= f.label :email, class: "control-label" %>
        <div class="controls">
          <%= f.email_field :email %>
        </div>
      </div>

      <div class="control-group">
        <%= f.label :current_password, class: "control-label" %>
        <div class="controls">
          <%= f.password_field :current_password %>
          <p class="help-block">(we need your current password to confirm your changes)</p>
        </div>
      </div>

      <div class="controls">
        <%= f.submit "Save settings", class: "btn btn-primary" %>
      </div>
    </fieldset>
  <% end %>
</div><commit_msg>Updated user-edit form, added error handling (untested) and fixed the design<commit_after><header class="append-bottom title">
  <h1>Account settings</h1>

  <div class="clearfix"></div>

  <div class="tabs">
    <ul>
      <li class="account active"><a>Account</a></li>
      <li class="password"><a>Change password</a></li>
    </ul>
  </div>
</header>

<div class="row" id="edit_user">
  <div class="span8">
    <%= form_for(@user, :as => @user, :url => edit_user_path(@user), :html => { :method => :put, :class => "form-horizontal" }) do |f| %>
      <fieldset>
        <legend></legend>
        <div class="control-group<%= " error" if @user.errors[:username].any? %>">
          <%= f.label :username, class: "control-label" %>
          <div class="controls">
            <%= f.text_field :username, autocomplete: "off", required: true, tabindex: 1 %>
            <% if @user.errors[:username].any? %>
              <span class="inline-help"><%= @user.errors[:username] %></span>
            <% end %>
          </div>
        </div>

        <div class="control-group<%= " error" if @user.errors[:first_name].any? %>">
          <%= f.label :first_name, class: "control-label" %>
          <div class="controls">
            <%= f.text_field :first_name, autocomplete: "off", tabindex: 2 %>
            <% if @user.errors[:first_name].any? %>
              <span class="inline-help"><%= @user.errors[:first_name] %></span>
            <% end %>
          </div>
        </div>

        <div class="control-group<%= " error" if @user.errors[:last_name].any? %>">
          <%= f.label :last_name, class: "control-label" %>
          <div class="controls">
            <%= f.text_field :last_name, autocomplete: "off", tabindex: 3 %>
            <% if @user.errors[:last_name].any? %>
              <span class="inline-help"><%= @user.errors[:last_name] %></span>
            <% end %>
          </div>
        </div>

        <div class="control-group">
          <label class="control-label">Picture</label>
          <div class="controls">
            <%= image_tag @user.avatar_url, class: "avatar" %>
            <span class="help-inline">This image is automatically grabbed from <a>Gravatar</a>. Edit your Gravatar account to edit the profile picture.</span>
          </div>
        </div>

        <div class="control-group<%= " error" if @user.errors[:email].any? %>">
          <%= f.label :email, class: "control-label" %>
          <div class="controls">
            <%= f.email_field :email, autocomplete: "off", required: true, tabindex: 4 %>
            <% if @user.errors[:email].any? %>
              <span class="inline-help"><%= @user.errors[:email] %></span>
            <% end %>
          </div>
        </div>

        <div class="controls">
          <%= f.submit "Save settings", class: "btn btn-primary" %>
        </div>
      </fieldset>
    <% end %>
  </div>
</div>
{'fraction_non_alphanumeric': 0.1959032468947483, 'fraction_numerical': 0.0019612115929396384, 'mean_word_length': 2.382461311717023, 'pattern_counts': {'":': 0, '<': 153, '<?xml version=': 0, '>': 163, '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': '5305228', 'n_tokens_mistral': 1521, 'n_tokens_neox': 1416, 'n_words': 320}