about summary refs log tree commit diff
path: root/uploader/templates/phenotypes/review-job-data.html
blob: 0e8f1197d04f301114ffba452ed933e774eadcb6 (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
146
147
148
149
150
151
152
{%extends "phenotypes/base.html"%}
{%from "cli-output.html" import cli_output%}
{%from "flash_messages.html" import flash_all_messages%}
{%from "macro-table-pagination.html" import table_pagination%}
{%from "phenotypes/macro-display-pheno-dataset-card.html" import display_pheno_dataset_card%}

{%block extrameta%}
{%if not job%}
<meta http-equiv="refresh"
      content="20; url={{url_for('species.populations.phenotypes.view_dataset', species_id=species.SpeciesId,
               population_id=population.Id,
               dataset_id=dataset.Id)}}" />
{%endif%}
{%endblock%}

{%block title%}Phenotypes{%endblock%}

{%block pagetitle%}Phenotypes{%endblock%}

{%block lvl4_breadcrumbs%}
<li {%if activelink=="add-phenotypes"%}
    class="breadcrumb-item active"
    {%else%}
    class="breadcrumb-item"
    {%endif%}>
  <a href="{{url_for('species.populations.phenotypes.add_phenotypes',
           species_id=species.SpeciesId,
           population_id=population.Id,
           dataset_id=dataset.Id)}}">View Datasets</a>
</li>
{%endblock%}

{%block contents%}

{%if job%}
<div class="row">
  <h3 class="heading">Data Review</h3>
  <p class="text-info"><strong>
      The data has <em>NOT</em> been added/saved yet. Review the details below
      and click "Continue" to save the data.</strong></p>
  <p>The &#x201C;<strong>{{dataset.FullName}}</strong>&#x201D; dataset from the
    &#x201C;<strong>{{population.FullName}}</strong>&#x201D; population of the
    species &#x201C;<strong>{{species.SpeciesName}} ({{species.FullName}})</strong>&#x201D;
    will be updated as follows:</p>

  <ul>
    {%if publication%}
    <li>All {{summary.get("pheno", {}).get("total-data-rows", "0")}} phenotypes
      are linked to the following publication:
      <ul>
        <li><strong>Publication Title:</strong>
          {{publication.Title or "—"}}</li>
        <li><strong>Author(s):</strong>
          {{publication.Authors or "—"}}</li>
      </ul>
    </li>
    {%endif%}
  {%for ftype in ("phenocovar", "pheno", "phenose", "phenonum")%}
  {%if summary.get(ftype, False)%}
    <li>A total of {{summary[ftype]["number-of-files"]}} files will be processed
      adding {%if ftype == "phenocovar"%}(possibly){%endif%}
      {{summary[ftype]["total-data-rows"]}} new
      {%if ftype == "phenocovar"%}
      phenotypes
      {%else%}
      {{summary[ftype]["description"]}} rows
      {%endif%}
      to the database.
    </li>
  {%endif%}
  {%endfor%}
  </ul>
</div>

<div class="row">

  <form id="frm-review-phenotype-data"
        method="POST"
        action="{{url_for('species.populations.phenotypes.load_data_to_database',
                species_id=species.SpeciesId,
                population_id=population.Id,
                dataset_id=dataset.Id)}}">
    <input type="hidden" name="data-qc-job-id" value="{{job.jobid}}" />
    <div class="form-group">
      <label for="txt-data-name">data name</label>
      <input type="text"
             id="txt-data-name"
             class="form-control"
             name="data_name"
             title="A short, descriptive name for this data."
             placeholder="{{user.email}} - {{dataset.Name}} - {{timestamp}}"
             value="{{user.email}} - {{dataset.Name}} - {{timestamp}}"
             required="required">
      <span class="form-text text-muted">
        This is a short, descriptive name for the data. It is useful to humans,
        enabling them identify what traits each data "resource" wraps around.
      </span>
    </div>

    {%if view_under_construction%}
    <div class="form-group">
      <label for="txt-data-description">data description</label>
      <textarea id="txt-data-description"
                class="form-control"
                name="data_description"
                title="A longer description for this data."
                rows="5"></textarea>
      <span class="form-text text-muted">
      </span>
    </div>
    {%endif%}

    <button type="submit" class="btn btn-primary">continue</button>
  </form>

</div>
{%else%}
<div class="row">
  <h4 class="subheading">Invalid Job</h3>
  <p class="text-danger">
    Could not find a job with the ID: <strong>{{job_id}}.</p>
  <p>You will be redirected in
    <span id="countdown-element" class="text-info">20</span> second(s)</p>
  <p class="text-muted">
    <small>
      If you are not redirected, please
      <a href="{{url_for(
               'species.populations.phenotypes.view_dataset',
               species_id=species.SpeciesId,
               population_id=population.Id,
               dataset_id=dataset.Id)}}">click here</a> to continue
    </small>
  </p>
</div>
{%endif%}
{%endblock%}


{%block javascript%}
<script type="text/javascript">
  $(document).ready(function() {
      var countdown = 20;
      var countdown_element = $("#countdown-element");
      if(countdown_element.length === 1) {
          intv = window.setInterval(function() {
              countdown = countdown - 1;
              countdown_element.html(countdown);
          }, 1000);
      }
  });
</script>
{%endblock%}