aboutsummaryrefslogtreecommitdiff
path: root/qc_app/templates/samples/upload-samples.html
blob: d04df61e046567afb1ca85e2e9800479aad2e89e (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
{%extends "base.html"%}
{%from "flash_messages.html" import flash_messages%}

{%block title%}Upload Samples{%endblock%}

{%block css%}
<style type="text/css">
  #form-samples {
      background-color: #D1D1D1;
  }
  #form-samples fieldset:nth-child(odd){
      background-color: white;
  }
</style>
{%endblock%}

{%block contents%}
<h1 class="heading">upload samples</h1>

{{flash_messages("alert-success")}}

<p>You can now upload a character-separated value (CSV) file that contains
    details about your samples. The CSV file should have the following fields:
    <dl>
      <dt>Name</dt>
      <dd>The primary name for the sample</dd>

      <dt>Name2</dt>
      <dd>A secondary name for the sample. This can simply be the same as
	<strong>Name</strong> above. This field <strong>MUST</strong> contain a
	value.</dd>

      <dt>Symbol</dt>
      <dd>A symbol for the sample. Can be an empty field.</dd>

      <dt>Alias</dt>
      <dd>An alias for the sample. Can be an empty field.</dd>
    </dl>
  </p>

<form id="form-samples"
      method="POST"
      action="{{url_for('samples.upload_samples',
              species_id=species.SpeciesId,
              population_id=population.InbredSetId)}}"
      enctype="multipart/form-data">
  <legend class="heading">upload samples</legend>
  <fieldset>
    <input type="hidden" name="species_id" value="{{species.SpeciesId}}" />
    <label class="form-col-1">species:</label>
    <span class="form-col-2">{{species.SpeciesName}} [{{species.MenuName}}]</span>
  </fieldset>

  <fieldset>
    <input type="hidden" name="inbredset_id" value="{{population.InbredSetId}}" />
    <label class="form-col-1">grouping/population:</label>
    <span class="form-col-2">{{population.Name}} [{{population.FullName}}]</span>
  </fieldset>

  <fieldset>
    <input id="chk:heading"
	   type="checkbox"
	   name="first_line_heading"
	   class="form-col-1" />
    <label for="chk:heading" class="form-col-2">first line is a heading?</label>
  </fieldset>

  <fieldset>
    <label for="select:separator" class="form-col-1">field separator</label>
    <select id="select:separator"
	    name="separator"
	    required="required"
	    class="form-col-2">
      <option value="">Select separator for your file: (default is comma)</option>
      <option value="&#x0009;">TAB</option>
      <option value="&#x0020;">Space</option>
      <option value=",">Comma</option>
      <option value=";">Semicolon</option>
      <option value="other">Other</option>
    </select>
    <input id="txt:separator"
	   type="text"
	   name="other_separator"
	   class="form-col-2" />
    <span class="form-col-2">
      This is the character that separates the fields in your CSV file. If you
      select "<strong>Other</strong>", then you must provide the separator in
      the text field provided.
    </span>
  </fieldset>

  <fieldset>
    <label for="txt:delimiter" class="form-col-1">field delimiter</label>
    <input id="txt:delimiter"
	   type="text"
	   name="field_delimiter"
	   maxlength="1"
	   class="form-col-2" />
    <span class="form-col-2">
      If there is a character delimiting the string texts within particular
      fields in your CSV, provide the character here. This can be left blank if
      no such delimiters exist in your file.
    </span>
  </fieldset>

  <fieldset>
    <label for="file:samples" class="form-col-1">select file</label>
    <input type="file" name="samples_file" id="file:samples"
	   accept="text/csv, text/tab-separated-values"
	   class="form-col-2" />
  </fieldset>

  <fieldset>
    <input type="submit"
	   value="upload samples file"
	   class="btn btn-main form-col-2" />
  </fieldset>
</form>

<table id="tbl:samples-preview">
  <caption class="heading">preview content</caption>

  <thead>
    <tr>
      <th>Name</th>
      <th>Name2</th>
      <th>Symbol</th>
      <th>Alias</th>
    </tr>
  </thead>

  <tbody>
    <tr id="default-row">
      <td colspan="4">
	Please make some selections to preview the data.</td>
    </tr>
  </tbody>
</table>

{%endblock%}


{%block javascript%}
<script src="/static/js/upload_samples.js" type="text/javascript"></script>
{%endblock%}