aboutsummaryrefslogtreecommitdiff
path: root/uploader/templates/samples/list-samples.html
blob: 13e5cecba60104f0ea812530d8676dae4c813df2 (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
{%extends "samples/base.html"%}
{%from "flash_messages.html" import flash_all_messages%}
{%from "populations/macro-select-population.html" import select_population_form%}
{%from "populations/macro-display-population-card.html" import display_population_card%}

{%block title%}Samples — List Samples{%endblock%}

{%block pagetitle%}Samples — List Samples{%endblock%}

{%block lvl4_breadcrumbs%}
<li {%if activelink=="list-samples"%}
    class="breadcrumb-item active"
    {%else%}
    class="breadcrumb-item"
    {%endif%}>
  <a href="{{url_for('species.populations.samples.list_samples',
           species_id=species.SpeciesId,
           population_id=population.Id)}}">List</a>
</li>
{%endblock%}

{%block contents%}
{{flash_all_messages()}}

<div class="row">
  <p>
    You selected the population "{{population.FullName}}" from the
    "{{species.FullName}}" species.
  </p>
</div>

{%if samples | length > 0%}
<div class="row">
  <p>
    This population already has <strong>{{total_samples}}</strong>
    samples/individuals entered. You can explore the list of samples in this
    population in the table below.
  </p>
</div>

<div class="row">
  <div class="col-md-2">
    {%if offset > 0:%}
    <a href="{{url_for('species.populations.samples.list_samples',
             species_id=species.SpeciesId,
             population_id=population.Id,
             from=offset-count,
             count=count)}}">
      <span class="glyphicon glyphicon-backward"></span>
      Previous
    </a>
    {%endif%}
  </div>

  <div class="col-md-8" style="text-align: center;">
    Samples {{offset}} &mdash; {{offset+(count if offset + count < total_samples else total_samples - offset)}} / {{total_samples}}
                                                                   </div>

  <div class="col-md-2">
    {%if offset + count < total_samples:%}
    <a href="{{url_for('species.populations.samples.list_samples',
             species_id=species.SpeciesId,
             population_id=population.Id,
             from=offset+count,
             count=count)}}">
      Next
      <span class="glyphicon glyphicon-forward"></span>
    </a>
    {%endif%}
  </div>
</div>
<div class="row">
  <table class="table">
    <thead>
      <tr>
        <th>#</th>
        <th>Name</th>
        <th>Auxilliary Name</th>
        <th>Symbol</th>
        <th>Alias</th>
      </tr>
    </thead>

    <tbody>
      {%for sample in samples%}
      <tr>
        <td>{{sample.sequence_number}}</td>
        <td>{{sample.Name}}</td>
        <td>{{sample.Name2}}</td>
        <td>{{sample.Symbol or "-"}}</td>
        <td>{{sample.Alias or "-"}}</td>
      </tr>
      {%endfor%}
    </tbody>
  </table>

  <p>
    <a href="#"
       title="Add samples for population '{{population.FullName}}' from species
              '{{species.FullName}}'."
       class="btn btn-danger">
      delete all samples
    </a>
  </p>
</div>

{%else%}

<div class="row">
  <p>
    There are no samples entered for this population. Do please go ahead and add
    the samples for this population by clicking on the button below.
  </p>

  <p>
    <a href="{{url_for('species.populations.samples.upload_samples',
             species_id=species.SpeciesId,
             population_id=population.Id)}}"
       title="Add samples for population '{{population.FullName}}' from species
              '{{species.FullName}}'."
       class="btn btn-primary">
      add samples
    </a>
  </p>
</div>
{%endif%}

{%endblock%}

{%block sidebarcontents%}
{{display_population_card(species, population)}}
{%endblock%}