<commit_before>{% extends "content_layout.html" %}
{% block content %}
<div class="container">

    {% with messages = get_flashed_messages() %}
    {% if messages %}

    <script type="text/javascript">
    $(window).on('load',function(){
        $('#wrong').modal('show');
    });
    </script>

    <div id="wrong" class="modal fade" role="dialog">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-body">
                    {% for message in messages %}
                    <p>{{ message }}</p>
                    {% endfor %}
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div>

        </div>
    </div>

    {% endif %}
    {% endwith %}


    <ul class="nav nav-tabs" id="myTab" role="tablist">
        <li class="nav-item">
            <a class="nav-link active" id="dataset-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home"
               aria-selected="true">Datasets</a>
        </li>
        <li class="nav-item">
            <a class="nav-link" id="assignment-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile"
               aria-selected="false">Assignments</a>
        </li>
    </ul>
    <div class="tab-content" id="myTabContent">
        <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="dataset-tab">
            <hr class="my-4">
            <a class="btn btn-primary" href="/upload">Upload</a>
            <hr class="my-4">
            {% if datasets|length > 0 %}
            {% for dataset in datasets %}
            <form action="upload" method="post">
                <input type="hidden" name="_method" value="DELETE">
                <input type="hidden" name="ds_name" value="{{dataset[0]}}">
                <h6>"{{dataset[0]}}" uploaded by {{dataset[1]}}</h6>
                {% if current_user.name == dataset[1] %}
                <button type="submit" class="btn btn-outline-danger btn-sm">Delete</button>
                {% endif %}
                <button type="button" class="btn btn-outline-warning btn-sm assign" value="{{dataset[0]}}">Assign
                </button>
            </form>
            {% endfor %}
            {% else %}
            <h6>No dataset found in system.</h6>
            {% endif %}
        </div>
        <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="assignment-tab">...</div>
    </div>
</div>


<div class="modal fade" role="dialog" id="newAssign">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">

                <form action="/assignment" method="post" id="assignment_form">
                    <h6 id="assignment_ds">DataSet</h6>
                    <input type="hidden" name="ds_name" id="assignment_ds_name">
                    <select name="ranker" id="ranker_select">
                        <option value="volvo">Volvo XC90</option>
                        <option value="saab">Saab 95</option>
                        <option value="mercedes">Mercedes SLK</option>
                        <option value="audi">Audi TT</option>
                    </select>
                </form>

            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary" form="assignment_form">Submit</button>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript">
$(document).ready(function(){

$(".assign").click(function(){
    var ds_name = $(".assign").val();
    $('#assignment_ds').text(ds_name);
    $('#assignment_ds_name').val(ds_name);
    $('#newAssign').modal('show');
})

})



</script>


{% endblock %}

<commit_msg>Remove heavy js<commit_after>{% extends "content_layout.html" %}
{% block content %}
<div class="container">

    {% with messages = get_flashed_messages() %}
    {% if messages %}

    <script type="text/javascript">
    $(window).on('load',function(){
        $('#wrong').modal('show');
    });
    </script>

    <div id="wrong" class="modal fade" role="dialog">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-body">
                    {% for message in messages %}
                    <p>{{ message }}</p>
                    {% endfor %}
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div>

        </div>
    </div>

    {% endif %}
    {% endwith %}


    <ul class="nav nav-tabs" id="myTab" role="tablist">
        <li class="nav-item">
            <a class="nav-link active" id="dataset-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home"
               aria-selected="true">Datasets</a>
        </li>
        <li class="nav-item">
            <a class="nav-link" id="assignment-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile"
               aria-selected="false">Assignments</a>
        </li>
    </ul>
    <div class="tab-content" id="myTabContent">
        <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="dataset-tab">
            <hr class="my-4">
            <a class="btn btn-primary" href="/upload">Upload</a>
            <hr class="my-4">
            {% if datasets|length > 0 %}
            {% for dataset in datasets %}
            <form action="upload" method="post">
                <input type="hidden" name="_method" value="DELETE">
                <input type="hidden" name="ds_name" value="{{dataset[0]}}">
                <h6>"{{dataset[0]}}" uploaded by {{dataset[1]}}</h6>
                {% if current_user.name == dataset[1] %}
                <button type="submit" class="btn btn-outline-danger btn-sm">Delete</button>
                {% endif %}
                <button type="button" class="btn btn-outline-warning btn-sm"
                        data-toggle="modal" data-target="#newAssign"
                        onclick="$('#assignment_ds_name').val({{dataset[0]}});">Assign
                </button>
            </form>
            {% endfor %}
            {% else %}
            <h6>No dataset found in system.</h6>
            {% endif %}
        </div>
        <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="assignment-tab">...</div>
    </div>
</div>


<div class="modal fade" role="dialog" id="newAssign">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">

                <form action="/assignment" method="post" id="assignment_form">
                    <h6 id="assignment_ds">DataSet</h6>
                    <input type="hidden" name="ds_name" id="assignment_ds_name">
                    <select name="ranker" id="ranker_select">
                        <option value="volvo">Volvo XC90</option>
                        <option value="saab">Saab 95</option>
                        <option value="mercedes">Mercedes SLK</option>
                        <option value="audi">Audi TT</option>
                    </select>
                </form>

            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary" form="assignment_form">Submit</button>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
            </div>
        </div>
    </div>
</div>

{% endblock %}

{'fraction_non_alphanumeric': 0.17578729994837378, 'fraction_numerical': 0.004646360351058337, 'mean_word_length': 1.9131578947368422, 'pattern_counts': {'":': 0, '<': 163, '<?xml version=': 0, '>': 165, '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': '1650946', 'n_tokens_mistral': 2341, 'n_tokens_neox': 2172, 'n_words': 436}