-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathgloss_revision_history.html
124 lines (111 loc) · 4.69 KB
/
gloss_revision_history.html
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
{% extends "baselayout.html" %}
{% load i18n %}
{% load stylesheet %}
{% load annotation_idgloss_translation %}
{% load bootstrap3 %}
{% block bootstrap3_title %}
{% blocktrans %}Revision History for {{ gloss }}{% endblocktrans %}
{% endblock %}
{% load guardian_tags %}
{% block extrajs %}
<script type='text/javascript'>
var url = '{{ PREFIX_URL }}';
var csrf_token = '{{csrf_token}}';
var search_type = '{{search_type}}';
var model_view = 'gloss';
var active_id = '{{active_id}}';
var search_results_url = '{% url 'dictionary:ajax_search_results' %}';
{% include "dictionary/search_result_bar.html" %}
$('.quick_revision').click(function(e)
{
e.preventDefault();
var glossid = $(this).attr('value');
$.ajax({
url : url + "/dictionary/gloss_revision/cleanup/" + glossid,
type: 'POST',
data: { 'csrfmiddlewaretoken': csrf_token },
datatype: "json",
success : function(data) {
window.location.href = url + '/dictionary/gloss/'+glossid+'/history';;
}
});
});
</script>
{% endblock %}
{% block content %}
{% get_obj_perms request.user for gloss.lemma.dataset as "dataset_perms" %}
<div id="searchresults" class='navbar navbar-light' style="overflow-y:hidden;border:0;box-sizing:content-box; z-index: 50;">
{% if request.session.search_results %}{# See if search_results in sessions is empty #}
<div id="results-inline" class="btn-group" role="group" aria-label="search results" style="white-space:nowrap;">
</div>
{% endif %}
</div>
<div id="signinfo" class='navbar navbar-collapse' style="background-color:inherit;border:0;">
<div id="view_tabs" style="margin-right:15px;margin-top:10px;z-index:100;" class='view-tabs view-tabs-light'>
<ul class='nav nav-tabs nav-tabs-light'>
<li class="nav-item">
<a class='nav-link' href="{{PREFIX_URL}}/dictionary/gloss/{{gloss.id}}.html">{% trans "Public View" %}</a>
</li>
<li class="nav-item">
<a class='nav-link' href="{{PREFIX_URL}}/dictionary/gloss/{{gloss.id}}">{% trans "Details" %}</a>
</li>
<li class="nav-item">
<a class='nav-link' href="{{PREFIX_URL}}/dictionary/gloss_relations/{{gloss.id}}">{% trans "Relations" %}</a>
</li>
{% if gloss.has_frequency_data %}
<li class="nav-item">
<a class='nav-link' href="{{PREFIX_URL}}/dictionary/gloss_frequency/{{gloss.id}}/">{% trans "Frequencies" %}</a>
</li>
{% endif %}
<li class="nav-item">
<a class='nav-link active' href="{{PREFIX_URL}}/dictionary/gloss/{{gloss.id}}/history">{% trans "Revision History" %}</a>
</li>
<li class="nav-item">
<a class='nav-link' href="{{PREFIX_URL}}/dictionary/gloss/{{gloss.id}}/glossvideos">{% trans "Videos" %}</a>
</li>
</ul>
</div>
</div>
<br><br>
<div id="definitionblock" style="z-index:0;padding-top: 100px;">
{% if "change_dataset" in dataset_perms %}
<div class='pull-right' style="margin-right:15px;margin-top:10px;">
<button id='clean_up_revision_history'
class='btn btn-primary quick_revision' name='quick_revision' value='{{gloss.id}}'
type="submit"
style="width:auto;padding:3px 12px;">{% trans "Clean Up" %}</button>
</div>
{% endif %}
<br>
<table class="table table-condensed">
<thead>
<tr>
<th>{% trans "User" %}</th>
<th>{% trans "Time" %}</th>
<th>{% trans "Field" %}</th>
<th>{% trans "Old value" %}</th>
<th>{% trans "New value" %}</th>
</tr>
</thead>
{% for revision in revisions %}
<tr>
<td>{{revision.user}}</td>
<td>{{revision.time}}</td>
<td>{{revision.field_name}}{{revision.field_name_qualification}}</td>
<td>{% if revision.is_tag and revision.old_value %}
{% load underscore_to_space %}
<div class='tag' style="margin:0;">
<span class='tagname'>{{revision.old_value|underscore_to_space}}</span>
</div>
{% else %}{{revision.old_value}}{% endif %}</td>
<td>{% if revision.is_tag and revision.new_value %}
{% load underscore_to_space %}
<div class='tag' style="margin:0;">
<span class='tagname'>{{revision.new_value|underscore_to_space}}</span>
</div>
{% else %}{{revision.new_value}}{% endif %}</td>
</tr>
{% endfor %}
</table>
</div>
{% endblock %}