aboutsummaryrefslogtreecommitdiff
path: root/qc_app/templates/select_platform.html
blob: d69a970abd1cbbfc6b93bfdc24d83af1edb16c59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{%extends "base.html"%}

{%block title%}Select Dataset{%endblock%}

{%block contents%}
<h2 class="heading">{{filename}}: select platform</h2>

<form method="POST" action="{{url_for('dbinsert.select_study')}}"
      id="select-platform-form" data-genechips="{{genechips_data}}">
  <input type="hidden" name="filename" value="{{filename}}" />
  <input type="hidden" name="filetype" value="{{filetype}}" />
  <input type="hidden" name="totallines" value="{{totallines}}" />

  <fieldset>
    <label for="species" class="form-col-1">species</label>
    <select id="species" name="species" class="form-col-2">
      {%for row in species:%}
      <option value="{{row['SpeciesId']}}"
	      {%if row["Name"] == default_species:%}
	      selected="selected"
	      {%endif%}>
	{{row["MenuName"]}}
      </option>
      {%endfor%}
    </select>
  </fieldset>

  <table id="genechips-table">
    <thead>
      <tr>
	<th>Select</th>
	<th>GeneChip ID</th>
	<th>GeneChip Name</th>
      </tr>
    </thead>

    <tbody>
      {%for chip in genechips:%}
      <tr>
	<td>
	  <input type="radio" name="genechipid" value="{{chip['GeneChipId']}}"
		 required="required" />
	</td>
	<td>{{chip["GeneChipId"]}}</td>
	<td>{{chip["GeneChipName"]}}</td>
      </tr>
      {%else%}
      <tr>
	<td colspan="5">No chips found for selected species</td>
      </tr>
      {%endfor%}
    </tbody>
  </table>

  <fieldset>
    <input type="submit" class="btn btn-primary form-col-2"
	   value="submit platform" />
  </fieldset>
</form>
{%endblock%}

{%block javascript%}
<script type="text/javascript" src="/static/js/utils.js"></script>
<script type="text/javascript" src="/static/js/select_platform.js"></script>
<script type="text/javascript">
  document.getElementById(
      "species").addEventListener("change", update_genechips);
  document.getElementById(
      "genechips-table").getElementsByTagName(
	  "tbody")[0].addEventListener(
	      "click",
	      function(event) {
		  if(event.target.tagName.toLowerCase() == "td") {
		      return select_row_radio(event.target.parentElement);
		  }
		  if(event.target.tagName.toLowerCase() == "td") {
		      return select_row_radio(event.target);
		  }
		  return false;
	      });
</script>
{%endblock%}