aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/edit_history.html
blob: 8ca96f3d03f1f01ac88bc5807d4edb00419dff22 (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
{% extends "index_page.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">

  <h1>History</h1>
    {% if diff %}
    <div class="row">
      <table id="history" class="table-responsive table-hover table-striped cell-border">
	<thead>
          <th>Timestamp</th>
          <th>Editor</th>
          <th>Field</th>
          <th>Diff</th>
	</thead>
	<tbody>
	  {%set ns = namespace(display_ts=True)%}
	  {%for ts, item in diff.items()%}
	  {%set ns.display_ts = True%}
	  {%for the_diff in item%}
	  <tr>
	    {%if ns.display_ts%}
	    <td rowspan={{item | length}}>{{ts}}</td>
	    {%set ns.display_ts = False%}
	    {%endif%}
	    <td>{{the_diff.author}}</td>
	    <td>{{the_diff.diff.field}}</td>
	    <td><pre>{{the_diff.diff.diff}}</pre></td>
	  </tr>
	  {%endfor%}
	  {%endfor%}
	</tbody>
      </table>
    </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() {
     $('#history').dataTable();
 });
</script>
{% endblock %}