aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/show_trait_edit_data.html
blob: 91cbdb6ed2fdb1d9917f54b761bfe306a3a25fa5 (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
<div>
    {% for sample_type in sample_groups %}
      <div class="sample-table-container">
        {% if loop.index == 1 and (sample_groups[0].se_exists or has_num_cases or sample_groups[0].attributes|length > 0) %}
        <b>Show/Hide Columns:</b>
        <br>
        {% if sample_groups[0].se_exists %}
        <button class="toggle-vis" data-column="4,5">SE</button>
        {% if has_num_cases %}
        <button class="toggle-vis" data-column="6">N</button>
        {% set attr_start_pos = 7 %}
        {% else %}
        {% set attr_start_pos = 6 %}
        {% endif %}
        {% else %}
        {% if has_num_cases %}
        <button class="toggle-vis" data-column="4">N</button>
        {% set attr_start_pos = 5 %}
        {% else %}
        {% set attr_start_pos = 4 %}
        {% endif %}
        {% endif %}
        {% if sample_groups[0].attributes %}
        {% for attribute in sample_groups[0].attributes %}
        <button class="toggle-vis" data-column="{{ loop.index + attr_start_pos - 1 }}">{{ sample_groups[0].attributes[attribute].name }}</button>
        {% endfor %}
        {% endif %}
        <br>
        <br>
        {% endif %}
        <div class="sample-table-search-container">
          <input type="text" id="{{ sample_type.sample_group_type }}_searchbox" class="form-control sample-table-search" placeholder="Search This Table For ...">
        </div>
        <div class="sample-table-export-container">
          <button class="btn btn-default export"><span class="glyphicon glyphicon-download-alt"></span> Export</button>
          <select class="select optional span2 export_format">
            <option value="excel">Excel</option>
            <option value="csv">CSV</option>
          </select>
          <button type="button" class="btn btn-success reset"><span class="glyphicon glyphicon-repeat"></span> Reset</button>
        </div>
        <div id="export_code" class="export-code-container">
          <pre class="export-code_field">
            <code>
  # read into R
  trait <- read.csv("{{ this_trait.display_name}}.csv", header = TRUE, comment.char = "#")

  # read into python
  import pandas as pd
  trait = pd.read_csv("{{ this_trait.display_name}}.csv", header = 0, comment = "#")
            </code>
          </pre>
        </div>
      </div>
      <a href="{{url_for('edit_case_attributes', inbredset_id=dataset.group.id)}}"
	     title="Edit case attributes for group."
	     target="_blank"
	     class="btn btn-info">Edit CaseAttributes</a>
      {% set outer_loop = loop %}
      <div class="sample_group">
        <div style="position: relative;">
          <div class="inline-div"><h3 style="float: left;">{{ sample_type.header }}<span name="transform_text"></span></h3></div>
        </div>
        <div id="{{ sample_type.sample_group_type }}_container" style="width: {{ trait_table_width }}px;">
        <table class="table-hover table-striped cell-border" id="samples_{{ sample_type.sample_group_type }}">
            <tbody>
              <td colspan="100%" align="center"><br><b><font size="15">Loading...</font></b><br></td>
            </tbody>
        </table>
        </div>
      </div>
      <br>
    {% endfor %}
    <input type="hidden" name="Default_Name">
</div>