<commit_before>{% extends 'base.html' %}
{% block title %}View datasets - Plenar.io{% endblock %}
{% block content %}
<div class="container">
    {% if errors %}
        <h4>There were some problems with your submission: </h4>
        {% for error in errors %}
            <p>{{error}}</p>
        {% endfor %}
    {% endif %}
    <h2>
        {{ datasets|length }} datasets
        <small><a href='/add-dataset/'>Add dataset &raquo;</a></small>
    </h2>
    <div id="errors"></div>
    <table class="table table-bordered table-condensed display">
        <thead>
            <th>Name</th>
            <th>Date range</th>
            <th>Update frequency</th>
            <th>Last updated</th>
            <th></th>
        </thead>
        <tbody>
            {% for dataset in datasets %}
                <tr>
                    <td>{{ dataset.human_name }}</td>
                    {% if dataset.obs_from and dataset.obs_to %}
                        <td>{{ dataset.obs_from }}—{{dataset.obs_to}}</td>
                    {% else %}
                        <td></td>
                    {% endif %}
                    <td>{{ dataset.update_freq }}</td>
                    <td>-</td>
                    <td><button class="btn btn-default btn-sm update-dataset" data-dataset="{{dataset.source_url}}"><i class='fa fa-refresh'></i> Update now</button></td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
</div> <!-- /container -->
<!-- DataTables CSS -->
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.2/css/jquery.dataTables.css">
{% endblock content %}
{% block extra_javascript %}
    <script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.2/js/jquery.dataTables.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $('.update-dataset').on('click', function(e){
                e.preventDefault()
                console.log($(this).data('dataset'))
            })
            $('.display').DataTable();
        })
    </script>
{% endblock %}
<commit_msg>customization for DataTables #25<commit_after>{% extends 'base.html' %}
{% block title %}View datasets - Plenar.io{% endblock %}
{% block extra_styles %}
    <!-- DataTables CSS -->
    <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.2/css/jquery.dataTables.css">
{% endblock %}
{% block content %}
<div class="container">
    {% if errors %}
        <h4>There were some problems with your submission: </h4>
        {% for error in errors %}
            <p>{{error}}</p>
        {% endfor %}
    {% endif %}
    <h2>
        {{ datasets|length }} datasets
        <small><a href='/add-dataset/'>Add dataset &raquo;</a></small>
    </h2>
    <div id="errors"></div>
    <table id='datasets-table' class="table table-bordered table-condensed">
        <thead>
            <th>Name</th>
            <th>Date range</th>
            <th>Update frequency</th>
            <th>Last updated</th>
            <th></th>
        </thead>
        <tbody>
            {% for dataset in datasets %}
                <tr>
                    <td>{{ dataset.human_name }}</td>
                    {% if dataset.obs_from and dataset.obs_to %}
                        <td>{{ dataset.obs_from }}—{{dataset.obs_to}}</td>
                    {% else %}
                        <td></td>
                    {% endif %}
                    <td>{{ dataset.update_freq }}</td>
                    <td>-</td>
                    <td><button class="btn btn-default btn-sm update-dataset" data-dataset="{{dataset.source_url}}"><i class='fa fa-refresh'></i> Update now</button></td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
</div> <!-- /container -->
{% endblock content %}
{% block extra_javascript %}
    <script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.2/js/jquery.dataTables.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $('.update-dataset').on('click', function(e){
                e.preventDefault()
                console.log($(this).data('dataset'))
            })
            $('#datasets-table').DataTable( {
                "paging": false,
                "searching": false
            } );
        })
    </script>
{% endblock %}

{'fraction_non_alphanumeric': 0.18397421137462583, 'fraction_numerical': 0.006447156343541331, 'mean_word_length': 1.7372400756143667, 'pattern_counts': {'":': 2, '<': 113, '<?xml version=': 0, '>': 113, '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': '6597331', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1231, 'n_words': 246}