diff options
author | zsloan | 2020-10-01 12:52:30 -0500 |
---|---|---|
committer | zsloan | 2020-10-01 12:52:30 -0500 |
commit | 832ebc46a0e7a6f7c3faef5eb36f1104a66fd626 (patch) | |
tree | 08050a3761191935b5111bd97f935cd0af0d5ae7 /wqflask | |
parent | 8a01dca227aa03e794ced5f99513355f2a035f2f (diff) | |
parent | 5a91ed3bce93934a224d8fbbb7053a1980dd216c (diff) | |
download | genenetwork2-832ebc46a0e7a6f7c3faef5eb36f1104a66fd626.tar.gz |
Merge branch 'testing' of github.com:genenetwork/genenetwork2 into corr_matrix_error_fix
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/static/new/css/show_trait.css | 5 | ||||
-rw-r--r-- | wqflask/wqflask/static/new/javascript/search_results.js | 14 | ||||
-rw-r--r-- | wqflask/wqflask/templates/base.html | 8 | ||||
-rw-r--r-- | wqflask/wqflask/templates/collections/add.html | 2 | ||||
-rw-r--r-- | wqflask/wqflask/templates/collections/view.html | 26 | ||||
-rw-r--r-- | wqflask/wqflask/templates/correlation_page.html | 20 | ||||
-rw-r--r-- | wqflask/wqflask/templates/search_result_page.html | 29 | ||||
-rw-r--r-- | wqflask/wqflask/templates/show_trait_details.html | 32 | ||||
-rw-r--r-- | wqflask/wqflask/templates/show_trait_edit_data.html | 2 | ||||
-rw-r--r-- | wqflask/wqflask/templates/show_trait_statistics.html | 4 |
10 files changed, 71 insertions, 71 deletions
diff --git a/wqflask/wqflask/static/new/css/show_trait.css b/wqflask/wqflask/static/new/css/show_trait.css index 338302af..92deab20 100644 --- a/wqflask/wqflask/static/new/css/show_trait.css +++ b/wqflask/wqflask/static/new/css/show_trait.css @@ -46,4 +46,9 @@ table.dataTable.cell-border tbody th, table.dataTable.cell-border tbody td { table.dataTable.cell-border tbody tr th:first-child, table.dataTable.cell-border tbody tr td:first-child { border-left: 1px solid #ccc; +} + +.glyphicon { + position: relative; + top: 2px; }
\ No newline at end of file diff --git a/wqflask/wqflask/static/new/javascript/search_results.js b/wqflask/wqflask/static/new/javascript/search_results.js index 685d6291..86660126 100644 --- a/wqflask/wqflask/static/new/javascript/search_results.js +++ b/wqflask/wqflask/static/new/javascript/search_results.js @@ -93,7 +93,7 @@ $(function() { }); - add = function() { + add_to_collection = function() { var traits; traits = $("#trait_table input:checked").map(function() { return $(this).val(); @@ -250,7 +250,7 @@ $(function() { $("#select_all").click(select_all); $("#deselect_all").click(deselect_all); $("#invert").click(invert); - $("#add").click(add); + $("#add").click(add_to_collection); $("#submit_bnw").click(submit_bnw); $("#export_traits").click(export_traits); $('.trait_checkbox, .btn').click(change_buttons); @@ -261,6 +261,12 @@ $(function() { let na_equivalent_vals = ["N/A", "--", ""]; //ZS: Since there are multiple values that should be treated the same as N/A + function extract_inner_text(the_string){ + var span = document.createElement('span'); + span.innerHTML = the_string; + return span.textContent || span.innerText; + } + function sort_NAs(a, b, sort_function){ if ( na_equivalent_vals.includes(a) && na_equivalent_vals.includes(b)) { return 0; @@ -276,10 +282,10 @@ $(function() { $.extend( $.fn.dataTableExt.oSort, { "natural-minus-na-asc": function (a, b) { - return sort_NAs(a, b, naturalAsc) + return sort_NAs(extract_inner_text(a), extract_inner_text(b), naturalAsc) }, "natural-minus-na-desc": function (a, b) { - return sort_NAs(a, b, naturalDesc) + return sort_NAs(extract_inner_text(a), extract_inner_text(b), naturalDesc) } }); diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index e6802cc4..b44538cf 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -21,6 +21,14 @@ {% block css %} {% endblock %} + <style> + table.dataTable thead .sorting_asc { + background-image: url({{ url_for("js", filename="DataTables/images/sort_asc_disabled.png") }}); + } + table.dataTable thead .sorting_desc { + background-image: url({{ url_for("js", filename="DataTables/images/sort_desc_disabled.png") }}); + } + </style> </head> <body style="width: 100%"> diff --git a/wqflask/wqflask/templates/collections/add.html b/wqflask/wqflask/templates/collections/add.html index 825dfb84..62b6abb5 100644 --- a/wqflask/wqflask/templates/collections/add.html +++ b/wqflask/wqflask/templates/collections/add.html @@ -5,7 +5,7 @@ or add to an existing collection.</p> </div> <div class="modal-body" style="margin-left: 20px;"> - <form action="/collections/new" data-validate="parsley" id="add_form"> + <form action="/collections/new" target="_blank" data-validate="parsley" id="add_form"> {% if traits is defined %} <input type="hidden" name="traits" value="{{ traits }}" /> {% else %} diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html index dce814dd..bc487a59 100644 --- a/wqflask/wqflask/templates/collections/view.html +++ b/wqflask/wqflask/templates/collections/view.html @@ -16,8 +16,6 @@ </h1> <h3>This collection has {{ '{}'.format(numify(trait_obs|count, "record", "records")) }}</h3> - <!--<hr style="height: 1px; background-color: #A9A9A9;">--> - <div> <form id="collection_form" action="/delete" method="post"> <input type="hidden" name="uc_id" id="uc_id" value="{{ uc.id }}" /> @@ -77,7 +75,7 @@ <input type="hidden" name="database_name" id="database_name" value="None"> <input type="hidden" name="export_data" id="export_data" value=""> <input type="hidden" name="file_name" id="file_name" value="collection_table"> - <button class="btn btn-default" id="export_traits">Download CSV</button> + <button class="btn btn-default" id="export_traits">Download</button> <input type="text" id="searchbox" class="form-control" style="width: 200px; display: inline; padding-bottom: 9px;" placeholder="Search Table For ..."> <input type="text" id="select_top" class="form-control" style="width: 200px; display: inline; padding-bottom: 9px;" placeholder="Select Top ..."> <button class="btn btn-default" id="deselect_all" type="button"><span class="glyphicon glyphicon-remove"></span> Deselect</button> @@ -99,9 +97,9 @@ <th data-export="Description">Description</th> <th data-export="Location">Location</th> <th data-export="Mean">Mean</th> - <th data-export="Max LRS">Max LRS <a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup>?</sup></a></th> - <th data-export="Max LRS Location">Max LRS Location</th> - <th data-export="Add. Eff.">Additive Effect <a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup>?</sup></a></th> + <th data-export="Max LRS">Max LRS <a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="font-size: small; color: #FF0000;"> ?</sup></a></th> + <th data-export="Peak Location">Peak Location</th> + <th data-export="Add. Eff.">Effect Size <a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="font-size: small; color: #FF0000;"> ?</sup></a></th> </tr> </thead> @@ -144,7 +142,7 @@ <TD data-export="{{ this_trait.LRS_score_repr }}" align="right">N/A</TD> {% endif %} <TD data-export="{{ this_trait.LRS_location_repr }}">{{ this_trait.LRS_location_repr }}</TD> - {% if this_trait.additive|float > 0 %} + {% if this_trait.additive|float != 0 %} <TD data-export="{{ this_trait.additive }}" align="right">{{ '%0.3f' % this_trait.additive|float }}</TD> {% else %} <TD data-export="{{ this_trait.additive }}" align="right">N/A</TD> @@ -166,13 +164,13 @@ {% block js %} <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='js_alt/md5.min.js') }}"></script> - <script type="text/javascript" src="/static/new/javascript/search_results.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='DataTablesExtensions/plugins/sorting/natural.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="{{ url_for('js', filename='DataTablesExtensions/colReorder/js/dataTables.colReorder.js') }}"></script> <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/buttons/js/dataTables.buttons.min.js') }}"></script> <script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/buttons/js/buttons.colVis.min.js') }}"></script> + <script type="text/javascript" src="/static/new/javascript/search_results.js"></script> <script language="javascript" type="text/javascript"> @@ -187,10 +185,14 @@ console.time("Creating table"); $('#trait_table').dataTable( { "columns": [ - { "type": "natural", "width": 10 }, + { + "orderDataType": "dom-checkbox", + "orderSequence": [ "desc", "asc"], + "width": 10 + }, { "type": "natural", "width": 50 }, { "type": "natural" }, - { "type": "natural", "width": 120 }, + { 'type': "natural-minus-na", "width": 120 }, { "type": "natural" }, { "type": "natural" }, { "type": "natural", "width": 130 }, @@ -199,10 +201,6 @@ { "type": "natural", "width": 130 }, { "type": "natural" } ], - "columnDefs": [ { - "targets": 0, - "orderable": false - } ], "order": [[1, "asc" ]], buttons: [ { diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html index e597bea9..bb2a697f 100644 --- a/wqflask/wqflask/templates/correlation_page.html +++ b/wqflask/wqflask/templates/correlation_page.html @@ -175,9 +175,13 @@ <TD data-export="N/A">N/A</TD> {% endif %} <td data-export="{{ trait.pubmed_text }}"> + {% if trait.pubmed_text != "N/A" %} <a href="{{ trait.pubmed_link }}"> {{ trait.pubmed_text }} </a> + {% else %} + {{ trait.pubmed_text }} + {% endif %} </td> <td data-export="{{ '%0.3f'|format(trait.sample_r) }}" align="right"><a target="_blank" href="corr_scatter_plot?dataset_1={{dataset.name}}&dataset_2={{trait.dataset.name}}&trait_1={{this_trait.name}}&trait_2={{trait.name}}">{{ '%0.3f'|format(trait.sample_r) }}</a></td> <td data-export="{{ trait.num_overlap }}" align="right">{{ trait.num_overlap }}</td> @@ -365,9 +369,9 @@ { "type": "numeric-html", 'orderSequence': [ "desc", "asc"] }, { "type": "numeric-html", 'orderSequence': [ "desc", "asc"] }, { "type": "scientific" }, - { "type": "natural" }, - { "type": "natural" }, - { "type": "natural" } + { "type": "natural-minus-na" }, + { "type": "natural-minus-na" }, + { "type": "natural-minus-na" } ], "createdRow": function ( row, data, index ) { $('td', row).eq(4).attr('title', $('td', row).eq(4).text()); @@ -419,13 +423,13 @@ { "type": "natural" }, { "type": "natural", "width": "20%" }, { "type": "natural", "width": "12%" }, - { "orderDataType": "dom-innertext" }, + { "type": "natural-minus-na" }, { "orderDataType": "dom-innertext", 'orderSequence': [ "desc", "asc"] }, { "type": "natural" }, { "type": "scientific" }, - { "type": "natural" }, - { "type": "natural" }, - { "type": "natural" } + { "type": "natural-minus-na" }, + { "type": "natural-minus-na" }, + { "type": "natural-minus-na" } ], "order": [[9, "asc" ]], "sDom": "Btir", @@ -461,7 +465,7 @@ { "type": "natural" }, { "type": "natural" }, { "orderDataType": "dom-innertext", 'orderSequence': [ "desc", "asc"] }, - { "type": "natural" }, + { "type": "natural-minus-na" }, { "type": "scientific" } ], "order": [[6, "asc" ]], diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index 282e752d..e2e1aa46 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -127,7 +127,7 @@ <input type="hidden" name="export_data" id="export_data" value=""> <button class="btn btn-default" id="select_all" type="button"><span class="glyphicon glyphicon-ok"></span> Select</button> <button class="btn btn-success" id="add" type="button" disabled><span class="glyphicon glyphicon-plus-sign"></span> Add</button> - <button class="btn btn-default" id="export_traits">Download CSV</button> + <button class="btn btn-default" id="export_traits">Download <span class="glyphicon glyphicon-download"></span></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 ..."> <button class="btn btn-default" id="deselect_all" type="button"><span class="glyphicon glyphicon-remove"></span> Deselect</button> @@ -274,10 +274,9 @@ }, { 'title': "Record", - 'type': "natural", + 'type': "natural-minus-na", 'data': null, 'width': "60px", - 'orderDataType': "dom-inner-text", 'render': function(data, type, row, meta) { return '<a target="_blank" href="/show_trait?trait_id=' + data.name + '&dataset=' + data.dataset + '">' + data.display_name + '</a>' } @@ -315,20 +314,20 @@ 'orderSequence': [ "desc", "asc"] }, { - 'title': "Max LRS<a href=\"http://genenetwork.org//glossary.html#LRS\" target=\"_blank\" style=\"color: white;\"><sup>?</sup></a>", + 'title': "Max LRS<a href=\"http://genenetwork.org//glossary.html#LRS\" target=\"_blank\" style=\"color: white;\"><sup style=\"font-size: small; color: #FF0000;\"> ?</sup></a>", 'type': "natural-minus-na", 'data': "lrs_score", 'width': "80px", 'orderSequence': [ "desc", "asc"] }, { - 'title': "Max LRS Location", + 'title': "Peak Location", 'type': "natural-minus-na", - 'width': "150px", + 'width': "120px", 'data': "lrs_location" }, { - 'title': "Additive Effect<a href=\"http://genenetwork.org//glossary.html#A\" target=\"_blank\" style=\"color: white;\"><sup>?</sup></a>", + 'title': "Effect Size<a href=\"http://genenetwork.org//glossary.html#A\" target=\"_blank\" style=\"color: white;\"><sup style=\"font-size: small; color: #FF0000;\"> ?</sup></a>", 'type': "natural-minus-na", 'data': "additive", 'width': "120px", @@ -367,17 +366,11 @@ author_string = data.authors } return author_string - // try { - // return decodeURIComponent(escape(author_string)) - // } catch(err){ - // return author_string - // } } }, { 'title': "Year", 'type': "natural-minus-na", - 'orderDataType': "dom-inner-text", 'data': null, 'width': "80px", 'render': function(data, type, row, meta) { @@ -390,20 +383,20 @@ 'orderSequence': [ "desc", "asc"] }, { - 'title': "Max LRS<a href=\"http://genenetwork.org//glossary.html#LRS\" target=\"_blank\" style=\"color: white;\"><sup>?</sup></a>", + 'title': "Max LRS<a href=\"http://genenetwork.org//glossary.html#LRS\" target=\"_blank\" style=\"color: white;\"><sup style=\"font-size: small; color: #FF0000;\"> ?</sup></a>", 'type': "natural-minus-na", 'data': "lrs_score", 'width': "80px", 'orderSequence': [ "desc", "asc"] }, { - 'title': "Max LRS Location", + 'title': "Peak Location", 'type': "natural-minus-na", - 'width': "150px", + 'width': "120px", 'data': "lrs_location" }, { - 'title': "Additive Effect<a href=\"http://genenetwork.org//glossary.html#A\" target=\"_blank\" style=\"color: white;\"><sup>?</sup></a>", + 'title': "Effect Size<a href=\"http://genenetwork.org//glossary.html#A\" target=\"_blank\" style=\"color: white;\"><sup style=\"font-size: small; color: #FF0000;\"> ?</sup></a>", 'type': "natural-minus-na", 'width': "120px", 'data': "additive", @@ -412,7 +405,7 @@ { 'title': "Location", 'type': "natural-minus-na", - 'width': "140px", + 'width': "120px", 'data': "location" }{% endif %} ], diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html index 8b3e4907..4aced50c 100644 --- a/wqflask/wqflask/templates/show_trait_details.html +++ b/wqflask/wqflask/templates/show_trait_details.html @@ -215,43 +215,27 @@ <div style="margin-bottom:15px;" class="btn-toolbar"> <div class="btn-group"> - <a href="#redirect"> - <button type="button" id="add_to_collection" class="btn btn-primary" title="Add to collection">Add</button> - </a> + <button type="button" id="add_to_collection" class="btn btn-success" title="Add to Collection">Add</button> {% if this_trait.dataset.type == 'ProbeSet' or this_trait.dataset.type == 'Geno' %} {% if this_trait.symbol != None %} - <a target="_blank" href="http://gn1.genenetwork.org/webqtl/main.py?cmd=sch&gene={{ this_trait.symbol }}&alias=1&species={{ dataset.group.species }}"> - <button type="button" class="btn btn-default" title="Find similar expression data">Find</button> - </a> + <button type="button" class="btn btn-default" title="Find similar expression data" onclick="window.open('http://gn1.genenetwork.org/webqtl/main.py?cmd=sch&gene={{ this_trait.symbol }}&alias=1&species={{ dataset.group.species }}', '_blank')">Find</button> {% endif %} {% if UCSC_BLAT_URL != "" %} - <a target="_blank" href="{{ UCSC_BLAT_URL }}"> - <button type="button" class="btn btn-default" title="Check probe locations at UCSC">Verify</button> - </a> + <button type="button" class="btn btn-default" title="Check probe locations at UCSC" onclick="window.open('{{ UCSC_BLAT_URL }}', '_blank')">Verify</button> {% endif %} {% if this_trait.symbol != None %} - <a target="_blank" href="http://gn1.genenetwork.org/webqtl/main.py?FormID=geneWiki&symbol={{ this_trait.symbol }}"> - <button type="button" class="btn btn-default" title="Write or review comments about this gene">GeneWiki</button> - </a> + <button type="button" class="btn btn-default" title="Write or review comments about this gene" onclick="window.open('http://gn1.genenetwork.org/webqtl/main.py?FormID=geneWiki&symbol={{ this_trait.symbol }}', '_blank')">GeneWiki</button> {% if dataset.group.species == "mouse" or dataset.group.species == "rat" %} - <a href="/snp_browser?first_run=true&species={{ dataset.group.species }}&gene_name={{ this_trait.symbol }}&limit_strains=on"> - <button type="button" class="btn btn-default" title="View SNPs and Indels">SNPs</button> - </a> + <button type="button" class="btn btn-default" title="View SNPs and Indels" onclick="window.open('/snp_browser?first_run=true&species={{ dataset.group.species }}&gene_name={{ this_trait.symbol }}&limit_strains=on', '_blank')">SNPs</button> {% endif %} {% endif %} {% if show_probes == "True" %} - <a target="_blank" href="http://gn1.genenetwork.org/webqtl/main.py?FormID=showProbeInfo&database={{ this_trait.dataset.name }}&ProbeSetID={{ this_trait.name }}&CellID={{ this_trait.cellid }}&RISet={{ dataset.group.name }}&incparentsf1=ON"> - <button type="button" class="btn btn-default" title="Check sequence of probes">Probes</button> - </a> + <button type="button" class="btn btn-default" title="Check sequence of probes" onclick="window.open('http://gn1.genenetwork.org/webqtl/main.py?FormID=showProbeInfo&database={{ this_trait.dataset.name }}&ProbeSetID={{ this_trait.name }}&CellID={{ this_trait.cellid }}&RISet={{ dataset.group.name }}&incparentsf1=ON', '_blank')">Probes</button> {% endif %} {% endif %} - <a target="_blank" href="http://gn1.genenetwork.org/webqtl/main.py?cmd=show&db={{ this_trait.dataset.name }}&probeset={{ this_trait.name }}"> - <button type="button" id="view_in_gn1" class="btn btn-primary" title="View Trait in GN1">View in GN1</button> - </a> + <button type="button" id="view_in_gn1" class="btn btn-primary" title="View Trait in GN1" onclick="window.open('http://gn1.genenetwork.org/webqtl/main.py?cmd=show&db={{ this_trait.dataset.name }}&probeset={{ this_trait.name }}', '_blank')">Go to GN1</button> {% if admin_status == "owner" or admin_status == "edit-admins" or admin_status == "edit-access" %} - <a target="_blank" href="./resources/manage?resource_id={{ resource_id }}"> - <button type="button" id="edit_resource" class="btn btn-success" title="Edit Resource">Edit</button> - </a> + <button type="button" id="edit_resource" class="btn btn-success" title="Edit Resource" onclick="window.open('./resources/manage?resource_id={{ resource_id }}', '_blank')">Edit</button> {% endif %} </div> </div> diff --git a/wqflask/wqflask/templates/show_trait_edit_data.html b/wqflask/wqflask/templates/show_trait_edit_data.html index 05a2be73..a8ed91b1 100644 --- a/wqflask/wqflask/templates/show_trait_edit_data.html +++ b/wqflask/wqflask/templates/show_trait_edit_data.html @@ -5,7 +5,7 @@ <input type="text" id="{{ sample_type.sample_group_type }}_searchbox" class="form-control" style="width: 200px; display: inline; float: left; vertical-align: top;" placeholder="Search This Table For ..."> </div> <div style="padding-left: 10px; display: inline;"> - <input type="button" class="btn btn-default export" value="Export"> + <button class="btn btn-default export">Export <span class="glyphicon glyphicon-download-alt"></span></button> <select class="select optional span2 export_format"> <option value="excel">Excel</option> <option value="csv">CSV</option> diff --git a/wqflask/wqflask/templates/show_trait_statistics.html b/wqflask/wqflask/templates/show_trait_statistics.html index 974081d3..7bdb3ef9 100644 --- a/wqflask/wqflask/templates/show_trait_statistics.html +++ b/wqflask/wqflask/templates/show_trait_statistics.html @@ -76,11 +76,13 @@ <i class="icon-signal"></i> Sort By Value </button> </div> + <!-- <div class="btn-group"> - <button type="button" class="btn btn-default" id="color_by_trait"> + <button type="button" class="btn btn-default" id="color_by_trait" style="margin-bottom: 5px;"> <i class="icon-tint"></i> Color by Trait </button> </div> + --> <div id="bar_chart_container"> <div id="bar_chart"></div> </div> |