<commit_before><%= javascript_include_tag('rsa/jsbn', 'rsa/prng4', 'rsa/rng', 'rsa/rsa', 'rsa/base64', :cache => 'rsa') %>

<script type="text/javascript">
  function encrypt_passwords() {
    var rsa = new RSAKey();
    rsa.setPublic('<%= @public_modulus %>', '<%= @public_exponent %>');
    if($('password').value != '') {
      $('encrypted_password').value = hex2b64(rsa.encrypt($('password').value));
      $('encrypted_password_confirmation').value = hex2b64(rsa.encrypt($('password_confirmation').value));
      $('password').value = '';
      $('password_confirmation').value = '';
    }
    return true
  }
</script>

<h1><%= t('setup.heading') %></h1>

<% if @error %>
  <p class="very-strong"><%= @error %></p>
<% end %>

<%= form_for @person, :url => setup_path, :html => {:method => 'POST', :onsubmit => "return encrypt_passwords()"} do |form| %>
  <%= hidden_field_tag :encrypted_password %>
  <%= hidden_field_tag :encrypted_password_confirmation %>

  <p><%= t('setup.congratulations') %></p>

  <p class="very-strong"><%= t('setup.do_right_away') %></p>

  <%= error_messages_for(form) %>

  <p>
    <label for="domain_name"><%= t('setup.domain_name') %>:</label>
    <%= text_field_tag 'domain_name', Site.current.host %><br/>
    <em><%= t('setup.domain_name_note') %></em>
  </p>

  <h2><%= t('setup.admin_account') %></h2>
  <p><%= t('setup.more_accounts_later') %></p>
  <p><label><%= t('accounts.first_name') %>:</label><%= form.text_field :first_name %></p>
  <p><label><%= t('accounts.last_name') %>:</label><%= form.text_field :last_name %></p>
  <p><label><%= t('session.email_address') %></label><%= form.text_field :email %><br/><em><%= t('setup.email_note') %></em></p>
  <p><label><%= t('session.password') %></label><%= password_field_tag 'password' %></p>
  <p><label><%= t('session.password_confirm') %></label><%= password_field_tag 'password_confirmation' %></p>

  <p style="margin-top:25px;"><%= submit_tag t('save_changes') %></p>

<% end %><commit_msg>Fix new install setup interface.<commit_after><%= javascript_include_tag('rsa/jsbn', 'rsa/prng4', 'rsa/rng', 'rsa/rsa', 'rsa/base64', :cache => 'rsa') %>

<script type="text/javascript">
  function encrypt_passwords() {
    var rsa = new RSAKey();
    rsa.setPublic('<%= @public_modulus %>', '<%= @public_exponent %>');
    if($('#password').val() != '') {
      $('#encrypted_password').val(hex2b64(rsa.encrypt($('#password').val())));
      $('#encrypted_password_confirmation').val(hex2b64(rsa.encrypt($('#password_confirmation').val())));
      $('#password').val('');
      $('#password_confirmation').val('');
    }
    return true
  }
</script>

<h2><%= t('setup.heading') %></h2>

<% if @error %>
  <p class="very-strong"><%= @error %></p>
<% end %>

<%= form_for @person, :url => setup_path, :html => {:method => 'POST', :onsubmit => "return encrypt_passwords()"} do |form| %>
  <%= hidden_field_tag :encrypted_password %>
  <%= hidden_field_tag :encrypted_password_confirmation %>

  <p><%= t('setup.congratulations') %></p>

  <p class="very-strong"><%= t('setup.do_right_away') %></p>

  <%= error_messages_for(form) %>

  <p>
    <label for="domain_name"><%= t('setup.domain_name') %>:</label>
    <%= text_field_tag 'domain_name', Site.current.host %><br/>
    <em><%= t('setup.domain_name_note') %></em>
  </p>

  <h3><%= t('setup.admin_account') %></h3>
  <p><%= t('setup.more_accounts_later') %></p>
  <p><label><%= t('accounts.first_name') %>:</label><%= form.text_field :first_name %></p>
  <p><label><%= t('accounts.last_name') %>:</label><%= form.text_field :last_name %></p>
  <p><label><%= t('session.email_address') %></label><%= form.text_field :email %><br/><em><%= t('setup.email_note') %></em></p>
  <p><label><%= t('session.password') %></label><%= password_field_tag 'password' %></p>
  <p><label><%= t('session.password_confirm') %></label><%= password_field_tag 'password_confirmation' %></p>

  <p style="margin-top:25px;"><%= submit_tag t('save_changes') %></p>

<% end %>
{'fraction_non_alphanumeric': 0.2691345672836418, 'fraction_numerical': 0.007503751875937969, 'mean_word_length': 5.268025078369906, 'pattern_counts': {'":': 0, '<': 157, '<?xml version=': 0, '>': 167, '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': '1335944', 'n_tokens_mistral': 1593, 'n_tokens_neox': 1471, 'n_words': 242}