aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask/templates/gsearchact.html
blob: 57fe25b50a423b47cfaf4a29ab67673a2f111805 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{% extends "base.html" %}
{% block title %}Search Results{% endblock %}
{% block css %}
    <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" />
    <link rel="stylesheet" type="text/css" href="/static/packages/DT_bootstrap/DT_bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="/static/packages/TableTools/media/css/TableTools.css" />
{% endblock %}
{% block content %}
<!-- Start of body -->

    <div class="container">

        <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-default" id="add"><span class="glyphicon glyphicon-plus-sign"></span> Add</button>
            <button class="btn btn-primary pull-right"><span class="glyphicon glyphicon-download"></span> Download Table</button>
            <br />
            <br />
            <table class="table table-hover table-striped" id='' style="width: 100%;">
                <thead>
                    <tr>
						<th>Tissue</th>
						<th>Dataset</th>
						<th>Record</th>
						<th>Symbol</th>
						<th>Description</th>
						<th>Chr</th>
						<th>Mb</th>
						<th>Mean</th>
						<th>Max LRS</th>
						<th>Locus</th>
						<th>Pvalue</th>
						<th>Additive</th>
                    </tr>
                </thead>

                <tbody>
                    {% for this_trait in results %}
                    <TR>
                        {% for item in this_trait[1:] %}
							<TD>{{ item }}</TD>
						{% endfor %}
                    </TR>
                {% endfor %}
                </tbody>

            </table>
        </div>
    </div>

<!-- End of body -->

{% endblock %}

{% block js %}
    <script type="text/javascript" src="/static/new/javascript/search_results.js"></script>
    
    <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.dataTables.min.js"></script>
    <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script>
    <script language="javascript" type="text/javascript" src="/static/packages/DT_bootstrap/DT_bootstrap.js"></script>
    <script language="javascript" type="text/javascript" src="/static/packages/TableTools/media/js/TableTools.min.js"></script>
    <script type="text/javascript" charset="utf-8">
        function getValue(x) {
            if (x.indexOf('input') >= 0) {
                if ($(x).val() == 'x') {
                    return 0
                }
                else {
                   return parseFloat($(x).val());
                }
            }
            return parseFloat(x);
        }
            
        jQuery.fn.dataTableExt.oSort['cust-txt-asc'] = function (a, b) {
            var x = getValue(a);
            var y = getValue(b);
            return ((x < y) ? -1 : ((x > y) ? 1 : 0));
        };
            
        jQuery.fn.dataTableExt.oSort['cust-txt-desc'] = function (a, b) {
            var x = getValue(a);
            var y = getValue(b);
            return ((x < y) ? 1 : ((x > y) ? -1 : 0));
        };


        $(document).ready( function () {
            
	     /*num_columns = $('#trait_table').find('tr:first th').length;

            nul_cols = []
	     for (i=0; i<num_columns - 1, i++) {
                $('#trait_table > tbody > tr').each(function() {
                    if ($(this).find('td:eq(i)').html()){
                        continue;
                    }
                });
                nul_cols.push(i)
	     }*/

            console.time("Creating table");
            console.timeEnd("Creating table");
        });
        
    </script>
    
{% endblock %}