<commit_before><!DOCTYPE html>
<html lang="en">
  <head>
    <title>Data source @ HXL Proxy</title>
    {% include "snippets/headers.html" %}
  </head>
  <body class="container-fluid">
    {% with facet='source' %}
    {% include "snippets/navbar.html" %}
    {% endwith %}
    <header class="col-sm-12">
      {% with facet='source' %}
      {% include "snippets/edittabs.html" %}
      {% endwith %}
      <h1>
        Choose your HXL data source
      </h1>
    </header>
    <main class="col-sm-9 col-md-10">
      <section id="url" class="panel panel-primary">
        <div class="panel-heading">
          <h2 class="panel-title">
            <b>Option 1:</b>
            enter a URL
          </h2>
        </div>
        <div class="panel-body">
        {% if key %}
        {% set method="POST" %}
        {% set action="/actions/save-profile" %}
        {% else %}
        {% set method="GET" %}
        {% set action="/data/edit" %}
        {% endif %}
          <form action="{{ action }}" method="{{ method }}">
            <div class="input-group required">
              <input id='dataset-url'
                     class="form-control" 
                     name="url"
                     type="url"
                     required="required"
                     value="{{ profile.args.url }}"
                     placeholder="http://example.org/dataset.csv" />
              <div class="input-group-btn">
                <button class="btn btn-success"
                        type="submit">Next</button>
              </div>
            </div>

            <p class="help-block small">
              Type or paste the URL of an online spreadsheet or API containing <a
              href="http://hxlstandard.org/">HXL hashtags</a>.
            </p>
            {% include "snippets/params.html" %}

          </form>
        </div>
      </section>
      <section id="cloud" class="panel panel-primary icons">
        <div class="panel-heading">
          <h2 class="panel-title">
            <b>Option 2:</b>
            choose from the cloud
          </h2>
        </div>
        <div class="panel-body" id="cloud-body">
          <a href="#" onclick="return hxl_proxy.doHDX('#dataset-url', true);">
            <img src="{{ static('images/hdx-logo.png') }}" alt="Humanitarian Data Exchange logo" />
            <span>HDX</span>
          </a>
          <a href="#" onclick="return hxl_proxy.doDropbox('#dataset-url', true);">
            <img src="{{ static('images/dropbox-logo.png') }}" alt="Dropbox logo" />
            <span>Dropbox</span>
          </a>
          <a href="#" onclick="return hxl_proxy.doGDrive('#dataset-url', true);">
            <img src="{{ static('images/google-drive-logo.png') }}" alt="Google Drive logo" />
            <span>Google Drive</span>
          </a>
        </div>
      </section>
    </main>
    {% include "snippets/sidebar.html" %}
    {% include "snippets/scripts.html" %}
    <script src="{{ static('hxl-proxy/hxl-proxy.js') }}"></script>
    <script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="<KEY>"></script>
    <script>
      if (typeof Dropbox == 'undefined') {
          $('#cloud-body').prepend('<p class="alert alert-danger">Dropbox chooser unavailable (you may need to disable any ad blockers).</p>');
      }
    </script>
    <script src="https://davidmegginson.github.io/hdx-chooser/hdx.js"></script>
    <script type="text/javascript" src="https://apis.google.com/js/api.js"></script>
  </body>
</html>
<commit_msg>Hide edit tabs when there's no source yet.<commit_after><!DOCTYPE html>
<html lang="en">
  <head>
    <title>Data source @ HXL Proxy</title>
    {% include "snippets/headers.html" %}
  </head>
  <body class="container-fluid">
    {% with facet='source' %}
    {% include "snippets/navbar.html" %}
    {% endwith %}
    <header class="col-sm-12">
      {% if profile.args.url %}
      {% with facet='source' %}
      {% include "snippets/edittabs.html" %}
      {% endwith %}
      {% endif %}
      <h1>
        Choose your HXL data source
      </h1>
    </header>
    <main class="col-sm-9 col-md-10">
      <section id="url" class="panel panel-primary">
        <div class="panel-heading">
          <h2 class="panel-title">
            <b>Option 1:</b>
            enter a URL
          </h2>
        </div>
        <div class="panel-body">
        {% if key %}
        {% set method="POST" %}
        {% set action="/actions/save-profile" %}
        {% else %}
        {% set method="GET" %}
        {% set action="/data/edit" %}
        {% endif %}
          <form action="{{ action }}" method="{{ method }}">
            <div class="input-group required">
              <input id='dataset-url'
                     class="form-control" 
                     name="url"
                     type="url"
                     required="required"
                     value="{{ profile.args.url }}"
                     placeholder="http://example.org/dataset.csv" />
              <div class="input-group-btn">
                <button class="btn btn-success"
                        type="submit">Next</button>
              </div>
            </div>

            <p class="help-block small">
              Type or paste the URL of an online spreadsheet or API containing <a
              href="http://hxlstandard.org/">HXL hashtags</a>.
            </p>
            {% include "snippets/params.html" %}

          </form>
        </div>
      </section>
      <section id="cloud" class="panel panel-primary icons">
        <div class="panel-heading">
          <h2 class="panel-title">
            <b>Option 2:</b>
            choose from the cloud
          </h2>
        </div>
        <div class="panel-body" id="cloud-body">
          <a href="#" onclick="return hxl_proxy.doHDX('#dataset-url', true);">
            <img src="{{ static('images/hdx-logo.png') }}" alt="Humanitarian Data Exchange logo" />
            <span>HDX</span>
          </a>
          <a href="#" onclick="return hxl_proxy.doDropbox('#dataset-url', true);">
            <img src="{{ static('images/dropbox-logo.png') }}" alt="Dropbox logo" />
            <span>Dropbox</span>
          </a>
          <a href="#" onclick="return hxl_proxy.doGDrive('#dataset-url', true);">
            <img src="{{ static('images/google-drive-logo.png') }}" alt="Google Drive logo" />
            <span>Google Drive</span>
          </a>
        </div>
      </section>
    </main>
    {% include "snippets/sidebar.html" %}
    {% include "snippets/scripts.html" %}
    <script src="{{ static('hxl-proxy/hxl-proxy.js') }}"></script>
    <script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="<KEY>"></script>
    <script>
      if (typeof Dropbox == 'undefined') {
          $('#cloud-body').prepend('<p class="alert alert-danger">Dropbox chooser unavailable (you may need to disable any ad blockers).</p>');
      }
    </script>
    <script src="https://davidmegginson.github.io/hdx-chooser/hdx.js"></script>
    <script type="text/javascript" src="https://apis.google.com/js/api.js"></script>
  </body>
</html>

{'fraction_non_alphanumeric': 0.1815149409312022, 'fraction_numerical': 0.003891591382904795, 'mean_word_length': 1.896940418679549, 'pattern_counts': {'":': 0, '<': 155, '<?xml version=': 0, '>': 155, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '804311', 'n_tokens_mistral': 2275, 'n_tokens_neox': 2121, 'n_words': 444}