<commit_before>{% extends "base.html" %}

{% block title %}Upload{% endblock %}

{% block extra_header %}
<link rel="stylesheet" href="{{ MEDIA_URL}}css/fileuploader.css" type="text/css" charset="utf-8"/>
{% endblock %}

{% block content %}
<div id="upload">       
    <noscript>          
        <p>Please enable JavaScript to use file uploader.</p>
    </noscript>         
</div>
<div id="dataset">
    <form id="dataset_form">
        <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
        <label for="dataset_name">Name:</label>
        <input id="dataset_name" type="text" name="name" maxlength="256">
        <input type="hidden" name="data_upload" id="dataset_data_upload">
        <input type="submit" id="dataset_submit" value="Submit" />
    </form>
</div>
{% endblock %}

{% block extra_footer %}
<script type="text/javascript" src="{{ MEDIA_URL }}js/fileuploader.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/json2.js"></script>
<script type="text/javascript" src="redd.js"></script>
<script type="text/javascript">
$(function() {
    var uploader = new qq.FileUploader({
        action: "{% url ajax_upload %}",
        element: $("#upload")[0],
        multiple: false,
        onComplete: function(id, fileName, responseJSON) {
            if(responseJSON.success) {
                $("#dataset_data_upload").val(responseJSON["id"]);
                $("#dataset").show();
            } else {
                alert("Upload failed!");
            }
        },
        params: {
            "csrf_token": "{{ csrf_token }}",
            "csrf_name": "csrfmiddlewaretoken",
            "csrf_xname": "X-CSRFToken",
        }
    });

    $("#dataset_form").submit(function() {
        REDD.create_dataset(
            $("#dataset_form #dataset_name").val(),
            $("#dataset_form #dataset_data_upload").val(),
            function() {
                alert("Success!");
            });

        return false;
    }); 
})
</script>
{% endblock %}
<commit_msg>Use dashes not underscores for ids.<commit_after>{% extends "base.html" %}

{% block title %}Upload{% endblock %}

{% block extra_header %}
<link rel="stylesheet" href="{{ MEDIA_URL}}css/fileuploader.css" type="text/css" charset="utf-8"/>
{% endblock %}

{% block content %}
<div id="upload">       
    <noscript>          
        <p>Please enable JavaScript to use file uploader.</p>
    </noscript>         
</div>
<div id="dataset">
    <form id="dataset-form">
        <label for="dataset-name">Name:</label>
        <input id="dataset-name" type="text" name="name" maxlength="256">
        <input id="dataset-data-upload" type="hidden" name="data-upload" >
        <input id="dataset-submit" type="submit" value="Submit" />
    </form>
</div>
{% endblock %}

{% block extra_footer %}
<script type="text/javascript" src="{{ MEDIA_URL }}js/fileuploader.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/json2.js"></script>
<script type="text/javascript" src="redd.js"></script>
<script type="text/javascript">
$(function() {
    var uploader = new qq.FileUploader({
        action: "{% url ajax_upload %}",
        element: $("#upload")[0],
        multiple: false,
        onComplete: function(id, fileName, responseJSON) {
            if(responseJSON.success) {
                $("#dataset-data-upload").val(responseJSON["id"]);
                $("#dataset").show();
            } else {
                alert("Upload failed!");
            }
        },
        params: {
            "csrf_token": "{{ csrf_token }}",
            "csrf_name": "csrfmiddlewaretoken",
            "csrf_xname": "X-CSRFToken",
        }
    });

    $("#dataset-form").submit(function() {
        REDD.create_dataset(
            $("#dataset-form #dataset-name").val(),
            $("#dataset-form #dataset-data-upload").val(),
            function() {
                alert("Success!");
            });

        return false;
    }); 
})
</script>
{% endblock %}

{'fraction_non_alphanumeric': 0.18822055137844612, 'fraction_numerical': 0.0030075187969924814, 'mean_word_length': 2.553873552983081, 'pattern_counts': {'":': 6, '<': 52, '<?xml version=': 0, '>': 52, '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': '1652576', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1194, 'n_words': 230}