aboutsummaryrefslogtreecommitdiff
path: root/qc_app/templates/select_dataset.html
blob: 5fefccc9c5f3f38b492b835e038d7c57c5fc27bf (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
{%extends "base.html"%}

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

{%block contents%}
<h1 class="heading">{{job_name}}: select dataset</h2>

<form method="POST" data-menu-content="{{menu_contents}}">
  <input type="hidden" name="job_id" value="{{job_id}}" />

  <fieldset>
    <label for="species">species:</label>
    <select id="species" name="species">
      {%for row in species:%}
      <option value="{{row[0]}}"
	      {%if row[0] == default_species:%}
	      selected="selected"
	      {%endif%}>
	{{row[1]}}
      </option>
      {%endfor%}
    </select>
  </fieldset>

  <fieldset>
    <label for="group">group:</label>
    <select id="group" name="group">
      {%for grouping, grps in groups.items():%}
      <optgroup label="{{grouping}}">
	{%for group in grps:%}
	<option value="{{group[0]}}">{{group[1]}}</option>
	{%endfor%}
      </optgroup>
      {%endfor%}
    </select>
  </fieldset>

  <fieldset>
    <label for="type">type:</label>
    <select id="type" name="type">
      {%for grouping, typs in types.items():%}
      <optgroup label="{{grouping}}">
	{%for type in typs:%}
	<option value="{{type[0]}}">{{type[1]}}</option>
	{%endfor%}
      </optgroup>
      {%endfor%}
    </select>
  </fieldset>

  <fieldset>
    <label for="dataset">dataset:</label>
    <select id="dataset" name="dataset">
      {%for dataset_id, name1, name2 in datasets:%}
      <option value="{{dataset_id}}">[{{name1}}] {{name2}}</option>
      {%endfor%}
    </select>
  </fieldset>

  <fieldset>
    <input type="submit" class="btn btn-main" value="update database" />
  </fieldset>

</form>

{%endblock%}

{%block javascript%}
<script type="text/javascript" src="/static/js/dbinsert.js"></script>
<script type="text/javascript">
  document.getElementById("species").addEventListener("change", update_menu);
  document.getElementById("group").addEventListener("change", update_menu);
  document.getElementById("type").addEventListener("change", update_menu);
</script>
{%endblock%}