<commit_before>{% extends "_layouts/default.html" %}

{% block custom_head %}
<script src="/static/js/handsontable.full.min.js"></script>
<link rel="stylesheet" media="screen" href="/static/css/handsontable.full.min.css">
{% endblock %}

{% block content %}
<form method="POST">

<div class="row">

<div class="col-md-6">
<h3>Perform Mapping</h3>


  <fieldset class="form-group">
    <label for="Email">Email address</label>
    <input type="email" class="form-control" id="Email" placeholder="Enter email">
    <small class="text-muted">We'll never share your email with anyone else.</small>
  </fieldset>
  <fieldset class="form-group">
    <label for="Email">Report Name</label>
    <input type="text" class="form-control" id="ReportName" placeholder=""  autocomplete='off'>
    <small class="text-muted avail_url"></small>
  </fieldset>

  
  <label>Release</label>
  <div class="radio">
    <label>
      <input type="radio" name="Release" value="public" checked>
      Public <small class="text-muted">Your report will be publicly available.</small>
    </label>
  </div>

  <div class="radio">
    <label>
      <input type="radio" name="Release" value="embargo">
      Embargo for 6 months
    </label> <small class="text-muted embargo6"></small>
  </div>

  <div class="radio">
    <label>
      <input type="radio" name="Release" value="embargo">
      Embargo for 1 year
    </label> <small class="text-muted embargo12"></small>
  </div>

    <div class="radio">
    <label>
      <input type="radio" name="Release" value="private">
      Private <small class="text-muted">Your report will be kept private.</small>
    </label>
  </div>

  <label>Data</label><br />
            <small class="text-muted">Copy and Paste your dataset into the table above. You can modify trait names.</small>


</div>


<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">INFO</div>
<div class="panel-body">
Explanation of how this works; directions...<br /><br />

DISCLAIMER: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Sed vos squalidius, illorum vides quam niteat oratio. Qua ex cognitione facilior facta est investigatio rerum occultissimarum. Non autem hoc: igitur ne illud quidem. Post enim Chrysippum eum non sane est disputatum. Duo Reges: constructio interrete. Tum ille timide vel potius verecunde: Facio, inquit. Non est ista, inquam, Piso, magna dissensio.</div>
</div>
</div>
</div>


<div class="row">
      <div class="col-md-12">
            <div id="entry"></div>
            <div class="small">
            <div class="pull-right">
            <br />
            <button type="submit" class="btn btn-primary btn-lg submit">Submit</button>
            </div>
      </div>

</div>
</form>
{% endblock %}


{% block script %}

<script>


String.prototype.hashCode = function() {
  var hash = 0, i, chr, len;
  if (this.length === 0) return hash;
  for (i = 0, len = this.length; i < len; i++) {
    chr   = this.charCodeAt(i);
    hash  = ((hash << 10) - hash) + chr;
    hash |= 0; // Convert to 32bit integer
  }
  return Math.abs(hash);
};

function slugify(text)
{
  return text.toString().toLowerCase()
    .replace(/\s+/g, '-')           // Replace spaces with -
    .replace(/[^\w\-]+/g, '')       // Remove all non-word chars
    .replace(/\-\-+/g, '-')         // Replace multiple - with single -
    .replace(/^-+/, '')             // Trim - from start of text
    .replace(/-+$/, '');            // Trim - from end of text
}

  var data = [
    ["STRAIN", "trait1", "trait2", "trait3"],
  ];

var render_bold = function (instance, td, row, col, prop, value, cellProperties) {
  Handsontable.renderers.TextRenderer.apply(this, arguments);
  td.style.fontWeight = 'bold';
};

var render_header = function (instance, td, row, col, prop, value, cellProperties) {
  Handsontable.renderers.TextRenderer.apply(this, arguments);
  td.style.fontWeight = 'bold';
  td.style.backgroundColor = '#EAEAEA';
};

strain_list = {{strain_list| safe }};
incorrect_strains = [];
// Strain Validator
strainValidator = function (value, callback) {
    setTimeout(function(){
      if (strain_list.includes(value)) {
        callback(true);
      }
      else {
        callback(false);
      }
    }, 1);
  };

var container = document.getElementById('entry');
var hot = new Handsontable(container,
 {
   data: data,
   height: 200,
   colHeaders: false,
   stretchH: 'all',
   columnSorting: true,
   contextMenu: true,
   fixedRowsTop: 1,
   minSpareRows: 5,
   minSpareCols: 1,

   cells: function (row, col, prop) {
      var cellProperties = {};
      
      if (row === 0) {
        cellProperties.renderer = render_header;
      }
      if (col === 0) {
        cellProperties.renderer = render_bold;
        cellProperties.validator = strainValidator;
      }
      if (col === 0 && row == 0) {
        cellProperties.readOnly = true;
        cellProperties.renderer = render_header;<commit_msg>don't validate empty.<commit_after>{% extends "_layouts/default.html" %}

{% block custom_head %}
<script src="/static/js/handsontable.full.min.js"></script>
<link rel="stylesheet" media="screen" href="/static/css/handsontable.full.min.css">
{% endblock %}

{% block content %}
<form method="POST">

<div class="row">

<div class="col-md-6">
<h3>Perform Mapping</h3>


  <fieldset class="form-group">
    <label for="Email">Email address</label>
    <input type="email" class="form-control" id="Email" placeholder="Enter email">
    <small class="text-muted">We'll never share your email with anyone else.</small>
  </fieldset>
  <fieldset class="form-group">
    <label for="Email">Report Name</label>
    <input type="text" class="form-control" id="ReportName" placeholder=""  autocomplete='off'>
    <small class="text-muted avail_url"></small>
  </fieldset>

  
  <label>Release</label>
  <div class="radio">
    <label>
      <input type="radio" name="Release" value="public" checked>
      Public <small class="text-muted">Your report will be publicly available.</small>
    </label>
  </div>

  <div class="radio">
    <label>
      <input type="radio" name="Release" value="embargo">
      Embargo for 6 months
    </label> <small class="text-muted embargo6"></small>
  </div>

  <div class="radio">
    <label>
      <input type="radio" name="Release" value="embargo">
      Embargo for 1 year
    </label> <small class="text-muted embargo12"></small>
  </div>

    <div class="radio">
    <label>
      <input type="radio" name="Release" value="private">
      Private <small class="text-muted">Your report will be kept private.</small>
    </label>
  </div>

  <label>Data</label><br />
            <small class="text-muted">Copy and Paste your dataset into the table above. You can modify trait names.</small>


</div>


<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">INFO</div>
<div class="panel-body">
Explanation of how this works; directions...<br /><br />

DISCLAIMER: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Sed vos squalidius, illorum vides quam niteat oratio. Qua ex cognitione facilior facta est investigatio rerum occultissimarum. Non autem hoc: igitur ne illud quidem. Post enim Chrysippum eum non sane est disputatum. Duo Reges: constructio interrete. Tum ille timide vel potius verecunde: Facio, inquit. Non est ista, inquam, Piso, magna dissensio.</div>
</div>
</div>
</div>


<div class="row">
      <div class="col-md-12">
            <div id="entry"></div>
            <div class="small">
            <div class="pull-right">
            <br />
            <button type="submit" class="btn btn-primary btn-lg submit">Submit</button>
            </div>
      </div>

</div>
</form>
{% endblock %}


{% block script %}

<script>


String.prototype.hashCode = function() {
  var hash = 0, i, chr, len;
  if (this.length === 0) return hash;
  for (i = 0, len = this.length; i < len; i++) {
    chr   = this.charCodeAt(i);
    hash  = ((hash << 10) - hash) + chr;
    hash |= 0; // Convert to 32bit integer
  }
  return Math.abs(hash);
};

function slugify(text)
{
  return text.toString().toLowerCase()
    .replace(/\s+/g, '-')           // Replace spaces with -
    .replace(/[^\w\-]+/g, '')       // Remove all non-word chars
    .replace(/\-\-+/g, '-')         // Replace multiple - with single -
    .replace(/^-+/, '')             // Trim - from start of text
    .replace(/-+$/, '');            // Trim - from end of text
}

  var data = [
    ["STRAIN", "trait1", "trait2", "trait3"],
  ];

var render_bold = function (instance, td, row, col, prop, value, cellProperties) {
  Handsontable.renderers.TextRenderer.apply(this, arguments);
  td.style.fontWeight = 'bold';
};

var render_header = function (instance, td, row, col, prop, value, cellProperties) {
  Handsontable.renderers.TextRenderer.apply(this, arguments);
  td.style.fontWeight = 'bold';
  td.style.backgroundColor = '#EAEAEA';
};

strain_list = {{strain_list| safe }};
incorrect_strains = [];
// Strain Validator
strainValidator = function (value, callback) {
    setTimeout(function(){
      if (strain_list.includes(value) || value == "") {
        callback(true);
      }
      else {
        callback(false);
      }
    }, 1);
  };

var container = document.getElementById('entry');
var hot = new Handsontable(container,
 {
   data: data,
   height: 200,
   colHeaders: false,
   stretchH: 'all',
   columnSorting: true,
   contextMenu: true,
   fixedRowsTop: 1,
   minSpareRows: 5,
   minSpareCols: 1,

   cells: function (row, col, prop) {
      var cellProperties = {};
      
      if (row === 0) {
        cellProperties.renderer = render_header;
      }
      if (col === 0) {
        cellProperties.renderer = render_bold;
        cellProperties.validator = strainValidator;
        cellProperties.autoComplete = strain_list;
      }
      if (col === 0 && row == 0) {
        cellProperties.readOnly = true;
        cellProperties.renderer = render_header;
{'fraction_non_alphanumeric': 0.1612551969906949, 'fraction_numerical': 0.006533359730746387, 'mean_word_length': 3.067230273752013, 'pattern_counts': {'":': 0, '<': 175, '<?xml version=': 0, '>': 169, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '899504', 'n_tokens_mistral': 3403, 'n_tokens_neox': 3252, 'n_words': 864}