<!DOCTYPE html>
<title>New Literature Review</title>

{% extends "layout.html" %}
{% block body %}
<html lang="en">
  <body onload="bold_citation({{ ref_count}});">
  	


    <div class="container">
	
      <p><p><h1>There are {{ ref_count }} new references to review</h1>
      <p>
      	
         <input class="btn" type = "submit" onclick="discard_checked_pmids()" value="Discard Selected Papers"\>

      <hr>

      <input type="hidden" id="user" name="variable" value="{{ current_user.name.upper() }}">	  

      {% for row in ref_list %}
      

        

          {% set pmid = row.pubmed_id %}
          
        
          <div id='{{pmid}}'>   <!-- start pubmed section -->
          	
     

       
          <input type="checkbox" value = {{pmid}} name="whole_ref_cb" id={{pmid~"_cb"}} onclick="show_hide_pmid({{pmid}})">
          <span id='citation{{ loop.index }}'> {{ row.citation }}</span> <br>
<ul>
          <!-- need to put this pubmed url in a config file? -->
	  <a href='http://www.ncbi.nlm.nih.gov/pubmed/{{ pmid }}?dopt=Abstract' target='new'><img src='../static/img/pubmedrefsml.gif'></a> 

	  {% if row.fulltext_url %}
	      <a href='{{ row.fulltext_url }}' target=new><img src='../static/img/full_text.gif'></a>	  
      {% endif %}
	      
	  <strong>(PMID: {{ pmid }})</strong><p>
	  	  
          
	  <ul id='abstract{{ loop.index }}'>
	      <li><b>Abstract:</b><br>
	      <ul><div id={{pmid~"_abstract"}}>{{ row.abstract }}</div></ul>
          </li>
	  </ul>
	  
	  	<div id={{pmid~"_whole_form"}}>
	  	
	  	

		<input class="btn" type = "submit" onclick="discard_paper({{pmid}})" value="Discard this paper"\>
	  <br>
	  <br>
	  <div id={{pmid~"_abstract_genes"}}> 
	  		<textarea id={{pmid~"_genes_area"}} rows="1" style="width:100%"></textarea>
	     	<button class="btn btn-mini" onclick="extract_genes({{pmid}})">Auto-extract genes from abstract</button> 
	  <br>
	  <br>
	     	
	     	
	     <!-- Prints client-side form validation errors. -->
          <div id={{pmid~"_validation_error"}} class="alert alert-error" style="display:none;"></div>
          
          
	     </div>
	  <form id={{pmid~"_form"}}><ul>
	  	<input id={{pmid~'_high_priority_cb'}} name={{pmid~'_high_priority_cb'}} onclick="show_hide_comment('{{pmid~'_high_priority'}}')" type="checkbox"> High Priority
		<ul><div id={{pmid~'_high_priority_block'}} style="display:none;">
			<label style="float:left">Comment:</label>
			<textarea id={{pmid~'_high_priority_comment'}} name={{pmid~'_high_priority_comment'}} style="width:100%" rows="1"></textarea><br>
	    </div></ul>
	     
	    <input id={{pmid~'_delay_cb'}} name={{pmid~'_delay_cb'}} onclick="show_hide_comment('{{pmid~'_delay'}}')" type="checkbox"> Delay
		<ul><div id={{pmid~'_delay_block'}} style="display:none;">
			<label style="float:left">Comment:</label>
			<textarea id={{pmid~'_delay_comment'}} name={{pmid~'_delay_comment'}} style="width:100%" rows="1"></textarea><br>
	    </div></ul>
	    
	    <input id={{pmid~'_htp_cb'}} name={{pmid~'_htp_cb'}} onclick="show_hide_comment('{{pmid~'_htp'}}')" type="checkbox"> HTP Phenotype Data <span class="muted">(Omics)</span> <br>
		<ul><div id={{pmid~'_htp_block'}} style="display:none;">
			<label style="float:left">Comment:</label>
			<textarea id={{pmid~'_htp_comment'}} name={{pmid~'_htp_comment'}} style="width:100%" rows="1"></textarea><br>
	    </div></ul>
	    
	    <input id={{pmid~'_other_cb'}} name={{pmid~'_other_cb'}} onclick="show_hide_comment('{{pmid~'_other'}}')" type="checkbox"> Other HTP Data <span class="muted">(Omics)</span> <br>
		<ul><div id={{pmid~'_other_block'}} style="display:none;">
			<label style="float:left">Comment:</label>
			<textarea id={{pmid~'_other_comment'}} name={{pmid~'_other_comment'}} style="width:100%" rows="1"></textarea><br>
	    </div></ul>
	    
	    <input id={{pmid~'_go_cb'}} name={{pmid~'_go_cb'}} onclick="show_hide_comment('{{pmid~'_go'}}')" type="checkbox"> GO Information <span class="muted">(Primary Literature)</span> <br>
		<ul><div id={{pmid~'_go_block'}} style="display:none;">
			<span style="float:left; color:red">*</span>
			<label style="float:left">Genes:</label>
			<textarea id={{pmid~'_go_genes'}} name={{pmid~'_go_genes'}} style="float:left; width:40%" rows="1"></textarea>
			<label style="float:left">Comment:</label>
			<textarea id={{pmid~'_go_comment'}} name={{pmid~'_go_comment'}} style="width:40%" rows="1"></textarea><br>
	    </div></ul>
	    
	    <input id={{pmid~'_phenotype_cb'}} name={{pmid~'_phenotype_cb'}} onclick="show_hide_comment('{{pmid~'_phenotype'}}')" type="checkbox"> Classical Phenotype Information <span class="muted">(Primary Literature)</span> <br>
		<ul><div id={{pmid~'_phenotype_block'}} style="display:none;">
			<span style="float:left; color:red">*</span>
			<label style="float:left">Genes:</label>
			<textarea id={{pmid~'_phenotype_genes'}} name={{pmid~'_phenotype_genes'}} style="float:left; width:40%" rows="1"></textarea>
			<label style="float:left">Comment:</label>
			<textarea id={{pmid~'_phenotype_comment'}} name={{pmid~'_phenotype_comment'}} style="width:40%" rows="1"></textarea><br>
	    </div></ul>
	    
	    <input id={{pmid~'_headline_cb'}} name={{pmid~'_headline_cb'}} onclick="show_hide_comment('{{pmid~'_headline'}}')" type="checkbox"> Headline Information <span class="muted">(Primary Literature)</span> <br>
		<ul><div id={{pmid~'_headline_block'}} style="display:none;">
			<span style="float:left; color:red">*</span>
			<label style="float:left">Genes:</label>
			<textarea id={{pmid~'_headline_genes'}} name={{pmid~'_headline_genes'}} style="float:left; width:40%" rows="1"></textarea>
			<label style="float:left">Comment:</label>
			<textarea id={{pmid~'_headline_comment'}} name={{pmid~'_headline_comment'}} style="width:40%" rows="1"></textarea><br>
	    </div></ul>
	    
	    <input id={{pmid~'_primary_cb'}} name={{pmid~'_primary_cb'}} onclick="show_hide_comment('{{pmid~'_primary'}}')" type="checkbox"> Other Primary Information <span class="muted">(Primary Literature)</span> <br>
		<ul><div id={{pmid~'_primary_block'}} style="display:none;">
			<span style="float:left; color:red">*</span>
			<label style="float:left">Genes:</label>
			<textarea id={{pmid~'_primary_genes'}} name={{pmid~'_primary_genes'}} style="width:100%" rows="1"></textarea>
	    </div></ul>
	    
	    <input id={{pmid~'_review_cb'}} name={{pmid~'_review_cb'}} onclick="show_hide_comment('{{pmid~'_review'}}')" type="checkbox"> Review <span class="muted">(Reviews)</span> <br>
		<ul><div id={{pmid~'_review_block'}} style="display:none;">
			<label style="float:left">Genes:</label>
			<textarea id={{pmid~'_review_genes'}} name={{pmid~'_review_genes'}} style="width:100%" rows="1"></textarea>
	    </div></ul>
	    
	    <input id={{pmid~'_additional_cb'}} name={{pmid~'_additional_cb'}} onclick="show_hide_comment('{{pmid~'_additional'}}')" type="checkbox"> Additional Literature <span class="muted">(Additional Literature)</span> <br>
		<ul><div id={{pmid~'_additional_block'}} style="display:none;">
			<span style="float:left; color:red">*</span>
			<label style="float:left">Genes:</label>
			<textarea id={{pmid~'_additional_genes'}} name={{pmid~'_additional_genes'}} style="width:100%" rows="1"></textarea>
	    </div></ul>
	
   
	  </ul>
	</form>
	
		<input class="btn" type = "submit" onclick="validate({{pmid}})" value="Add to Database"\>

	</div>
	  </ul></div>  <!-- end of a pubmed section -->

	  <hr>


      {% endfor %}
      
      <input class="btn" type = "submit" onclick="discard_checked_pmids()" value="Discard Selected Papers"\>

           
      
    </div> <!-- /container -->

    <script src="../static/js/local.js"></script> 

    <script>
	for (var i = 1; i <= {{ ref_count }}; i++) {
	// id = 'abstract1', 'abstract2', ...
		activateCollapsible('abstract'+i);

	 }
     
     

       
   </script>
   
    {% for row in ref_list %}
          {% set pmid = row.pubmed_id %}
          <script>
          	var abs_string = {{pmid}} + "_abstract";
     		var element = document.getElementById(abs_string);
	 		highlightSearchTerms('yeast cerevisiae', element);
	 	</script>
    {% endfor %}
   
          
  </body>
</html>
{% endblock body %}
