<commit_before><% @title = t('.title') %>

<%= form_for @user, :url => {:controller => 'profiles', :action => 'update'} do |form| %>
  <%= error_messages_for(@user) %>

  <div class="avatar_field">
    <%= form.label :avatar, :class => 'form__label'  %>
    <div class="l-overflow">
      <%= gravatar(160) %>
      <%= link_to t('.change_avatar'), 'https://www.gravatar.com', :class => 't-text t-link' %>
    </div>
  </div>

  <div class="text_field">
    <%= form.label :handle, :class => 'form__label' %>
    <%= form.text_field :handle, :class => 'form__input' %>
  </div>

  <div class="text_field">
    <%= form.label :twitter_username, class: 'form__label form__label__icon-container' do %>
      <%=
        image_tag("/images/twitter_icon.png", alt: 'Twitter icon', class: 'form__label__icon')
      %>

      <span class='form__label__text'>Twitter username</span>
    <% end %>

    <p class='form__field__instructions'>
      <%= t('.optional_twitter_username') %>
    </p>

    <div class="form__input__addon-container form__input__addon-left">
      <span class="form__input__addon">@</span>
      <%= form.text_field(:twitter_username, class: 'form__input') %>
    </div>
  </div>

  <% if current_user.unconfirmed_email %>
    <div class="push--bottom-s">
      <p class='form__field__instructions'>
        <%= t('.email_awaiting_confirmation', unconfirmed_email: current_user.unconfirmed_email) %>
      </p>
      <%= link_to "Resend confirmation", unconfirmed_email_confirmations_path, method: :patch, class: 'form__field__instructions t-link' %>
    </div>
  <% end %>

  <div class="text_field">
    <%= form.label :email, :class => 'form__label' %>
    <%= form.email_field :email, :class => 'form__input' %>
  </div>

  <p class='form__field__instructions'>
    <%= t('.enter_password') %>
  </p>
  <div class="password_field">
    <%= form.label :password, :class => 'form__label' %>
    <%= form.password_field :password, :class => 'form__input' %>
  </div>


  <div class="profile-checkbox form__checkbox">
    <%= form.check_box :hide_email, :class => 'form__checkbox__input' %>
    <%= form.label :hide_email, t('.hide_email'), :class => 'form__checkbox__label' %>
  </div>

  <div class="submit_field">
    <%= form.submit 'Update', :data => {:disable_with => t('form_disable_with')}, :class => 'form__submit' %>
  </div>

  <div class="t-body">
    <h2><%= t '.reset_password.title' %></h2>
    <p><%= t('.reset_password.text_html', :link => link_to(t('.reset_password.link_text'), new_password_path)) %></p>

    <h2><%= t '.api_access.title' %></h2>
    <p>
      <%= t('.api_access.key_is_html', :key => content_tag(:strong, current_user.api_key)) %>
    </p>
    <p>
      <%= t('.api_access.credentials_html', :gem_credentials_file => content_tag(:code, '~/.gem/credentials'),
                                            :gem_commands_link => link_to(t('.api_access.link_text'), page_path('gem_docs'))) %>
    </p>
    <pre><code>curl -u <%= current_user.name %> https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials</code></pre>
  </div>
<% end %>

<%= button_to t('.api_access.reset'), reset_api_v1_api_key_path, :method => :put, :data => {:confirm => t('.api_access.confirm_reset')}, :class => 'form__submit' %>


<div class="t-body">
  <h2><%= t '.mfa.multifactor_auth' %></h2>
  <% if @user.mfa_enabled? %>
    <p><%= t '.mfa.enabled' %></p>
    <%= form_tag multifactor_auth_path, :method => :put, :id => 'mfa-edit' do %>
      <%= label_tag :level, t('.mfa.level.title'), :class => 'form__label' %>
      <%= select_tag :level, options_for_select([
        [t('.mfa.level.ui_and_api'), 'ui_and_api'],
        [t('.mfa.level.ui_only'), 'ui_only'],
        [t('.mfa.level.disabled'), 'disabled']], @user.mfa_level), :class => 'form__input form__select' %>
      <div class="text_field">
        <%= label_tag :otp, 'OTP code', :class => 'form__label' %>
        <%= text_field_tag :otp, '', :class => 'form__input', :autocomplete => :off %>
      </div>
      <%= submit_tag t('.mfa.update'), :class => 'form__submit' %>
    <% end %>
  <% else %><commit_msg>Tell people to use `gem signin` instead of curl. (#2194)<commit_after><% @title = t('.title') %>

<%= form_for @user, :url => {:controller => 'profiles', :action => 'update'} do |form| %>
  <%= error_messages_for(@user) %>

  <div class="avatar_field">
    <%= form.label :avatar, :class => 'form__label'  %>
    <div class="l-overflow">
      <%= gravatar(160) %>
      <%= link_to t('.change_avatar'), 'https://www.gravatar.com', :class => 't-text t-link' %>
    </div>
  </div>

  <div class="text_field">
    <%= form.label :handle, :class => 'form__label' %>
    <%= form.text_field :handle, :class => 'form__input' %>
  </div>

  <div class="text_field">
    <%= form.label :twitter_username, class: 'form__label form__label__icon-container' do %>
      <%=
        image_tag("/images/twitter_icon.png", alt: 'Twitter icon', class: 'form__label__icon')
      %>

      <span class='form__label__text'>Twitter username</span>
    <% end %>

    <p class='form__field__instructions'>
      <%= t('.optional_twitter_username') %>
    </p>

    <div class="form__input__addon-container form__input__addon-left">
      <span class="form__input__addon">@</span>
      <%= form.text_field(:twitter_username, class: 'form__input') %>
    </div>
  </div>

  <% if current_user.unconfirmed_email %>
    <div class="push--bottom-s">
      <p class='form__field__instructions'>
        <%= t('.email_awaiting_confirmation', unconfirmed_email: current_user.unconfirmed_email) %>
      </p>
      <%= link_to "Resend confirmation", unconfirmed_email_confirmations_path, method: :patch, class: 'form__field__instructions t-link' %>
    </div>
  <% end %>

  <div class="text_field">
    <%= form.label :email, :class => 'form__label' %>
    <%= form.email_field :email, :class => 'form__input' %>
  </div>

  <p class='form__field__instructions'>
    <%= t('.enter_password') %>
  </p>
  <div class="password_field">
    <%= form.label :password, :class => 'form__label' %>
    <%= form.password_field :password, :class => 'form__input' %>
  </div>


  <div class="profile-checkbox form__checkbox">
    <%= form.check_box :hide_email, :class => 'form__checkbox__input' %>
    <%= form.label :hide_email, t('.hide_email'), :class => 'form__checkbox__label' %>
  </div>

  <div class="submit_field">
    <%= form.submit 'Update', :data => {:disable_with => t('form_disable_with')}, :class => 'form__submit' %>
  </div>

  <div class="t-body">
    <h2><%= t '.reset_password.title' %></h2>
    <p><%= t('.reset_password.text_html', :link => link_to(t('.reset_password.link_text'), new_password_path)) %></p>

    <h2><%= t '.api_access.title' %></h2>
    <p>
      <%= t('.api_access.key_is_html', :key => content_tag(:strong, current_user.api_key)) %>
    </p>
    <p>
      <%= t('.api_access.credentials_html', :gem_credentials_file => content_tag(:code, '~/.gem/credentials'),
                                            :gem_commands_link => link_to(t('.api_access.link_text'), page_path('gem_docs'))) %>
    </p>
    <pre><code>gem signin</code></pre>
  </div>
<% end %>

<%= button_to t('.api_access.reset'), reset_api_v1_api_key_path, :method => :put, :data => {:confirm => t('.api_access.confirm_reset')}, :class => 'form__submit' %>


<div class="t-body">
  <h2><%= t '.mfa.multifactor_auth' %></h2>
  <% if @user.mfa_enabled? %>
    <p><%= t '.mfa.enabled' %></p>
    <%= form_tag multifactor_auth_path, :method => :put, :id => 'mfa-edit' do %>
      <%= label_tag :level, t('.mfa.level.title'), :class => 'form__label' %>
      <%= select_tag :level, options_for_select([
        [t('.mfa.level.ui_and_api'), 'ui_and_api'],
        [t('.mfa.level.ui_only'), 'ui_only'],
        [t('.mfa.level.disabled'), 'disabled']], @user.mfa_level), :class => 'form__input form__select' %>
      <div class="text_field">
        <%= label_tag :otp, 'OTP code', :class => 'form__label' %>
        <%= text_field_tag :otp, '', :class => 'form__input', :autocomplete => :off %>
      </div>
      <%= submit_tag t('.mfa.update'), :class => 'form__submit' %>
    <% end %>
  <% else %>
{'fraction_non_alphanumeric': 0.21308479532163743, 'fraction_numerical': 0.003533138401559454, 'mean_word_length': 3.645727221279004, 'pattern_counts': {'":': 0, '<': 196, '<?xml version=': 0, '>': 261, 'https://': 3, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4205796', 'n_tokens_mistral': 3117, 'n_tokens_neox': 2896, 'n_words': 507}