aboutsummaryrefslogtreecommitdiff
path: root/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html
blob: fc87d5bc8f67ef199f0cd42042d00db6ca8e97af (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
{%extends "base.html"%}
{%from "flash_messages.html" import flash_all_messages%}
{%from "upload_progress_indicator.html" import upload_progress_indicator%}

{%block title%}Upload R/qtl2 Bundle{%endblock%}

{%block contents%}
{{upload_progress_indicator()}}

<h2 class="heading">Upload R/qtl2 Bundle</h2>

<form id="frm-upload-rqtl2-bundle"
      action="{{url_for('upload.rqtl2.upload_rqtl2_bundle',
	      species_id=species.SpeciesId,
	      population_id=population.InbredSetId)}}"
      method="POST"
      enctype="multipart/form-data">
  <input type="hidden" name="species_id" value="{{species.SpeciesId}}" />
  <input type="hidden" name="population_id"
	 value="{{population.InbredSetId}}" />

  {{flash_all_messages()}}

  <div form-group>
    <legend class="heading">file upload</legend>
    <label for="file-rqtl2-bundle" class="form-label">R/qtl2 bundle</label>
    <input type="file" id="file-rqtl2-bundle" name="rqtl2_bundle_file"
	   accept="application/zip, .zip"
	   required="required"
           class="form-control" />
    <span class="form-text text-muted"><p>Provide a valid R/qtl2 zip file here. In
      particular, ensure your zip bundle contains exactly one control file and
      the corresponding files mentioned in the control file.</p>
      <p>The control file can be either a YAML or JSON file. <em>ALL</em> other
	data files in the zip bundle should be CSV files.</p>
      <p>See the
	<a href="https://kbroman.org/qtl2/assets/vignettes/input_files.html"
	   target="_blank">
	  R/qtl2 file format specifications</a> for more details.</p></span>
  </div>

  <button type="submit"
          class="btn btn-primary"
          data-toggle="modal"
          data-target="#upload-progress-indicator">upload R/qtl2 bundle</button>
</form>

{%endblock%}

{%block javascript%}
<script type="text/javascript" src="/static/js/upload_progress.js"></script>
<script type="text/javascript">
  setup_upload_handlers(
      "frm-upload-rqtl2-bundle", make_data_uploader(
	  function (form) {
	      var formdata = new FormData();
	      formdata.append(
		  "species_id",
		  form.querySelector('input[name="species_id"]').value);
	      formdata.append(
		  "population_id",
		  form.querySelector('input[name="population_id"]').value);
	      formdata.append(
		  "rqtl2_bundle_file",
		  form.querySelector("#file-rqtl2-bundle").files[0]);
	      return formdata;
	  }));
</script>
{%endblock%}