diff options
Diffstat (limited to 'wqflask/wqflask/templates/gsearch_pheno.html')
-rwxr-xr-x | wqflask/wqflask/templates/gsearch_pheno.html | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html new file mode 100755 index 00000000..f6b6efa3 --- /dev/null +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -0,0 +1,149 @@ +{% 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" /> + <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 %} +{% 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="trait_table"> + <thead> + <tr> + <th>Index</th> + <th>Species</th> + <th>Group</th> + <th>Record ID</th> + <th>Phenotype</th> + <th>Authors</th> + <th>Year</th> + <th>Max LRS</th> + <th>Locus</th> + <th>Additive</th> + </tr> + </thead> + + <tbody> + {% for this_trait in results %} + <TR> + <td><input type="checkbox">{{ loop.index }}</td> + {% for item in this_trait %} + <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/new/packages/DataTables/extensions/dataTables.colResize.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.fixedHeader.js"></script> + <script language="javascript" type="text/javascript" src="//cdn.datatables.net/fixedcolumns/3.0.4/js/dataTables.fixedColumns.min.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()); + } + } + else if (isNaN(x)) { + return x; + } + return parseFloat(x); + } + + jQuery.fn.dataTableExt.oSort['cust-txt-asc'] = function (a, b) { + var x = getValue(a); + var y = getValue(b); + + if (x == 'N/A' || x == '') { + return 1; + } + else if (y == 'N/A' || y == '') { + return -1; + } + else { + 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 () { + + $('#trait_table tr').click(function(event) { + if (event.target.type !== 'checkbox') { + $(':checkbox', this).trigger('click'); + } + }); + + console.time("Creating table"); + $('#trait_table').DataTable( { + "columns": [ + { "type": "natural" }, + { "type": "natural" }, + { "type": "natural" }, + { "type": "natural" }, + { "type": "natural" }, + { "type": "natural" }, + { "type": "natural" }, + { "type": "natural" }, + { "type": "natural" }, + { "type": "natural" } + ], + "sDom": "RJtir", + "iDisplayLength": -1, + "autoWidth": true, + "bLengthChange": true, + "bDeferRender": true, + "bSortClasses": false, + "scrollY": "700px", + "scrollCollapse": false, + "colResize": { + "tableWidthFixed": false, + }, + "paging": false + } ); + console.timeEnd("Creating table"); + }); + + </script> +{% endblock %} |