aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/display_diffs.html
blob: ce50c1b42dd547cb9a078679d04389ed3c37e706 (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
{% extends "base.html" %}
{% block title %}Trait Submission{% endblock %}

{% block css %}
<link rel="stylesheet" type="text/css" href="{{ url_for('css', filename='DataTables/css/jquery.dataTables.css') }}" />
{% endblock %}

{% block content %}
<!-- Start of body -->
<div class="container">
    {% set additions = diff.get("Additions") %}
    {% set modifications = diff.get("Modifications") %}
    {% set deletions = diff.get("Deletions") %}
    {% set header = diff.get("Columns", "Strain Name,Value,SE,Count") %}
    {% if additions %}
    <h2>Additions Data:</h2>
    <div class="row">
        <div class="col-md-8">
            <table class="table-responsive table-hover table-striped cell-border" id="table-additions">
                <thead>
                    <th scope="col">Added Data ({{ header }})</th>
                </thead>
                <tbody>
                    {% for data in additions %}
                    <tr>
                        <td>{{ data }}</td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
    {% endif %}

    {% if modifications %}
    <h2>Modified Data:</h2>

    <div class="row">
        <div class="col-md-8">
            <table class="table-responsive table-hover table-striped cell-border" id="table-modifications">
                <thead>
                    <th scope="col">Original</th>
                    <th scope="col">Current</th>
                    <th scope="col">Diff ({{ header }})</th>
                </thead>
                <tbody>
                    {% for data in modifications %}
                    <tr>
                        <td>{{ data.get("Original") }}</td>
                        <td>{{ data.get("Current") }}</td>
                        <td><pre>{{data.get("Diff")}}</pre></td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
    {% endif %}

    {% if deletions %}
    <h2>Deleted Data:</h2>
    <div class="row">
        <div class="col-md-8">
            <table class="table-responsive table-hover table-striped cell-border" id="table-deletions">
                <thead>
                    <th scope="col">Deleted Data</</th>
                </thead>
                <tbody>
                    {% for data in deletions %}
                    <tr>
                        <td>{{ data }}</td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
    {% endif %}

</div>
{%endblock%}

{% block js %}
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTables/js/jquery.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTables/js/jquery.dataTables.min.js') }}"></script>
<script language="javascript" type="text/javascript">
 gn_server_url = "{{ gn_server_url }}";

 $(document).ready( function() {
     $('#table-additions').dataTable();
     $('#table-modifications').dataTable();
     $('#table-deletions').dataTable();
 });
</script>
{% endblock %}