diff options
author | hakangunturkun | 2020-03-04 12:02:15 -0600 |
---|---|---|
committer | hakangunturkun | 2020-03-04 12:02:15 -0600 |
commit | cea42615bd0c0c02bad574db42fc7c44c5ca5c66 (patch) | |
tree | d654a9cc3bb21c2dae3e6fc800de53a0118ff942 /templates | |
parent | afa556f338cb8a250fd00b78e8ef8039b9074382 (diff) | |
download | genecup-cea42615bd0c0c02bad574db42fc7c44c5ca5c66.tar.gz |
fix 0 hit history view
Diffstat (limited to 'templates')
-rw-r--r-- | templates/tableview.html | 106 | ||||
-rw-r--r-- | templates/tableview0.html | 17 |
2 files changed, 65 insertions, 58 deletions
diff --git a/templates/tableview.html b/templates/tableview.html index d60f435..15b39ca 100644 --- a/templates/tableview.html +++ b/templates/tableview.html @@ -4,12 +4,18 @@ <script src="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.6.0/cytoscape.min.js" integrity="sha256-uZV2wRlscgr52q3Wb3Oew0rKCPsM3g4aBTv46sF4qzg=" crossorigin="anonymous"></script> <head> {%if num_gene==1%} - <h2> <b>GENE(S): {{gene_name}}</b> </h2> + <h2> <b>GENE: {{gene_name}}</b> </h2> + {%if nodata_temp==1%} + <b>No result was found.</b> + {%endif%} {%else%} <h2> <b>GENES: {{gene_name}}</b> </h2> + {%if nodata_temp==1%} + <b>No result was found.</b> + {%endif%} {%endif%} </head> - +{%if nodata_temp!=1%} <style> * { box-sizing: border-box; @@ -53,54 +59,54 @@ {{ message3 |safe}} </div> </div> - -<script>{ - {} - var table = document.getElementById("myTable"); - var header = table.createTHead(); - var row = header.insertRow(0); - var cell = row.insertCell(0); - cell.innerHTML = "<b>Gene</b>"; - var cell = row.insertCell(1); - cell.innerHTML = "<b>Abstract Count</b>"; - var cell = row.insertCell(2); - cell.innerHTML = "<b>Keyword</b>"; - var cell = row.insertCell(3); - cell.innerHTML = "<b>Category</b>"; - - {%for p in jedges['data']%} - var x=document.getElementById('myTable').insertRow(1); - source = '{{p['source']}}'; - target = '{{p['target']}}'; - var y= x.insertCell(0); - {%for p1 in jnodes['data']%} - {%if p['target'] == p1['id']%} - color='{{p1['nodecolor']}}' - type='{{p1['nodetype']}}' + <script>{ + {} + var table = document.getElementById("myTable"); + var header = table.createTHead(); + var row = header.insertRow(0); + var cell = row.insertCell(0); + cell.innerHTML = "<b>Gene</b>"; + var cell = row.insertCell(1); + cell.innerHTML = "<b>Abstract Count</b>"; + var cell = row.insertCell(2); + cell.innerHTML = "<b>Keyword</b>"; + var cell = row.insertCell(3); + cell.innerHTML = "<b>Category</b>"; + + {%for p in jedges['data']%} + var x=document.getElementById('myTable').insertRow(1); + source = '{{p['source']}}'; + target = '{{p['target']}}'; + var y= x.insertCell(0); + {%for p1 in jnodes['data']%} + {%if p['target'] == p1['id']%} + color='{{p1['nodecolor']}}' + type='{{p1['nodetype']}}' + {%endif%} + {%endfor%} + {%if 'GWAS' in p['target']%} + color="#AEB6BF" + type='GWAS' + key_gwas = target.replace("_GWAS","") + this_url1 = 'sentences?edgeID=gwas_addiction.tab|'+source+'|'+target; + this_url2 = 'https://www.ebi.ac.uk/gwas/search?query='+key_gwas; + {%else%} + this_url1 = 'sentences?edgeID='+'{{session_path}}'+'_snt|'+source+'|'+target; + this_url2 = 'shownode?nodetype='+type+'&node='+target; {%endif%} - {%endfor%} - {%if 'GWAS' in p['target']%} - color="#AEB6BF" - type='GWAS' - key_gwas = target.replace("_GWAS","") - this_url1 = 'sentences?edgeID=gwas_addiction.tab|'+source+'|'+target; - this_url2 = 'https://www.ebi.ac.uk/gwas/search?query='+key_gwas; - {%else%} - this_url1 = 'sentences?edgeID='+'{{session_path}}'+'_snt|'+source+'|'+target; - this_url2 = 'shownode?nodetype='+type+'&node='+target; - {%endif%} - genegene_url = '/startGeneGene?forTopGene='+source; - y.innerHTML="<a href='"+genegene_url+"'>{{p['source']}}</a>"; - y= x.insertCell(1); - y.innerHTML="<center> <a href='"+this_url1+"'> {{p['sentCnt']}}</a> </center>"; - y= x.insertCell(2); - y.innerHTML="<a href='"+this_url2+"'>{{p['target']}}</a>"; - y= x.insertCell(3); - y.innerHTML=type; - {% endfor %} -} -</script> - -<a href="/tableview0">Check</a> for searches that has <b>zero</b> abstract counts. + genegene_url = '/startGeneGene?forTopGene='+source; + y.innerHTML="<a href='"+genegene_url+"'>{{p['source']}}</a>"; + y= x.insertCell(1); + y.innerHTML="<center> <a href='"+this_url1+"'> {{p['sentCnt']}}</a> </center>"; + y= x.insertCell(2); + y.innerHTML="<a href='"+this_url2+"'>{{p['target']}}</a>"; + y= x.insertCell(3); + y.innerHTML=type; + {% endfor %} + } + </script> +{%endif%} +<br> +<a href="/tableview0">Review</a> searches that have <b>zero</b> abstract counts. {%endblock%} diff --git a/templates/tableview0.html b/templates/tableview0.html index c0299ce..a81f412 100644 --- a/templates/tableview0.html +++ b/templates/tableview0.html @@ -2,14 +2,14 @@ {% block content %} <script src="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.6.0/cytoscape.min.js" integrity="sha256-uZV2wRlscgr52q3Wb3Oew0rKCPsM3g4aBTv46sF4qzg=" crossorigin="anonymous"></script> + <head> {%if num_gene==1%} - <h2> <b>GENE(S): {{gene_name}}</b> </h2> + <h2> <b>GENE: {{gene_name}}</b> </h2> {%else%} <h2> <b>GENES: {{gene_name}}</b> </h2> {%endif%} </head> - <style> * { box-sizing: border-box; @@ -70,12 +70,13 @@ var x=document.getElementById('myTable').insertRow(1); control=0; - {%for p1 in jedges['data']%} - {%if p1['target'] == p['id']%} - control=1 - {%endif%} - {%endfor%} - + {%if nodata_temp!=1%} + {%for p1 in jedges['data']%} + {%if p1['target'] == p['id']%} + control=1 + {%endif%} + {%endfor%} + {%endif%} if(control !=1){ y= x.insertCell(0); y.innerHTML='{{p['id']}}'; |