|
0
|
1 |
{% extends "site/layout/base_text.html" %} |
|
|
2 |
{% load com %} |
|
|
3 |
{% load i18n %} |
|
|
4 |
{% load local_perms %} |
|
|
5 |
{% block main %} |
|
|
6 |
|
|
|
7 |
{% get_local_text_perm request text can_edit_text as can_edit_text %} |
|
|
8 |
|
|
|
9 |
<script type="text/javascript"> |
|
|
10 |
<!-- |
|
|
11 |
tb_conf['current_tab'] = 'history'; |
|
|
12 |
--> |
|
|
13 |
</script> |
|
|
14 |
|
|
145
|
15 |
<div id="text_history" class="tab-meta"> |
|
|
16 |
|
|
0
|
17 |
<script type="text/javascript"> |
|
|
18 |
<!-- |
|
|
19 |
$(function() { |
|
145
|
20 |
$(".hidden-text-actions").css('visibility','hidden'); |
|
|
21 |
}) ; |
|
|
22 |
$(function() { |
|
|
23 |
$("input[name=oldkey]").click(function () { |
|
|
24 |
hide_show($(this), 'newkey', true, true, -1); |
|
|
25 |
hide_show($(this), 'newkey', false, false, 0); |
|
|
26 |
}); |
|
|
27 |
$("input[name=newkey]").click(function () { |
|
|
28 |
hide_show($(this), 'oldkey', false, true, 0); |
|
|
29 |
hide_show($(this), 'oldkey', true, false, +1); |
|
|
30 |
}); |
|
|
31 |
|
|
|
32 |
$("input[name=newkey]")[0].click(); |
|
|
33 |
$("input[name=oldkey]")[1].click(); |
|
|
34 |
}) ; |
|
|
35 |
|
|
|
36 |
|
|
|
37 |
function hide_show(elem, name, hide, up, plus) { |
|
|
38 |
var nb = elem.attr('id').split('-')[1]; |
|
|
39 |
nb = parseInt(nb) + plus; |
|
|
40 |
|
|
|
41 |
if (hide) |
|
|
42 |
var vis = 'hidden'; |
|
|
43 |
else |
|
|
44 |
var vis = 'visible'; |
|
|
45 |
|
|
|
46 |
if (up) |
|
|
47 |
var fu = 'gt'; |
|
|
48 |
else |
|
|
49 |
var fu = 'lt'; |
|
|
50 |
$("input[name=" + name + "]:" + fu + "(" + nb + ")").css('visibility',vis); |
|
|
51 |
}; |
|
0
|
52 |
--> |
|
|
53 |
</script> |
|
|
54 |
|
|
145
|
55 |
<ul class="sub_list"> |
|
|
56 |
<li class="active_sub">{% blocktrans %}Version list{% endblocktrans %}</li> |
|
|
57 |
{% if last_last_version %} |
|
|
58 |
<li> / </li> |
|
|
59 |
<li><a href="{% url text-history-compare text.key last_last_version.key last_version.key %}">{% blocktrans %}Compare last two versions{% endblocktrans %}</a></li> |
|
148
|
60 |
<li> / </li> |
|
|
61 |
<li><a href="{% url text-history-version text.key text.last_text_version.key %}">{% blocktrans %}Most recent version{% endblocktrans %}</a></li> |
|
145
|
62 |
{% endif %} |
|
|
63 |
</ul> |
|
0
|
64 |
|
|
145
|
65 |
<form id="compare_form" action="." method="post"> |
|
|
66 |
|
|
|
67 |
<input name="compare" id="compare_button" type="submit" value="{% blocktrans %}Compare selected versions{% endblocktrans %}"/> |
|
0
|
68 |
|
|
62
|
69 |
<br /> |
|
145
|
70 |
{% include "site/macros/paginator.html" %} |
|
|
71 |
|
|
|
72 |
<div style="clear:both;"></div> |
|
0
|
73 |
|
|
145
|
74 |
<table summary="text list" class="large_table"> |
|
|
75 |
<thead> |
|
|
76 |
<tr> |
|
|
77 |
<th>{% blocktrans %}Version{% endblocktrans %}</th> |
|
|
78 |
<th colspan="2" width="1%">{% blocktrans %}Selection{% endblocktrans %}</th> |
|
|
79 |
<th>{% blocktrans %}Title{% endblocktrans %}</th> |
|
|
80 |
<th>{% blocktrans %}Author{% endblocktrans %}</th> |
|
|
81 |
<th>{% blocktrans %}Created{% endblocktrans %}</th> |
|
|
82 |
<th>{% blocktrans %}# comments{% endblocktrans %}</th> |
|
|
83 |
</tr> |
|
|
84 |
</thead> |
|
|
85 |
<tbody> |
|
|
86 |
{% for text_version in object_list %} |
|
|
87 |
|
|
|
88 |
{% get_local_text_perm request text can_edit_text as can_edit_text %} |
|
|
89 |
{% get_local_text_perm request text can_delete_text as can_delete_text %} |
|
|
90 |
{% get_local_text_perm request text can_manage_text as can_manage_text %} |
|
|
91 |
|
|
|
92 |
<tr class="text-{{ text_version.key }} {% cycle 'odd' 'even' %}"> |
|
|
93 |
{% if can_manage_workspace %}<td><input type="checkbox" class="text_check" name="check-{{ text_version.key }}"/></td>{% endif %} |
|
|
94 |
<td>#{{ forloop.counter0|add:page_obj.start_index|invneg:paginator.count|add:"1" }}</td> |
|
|
95 |
<td><input id="oldkey-{{ forloop.counter0 }}" type="radio" name="oldkey" value="{{ text_version.key }}"/></td> |
|
|
96 |
<td><input id="newkey-{{ forloop.counter0 }}" type="radio" name="newkey" value="{{ text_version.key }}"/></td> |
|
|
97 |
<td> |
|
|
98 |
<a class="main_object_title" href="{% url text-history-version text.key text_version.key %}">{{ text_version.title }}</a> |
|
|
99 |
|
|
|
100 |
|
|
|
101 |
<div class="hidden-text-actions text-actions-{{ text_version.key }}"> |
|
|
102 |
<a href="{% url text-history-version text.key text_version.key %}">{% blocktrans %}View{% endblocktrans %}</a> |
|
148
|
103 |
{% if text_version.get_previous_version %}| <a href="{% url text-history-compare text.key text_version.get_previous_version.key text_version.key %}">{% blocktrans %}Compare with previous version{% endblocktrans %}</a>{% endif %} |
|
145
|
104 |
{% if can_edit_text %} | <a href="{% url text-revert text.key text_version.key %}">{% blocktrans %}Revert to this version{% endblocktrans %}</a>{% endif %} |
|
|
105 |
{% comment %}{% if can_delete_text %}<a id="text-delete-{{ text_version.key }}" href="#">{% blocktrans %}Delete{% endblocktrans %}</a> |
|
|
106 |
<script type="text/javascript"> |
|
|
107 |
<!-- |
|
|
108 |
$(function() { |
|
|
109 |
$("#text-delete-{{ text_version.key }}").click(function(){ |
|
|
110 |
url = '{% url text-version-delete text.key text_version.key %}'; |
|
|
111 |
question = "{% blocktrans %}Are you sure you want to delete this version?{% endblocktrans %}"; |
|
|
112 |
if (confirm(question)) { |
|
|
113 |
$.post(url, function(data){ |
|
|
114 |
window.location = '{% url index %}'; |
|
|
115 |
}); |
|
|
116 |
} |
|
|
117 |
}); |
|
|
118 |
|
|
|
119 |
}) ; |
|
|
120 |
--> |
|
|
121 |
</script> |
|
|
122 |
{% endif %} |
|
|
123 |
{% endcomment %} |
|
|
124 |
</div> |
|
|
125 |
<script type="text/javascript"> |
|
|
126 |
<!-- |
|
|
127 |
$(function() { |
|
|
128 |
$(".text-{{ text_version.key }}").mouseover(function(){ |
|
|
129 |
$(".text-actions-{{ text_version.key }}").css('visibility','visible'); |
|
|
130 |
$(".text-{{ text_version.key }}").addClass('hover'); |
|
|
131 |
}); |
|
|
132 |
$(".text-{{ text_version.key }}").mouseout(function(){ |
|
|
133 |
$(".text-actions-{{ text_version.key }}").css('visibility','hidden'); |
|
|
134 |
$(".text-{{ text_version.key }}").removeClass('hover'); |
|
|
135 |
}); |
|
|
136 |
}) ; |
|
|
137 |
--> |
|
|
138 |
</script> |
|
|
139 |
</td> |
|
|
140 |
<td>{{ text_version.get_name }}</td> |
|
|
141 |
<td>{{ text_version.created|local_date }}</td> |
|
|
142 |
<td>{{ text_version|nb_comments:request }}</td> |
|
0
|
143 |
|
|
145
|
144 |
</tr> |
|
|
145 |
{% endfor %} |
|
|
146 |
</tbody> |
|
0
|
147 |
</table> |
|
62
|
148 |
|
|
145
|
149 |
</form> |
|
62
|
150 |
|
|
0
|
151 |
</div> |
|
|
152 |
{% endblock %} |