<commit_before><% content_for :extra_js do %>
  var submitted=false;

  $('#submit').click(function(e) {
    submission = { address: $('#address').val(), contribute: true }
    $('#spinner').removeClass('hidden');

    $.post("https://sorting-office.openaddressesuk.org/address", submission)
      .done(function(data) {
        $('#addressproblem').addClass('hidden');
        window.location.replace("https://alpha.openaddressesuk.org/submit/thanks");
      })
      .error(function() {
        $('#spinner').addClass('hidden');
        $('#addressproblem').removeClass('hidden');
      })

    e.preventDefault();
  })
<% end %>

<div class="jumbotron">
<form id="contribute" action="http://powerful-depths-1407.herokuapp.com/" method="post" class="form-horizontal submission-form" role="form">

  <div class="form-group">
    <label for="address" class="col-sm-2 control-label">Address</label>
    <div class="col-sm-10">
      <textarea name="address"
                id="address"
                rows="6"
                class="form-control"
                required=""></textarea>
    </div>
  </div>

  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button class="btn btn-primary" id="submit"><i id="spinner" class="fa fa-circle-o-notch fa-spin hidden"></i> Submit this address</button>
      <a data-toggle="collapse" href="#submission-guidelines"><small>Read the submission guidelines</small></a>
    </div><commit_msg>Put honeypot back<commit_after><% content_for :extra_js do %>
  var submitted=false;

  $('#submit').click(function(e) {
    submission = { address: $('#address').val(), contribute: true }
    $('#spinner').removeClass('hidden');

    $.post("https://sorting-office.openaddressesuk.org/address", submission)
      .done(function(data) {
        $('#addressproblem').addClass('hidden');
        window.location.replace("https://alpha.openaddressesuk.org/submit/thanks");
      })
      .error(function() {
        $('#spinner').addClass('hidden');
        $('#addressproblem').removeClass('hidden');
      })

    e.preventDefault();
  })
<% end %>

<div class="jumbotron">
<form id="contribute" action="http://powerful-depths-1407.herokuapp.com/" method="post" class="form-horizontal submission-form" role="form">

  <div class="form-group">
    <label for="address" class="col-sm-2 control-label">Address</label>
    <div class="col-sm-10">
      <textarea name="address"
                id="address"
                rows="6"
                class="form-control"
                required=""></textarea>
    </div>
  </div>

  <div class="form-group" style="display: none">
      <!-- Honeypot to catch spam -->
      <label for="agree_to_terms" class="col-sm-2 control-label">Leave this blank</label>
      <div class="col-sm-10">
        <input name="agree_to_terms" id="agree_to_terms" class="form-control" type="text"></input>
      </div>
  </div>

  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button class="btn btn-primary" id="submit"><i id="spinner" class="fa fa-circle-o-notch fa-spin hidden"></i> Submit this address</button>
      <a data-toggle="collapse" href="#submission-guidelines"><small>Read the submission guidelines</small></a>
    </div>
{'fraction_non_alphanumeric': 0.19575253924284394, 'fraction_numerical': 0.007694675284702986, 'mean_word_length': 3.310344827586207, 'pattern_counts': {'":': 0, '<': 58, '<?xml version=': 0, '>': 58, 'https://': 4, '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': '2554573', 'n_tokens_mistral': 1028, 'n_tokens_neox': 988, 'n_words': 168}