diff options
Diffstat (limited to 'wqflask/wqflask/templates/gsearch_pheno.html')
-rwxr-xr-x | wqflask/wqflask/templates/gsearch_pheno.html | 101 |
1 files changed, 65 insertions, 36 deletions
diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html index 2527bebf..9be0349f 100755 --- a/wqflask/wqflask/templates/gsearch_pheno.html +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -4,6 +4,7 @@ <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" /> + <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/buttons.bootstrap.css" /> <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/dataTables.fixedHeader.css" > <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/fixedcolumns/3.0.4/css/dataTables.fixedColumns.css"> {% endblock %} @@ -20,45 +21,61 @@ <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" disabled ><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> <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 ..."> <br /> <br /> - <table class="table table-hover table-striped" id='trait_table' style="float: left;"> + <div style="width: 1500px; background-color: #eeeeee; border: 1px solid black;"> + <table width="1500px" id="trait_table" class="table table-hover table-striped"> <thead> <tr> - <th style="width: 30px;"></th> - <th>Index</th> - <th>Species</th> - <th>Group</th> - <th>Record</th> - <th>Description</th> - <th>Authors</th> - <th>Year</th> - <th style="text-align: right;">Max <br>LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> - <th>Max LRS Location</th> - <th style="text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th style="background-color: #eeeeee;"></th> + <th style="background-color: #eeeeee;">Index</th> + <th style="background-color: #eeeeee;">Species</th> + <th style="background-color: #eeeeee;">Group</th> + <th style="background-color: #eeeeee;">Record</th> + <th style="background-color: #eeeeee;">Description</th> + <th style="background-color: #eeeeee;">Authors</th> + <th style="background-color: #eeeeee;">Year</th> + <th style="background-color: #eeeeee; text-align: right;">Max <br>LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th style="background-color: #eeeeee;">Max LRS Location</th> + <th style="background-color: #eeeeee; text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> </tr> </thead> <tbody> {% for this_trait in trait_list %} <TR id="trait:{{ this_trait.name }}:{{ this_trait.dataset.name }}"> - <TD><INPUT TYPE="checkbox" NAME="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" VALUE="{{ data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name)) }}"></TD> - <TD>{{ loop.index }}</TD> - <TD>{{ this_trait.dataset.group.species }}</TD> - <TD>{{ this_trait.dataset.group.name }}</TD> - <TD><a href="{{ url_for('show_trait_page', trait_id = this_trait.name, dataset = this_trait.dataset.name)}}">{{ this_trait.name }}</a></TD> - <TD>{{ this_trait.description_display }}</TD> - <TD>{{ this_trait.authors }}</TD> - <TD><a href="{{ this_trait.pubmed_link }}">{{ this_trait.pubmed_text }}</a></TD> - <TD>{{ this_trait.LRS_score_repr }}</TD> - <TD>{{ this_trait.LRS_location_repr }}</TD> - <TD>{{ '%0.3f' % this_trait.additive|float }}</TD> + <td><INPUT TYPE="checkbox" NAME="searchResult" class="checkbox trait_checkbox" style="transform: scale(1.5);" VALUE="{{ data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name)) }}"></td> + <td>{{ loop.index }}</td> + <td>{{ this_trait.dataset.group.species }}</td> + <td>{{ this_trait.dataset.group.name }}</td> + <td><a href="{{ url_for('show_trait_page', trait_id = this_trait.name, dataset = this_trait.dataset.name)}}">{{ this_trait.name }}</a></td> + <td>{{ this_trait.description_display }}</td> + <td>{{ this_trait.authors }}</td> + <td><a href="{{ this_trait.pubmed_link }}">{{ this_trait.pubmed_text }}</a></td> + <td align="right">{% if this_trait.LRS_score_repr != "N/A" %}{{ '%0.1f' % this_trait.LRS_score_repr|float }}{% else %}N/A{% endif %}</td> + <td align="right">{{ this_trait.LRS_location_repr }}</td> + <td align="right">{% if this_trait.additive != "" %}{{ this_trait.additive }}{% else %}N/A{% endif %}</td> </TR> {% endfor %} </tbody> + <tfoot> + <tr> + <th style="background-color: #eeeeee;"></th> + <th style="background-color: #eeeeee;">Index</th> + <th style="background-color: #eeeeee;">Species</th> + <th style="background-color: #eeeeee;">Group</th> + <th style="background-color: #eeeeee;">Record</th> + <th style="background-color: #eeeeee;">Description</th> + <th style="background-color: #eeeeee;">Authors</th> + <th style="background-color: #eeeeee;">Year</th> + <th style="background-color: #eeeeee; text-align: right;">Max <br>LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th style="background-color: #eeeeee;">Max LRS Location</th> + <th style="background-color: #eeeeee; text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + </tr> + </tfoot> </table> + </div> </div> </div> @@ -70,6 +87,10 @@ <script language="javascript" 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="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script> + <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.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/new/packages/DataTables/extensions/dataTables.colReorder.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/extensions/dataTables.colResize.js"></script> @@ -123,29 +144,37 @@ console.time("Creating table"); $('#trait_table').DataTable( { + "paging": false, + "buttons": [ + { + extend: 'csvHtml5', + text: 'Download CSV', + title: 'search_results', + fieldBoundary: '"', + exportOptions: { + columns: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + } + } + ], "columns": [ - { "bSortClasses": false }, - { "type": "natural" }, - { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, - { "type": "natural", "width": "20%"}, { "type": "natural" }, { "type": "natural" }, { "type": "natural" }, + { "type": "natural", "width": "30%"}, + { "type": "natural", "width": "25%"}, { "type": "natural" }, + { "type": "natural", "width": "8%"}, + { "type": "natural", "width": "12%"}, { "type": "natural" } ], - "order": [[ 1, "asc" ]], - "sDom": "RZtir", + "order": [[1, "asc" ]], + "sDom": "Btir", "autoWidth": false, - "bLengthChange": true, "bDeferRender": true, - "scrollCollapse": false, - "colResize": { - "tableWidthFixed": false, - }, - "paging": false + "scrollY": "800px", + "scrollCollapse": false } ); console.timeEnd("Creating table"); }); |