<commit_before>{% extends "base.html" %}
{% block title %}Search Results{% endblock %}
{% block css %}
    <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
    <link rel="stylesheet" type="text/css" href="/static/new/css/show_trait.css" />
{% endblock %}
{% block content %}
<!-- Start of body -->

    <div class="container">

        <h3>GN searched for the term(s) <b>"{{ terms }}"</b> in 51 datasets and 13763 traits across 10 species<br/>
            and found <b>{{ trait_count }}</b> results that match your query.<br/>
            You can filter these results by adding key words in the fields below<br/>
            and you can also sort results on most columns.</h3>
        <p>To study a record, click on its ID below.<br />Check records below and click Add button to add to selection.</p>

        <div>
            <br />
            <button class="btn btn-default" id="select_all"><span class="glyphicon glyphicon-ok"></span> Select All</button>
            <button class="btn btn-default" id="deselect_all"><span class="glyphicon glyphicon-remove"></span> Deselect All</button>
            <button class="btn btn-default" id="invert"><span class="glyphicon glyphicon-resize-vertical"></span> Invert</button>
            <button class="btn btn-success" id="add" disabled ><span class="glyphicon glyphicon-plus-sign"></span> Add</button>
            <input type="text" id="searchbox" class="form-control" style="width: 200px; display: inline;" placeholder="Search This Table For ...">
            <input type="text" id="select_top" class="form-control" style="width: 200px; display: inline;" placeholder="Select Top ...">
            <form id="export_form" method="POST" action="/export_traits_csv" style="display: inline;">
              <input type="hidden" name="headers" id="headers" value="{% for field in header_fields %}{{ field }},{% endfor %}">
              <input type="hidden" name="database_name" id="database_name" value="None">
              <input type="hidden" name="export_data" id="export_data" value="">
              <button class="btn btn-default" id="export_traits">Download CSV</button>
            </form>
            <br />
            <br />
            <div style="min-width: 2000px; width: 100%;">
              <table id="trait_table" class="table-hover table-striped cell-border" style="float: left;">
                <tbody>
                 <td colspan="100%" align="center"><br><b><font size="15">Loading...</font></b><br></td>
                </tbody>
            </table>
            </div>
        </div>
    </div>

<!-- End of body -->

{% endblock %}

{% block js %}
    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='js_alt/md5.min.js') }}"></script>
    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTables/js/jquery.dataTables.min.js') }}"></script>
    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='jszip/jszip.min.js') }}"></script>
    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/plugins/sorting/natural.js') }}"></script>
    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/colReorder/js/dataTables.colReorder.js') }}"></script>
    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/colResize/dataTables.colResize.js') }}"></script>
    <script language="javascript" type="text/javascript" src="/static/new/javascript/search_results.js"></script>

    <script type='text/javascript'>
      var the_rows = {{ trait_list|safe }};
    </script>

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

            $('#trait_table tr').click(function(event) {
                if (event.target.type !== 'checkbox') {
                    $(':checkbox', this).trigger('click');
                }
            });

            function change_buttons() {
                buttons = ["#add", "#remove"];
                num_checked = $('.trait_checkbox:checked').length;
                if (num_checked === 0) {
                    for (_i = 0, _len = buttons.length; _i < _len; _i++) {
                        button = buttons[_i];
                        $(button).prop("disabled", true);
                    }
                } else {
                    for (_j = 0, _len2 = buttons.length; _j < _len2; _j++) {
                        button = buttons[_j];
                        $(button).prop("disabled", false);
                    }
                }
                         //});
                if ($(this).is(":checked")) {
                    if (!$(this).closest('tr').hasClass('selected')) {
                        $(this).closest('tr').addClass('selected')
                    }
                }
                else {
                    if ($(this).closest('tr').hasClass('selected')) {
                        $(this).closest('tr').removeClass('selected')
                    }
                }
            }

            console.time("Creating table");
            $('#trait_table').DataTable( {
                'drawCallback': function( settings ) {
                     $('#trait_table tr').click(function(event) {
                         if (event.target.type !== 'checkbox' && event.target.tagName.toLowerCase() !== 'a') {
                             $(':checkbox', this).trigger('click');
                         }
                     });
                     $('.trait_checkbox:checkbox').on("change", change_buttons);
                },
                "createdRow": function ( row, data, index ) {
                    $('td', row).eq(0).attr("style", "text-align: center; padding: 4px 10px 2px 10px;");
                    $('td', row).eq(1).attr("align", "right");
                    $('td', row).eq(5).attr('title', $('td', row).eq(5).text());
                    if ($('td', row).eq(5).text().length > 150) {
                        $('td', row).eq(5).text($('td', row).eq(5).text().substring(0, 150));
                        $('td', row).eq(5).text($('td', row).eq(5).text() + '...')
                    }
                    $('td', row).eq(6).attr('title', $('td', row).eq(6).text());
                    if ($('td', row).eq(6).text().length > 150) {
                        $('td', row).eq(6).text($('td', row).eq(6).text().substring(0, 150));
                        $('td', row).eq(6).text($('td', row).eq(6).text() + '...')
                    }
                    $('td', row).slice(8,11).attr("align", "right");<commit_msg>Right-aligned the Mean column for phenotype global search<commit_after>{% extends "base.html" %}
{% block title %}Search Results{% endblock %}
{% block css %}
    <link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
    <link rel="stylesheet" type="text/css" href="/static/new/css/show_trait.css" />
{% endblock %}
{% block content %}
<!-- Start of body -->

    <div class="container">

        <h3>GN searched for the term(s) <b>"{{ terms }}"</b> in 51 datasets and 13763 traits across 10 species<br/>
            and found <b>{{ trait_count }}</b> results that match your query.<br/>
            You can filter these results by adding key words in the fields below<br/>
            and you can also sort results on most columns.</h3>
        <p>To study a record, click on its ID below.<br />Check records below and click Add button to add to selection.</p>

        <div>
            <br />
            <button class="btn btn-default" id="select_all"><span class="glyphicon glyphicon-ok"></span> Select All</button>
            <button class="btn btn-default" id="deselect_all"><span class="glyphicon glyphicon-remove"></span> Deselect All</button>
            <button class="btn btn-default" id="invert"><span class="glyphicon glyphicon-resize-vertical"></span> Invert</button>
            <button class="btn btn-success" id="add" disabled ><span class="glyphicon glyphicon-plus-sign"></span> Add</button>
            <input type="text" id="searchbox" class="form-control" style="width: 200px; display: inline;" placeholder="Search This Table For ...">
            <input type="text" id="select_top" class="form-control" style="width: 200px; display: inline;" placeholder="Select Top ...">
            <form id="export_form" method="POST" action="/export_traits_csv" style="display: inline;">
              <input type="hidden" name="headers" id="headers" value="{% for field in header_fields %}{{ field }},{% endfor %}">
              <input type="hidden" name="database_name" id="database_name" value="None">
              <input type="hidden" name="export_data" id="export_data" value="">
              <button class="btn btn-default" id="export_traits">Download CSV</button>
            </form>
            <br />
            <br />
            <div style="min-width: 2000px; width: 100%;">
              <table id="trait_table" class="table-hover table-striped cell-border" style="float: left;">
                <tbody>
                 <td colspan="100%" align="center"><br><b><font size="15">Loading...</font></b><br></td>
                </tbody>
            </table>
            </div>
        </div>
    </div>

<!-- End of body -->

{% endblock %}

{% block js %}
    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='js_alt/md5.min.js') }}"></script>
    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTables/js/jquery.dataTables.min.js') }}"></script>
    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='jszip/jszip.min.js') }}"></script>
    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/plugins/sorting/natural.js') }}"></script>
    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/colReorder/js/dataTables.colReorder.js') }}"></script>
    <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/colResize/dataTables.colResize.js') }}"></script>
    <script language="javascript" type="text/javascript" src="/static/new/javascript/search_results.js"></script>

    <script type='text/javascript'>
      var the_rows = {{ trait_list|safe }};
    </script>

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

            $('#trait_table tr').click(function(event) {
                if (event.target.type !== 'checkbox') {
                    $(':checkbox', this).trigger('click');
                }
            });

            function change_buttons() {
                buttons = ["#add", "#remove"];
                num_checked = $('.trait_checkbox:checked').length;
                if (num_checked === 0) {
                    for (_i = 0, _len = buttons.length; _i < _len; _i++) {
                        button = buttons[_i];
                        $(button).prop("disabled", true);
                    }
                } else {
                    for (_j = 0, _len2 = buttons.length; _j < _len2; _j++) {
                        button = buttons[_j];
                        $(button).prop("disabled", false);
                    }
                }
                         //});
                if ($(this).is(":checked")) {
                    if (!$(this).closest('tr').hasClass('selected')) {
                        $(this).closest('tr').addClass('selected')
                    }
                }
                else {
                    if ($(this).closest('tr').hasClass('selected')) {
                        $(this).closest('tr').removeClass('selected')
                    }
                }
            }

            console.time("Creating table");
            $('#trait_table').DataTable( {
                'drawCallback': function( settings ) {
                     $('#trait_table tr').click(function(event) {
                         if (event.target.type !== 'checkbox' && event.target.tagName.toLowerCase() !== 'a') {
                             $(':checkbox', this).trigger('click');
                         }
                     });
                     $('.trait_checkbox:checkbox').on("change", change_buttons);
                },
                "createdRow": function ( row, data, index ) {
                    $('td', row).eq(0).attr("style", "text-align: center; padding: 4px 10px 2px 10px;");
                    $('td', row).eq(1).attr("align", "right");
                    $('td', row).eq(5).attr('title', $('td', row).eq(5).text());
                    if ($('td', row).eq(5).text().length > 150) {
                        $('td', row).eq(5).text($('td', row).eq(5).text().substring(0, 150));
                        $('td', row).eq(5).text($('td', row).eq(5).text() + '...')
                    }
                    $('td', row).eq(6).attr('title', $('td', row).eq(6).text());
                    if ($('td', row).eq(6).text().length > 150) {
                        $('td', row).eq(6).text($('td', row).eq(6).text().substring(0, 150));
                        $('td', row).eq(6).text($('td', row).eq(6).text() + '...')
                    }
                    $('td', row).eq(6).attr("align", "right");
                    $('td', row).slice(8,11).attr("align", "right");
{'fraction_non_alphanumeric': 0.18944030676203819, 'fraction_numerical': 0.011134872059582626, 'mean_word_length': 2.0752834467120183, 'pattern_counts': {'":': 4, '<': 165, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3511179', 'n_tokens_mistral': 3933, 'n_tokens_neox': 3668, 'n_words': 791}