blob: afc6eafe73b42686aff48d0dc8795d6caeba133f (
plain) (
blame)
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
{% extends "wiki/article.html" %}
{% load wiki_tags i18n sekizai_tags static %}
{% block wiki_pagetitle %}{% trans "History" %}: {{ article.current_revision.title }}{% endblock %}
{% block wiki_contents_tab %}
{% include "wiki/includes/modals.html" %}
{% addtoblock "js" %}
<script type="text/javascript" src="{% static "wiki/js/diffview.js" %}"></script>
<script type="text/javascript" src="{% static "wiki/js/diff.js" %}"></script>
{% endaddtoblock %}
{% addtoblock "css" %}
<style type="text/css">
td.linenumber {
width: 20px;
}
tr.insert td {
background-color: #DFC;
}
tr.delete td {
background-color: #FDC;
}
tr.equal td {
background-color: #F2F2F2;
}
.diff-container td {
white-space: pre; font-family: monospace;
}
.diff-container td,
.diff-container th {
padding: 2px 7px;
border-right: 1px solid #DDD;
}
.diff-container td:last-child,
.diff-container th:last-child {
border-right: none;
}
.diff-container table {
border-top: 1px solid #DDD;
}
</style>
{% endaddtoblock %}
<p class="lead">
{% trans "Click each revision to see a list of edited lines. Click the Preview button to see how the article looked at this stage. At the bottom of this page, you can change to a particular revision or merge an old revision with the current one." %}
</p>
<form method="GET">
<div class="tab-content" style="overflow: visible;">
{% for revision in revisions %}
<div class="panel-group" id="accordion{{ revision.revision_number }}">
<div class="panel panel-default">
<div class="panel-heading">
<a class="panel-toggle" style="float: left;" href="#collapse{{ revision.revision_number }}" onclick="get_diff_json('{% url 'wiki:diff' revision.id %}', $('#collapse{{ revision.revision_number }}'))">
{% if revision == article.current_revision %}
<i class="fa fa-flag"></i>
{% else %}
<i class="fa fa-plus"></i>
{% endif %}
{% include "wiki/includes/revision_info.html" with current_revision=article.current_revision %}
<div class="text-muted">
<small>
{% if revision.user_message %}
{{ revision.user_message }}
{% elif revision.automatic_log %}
{{ revision.automatic_log }}
{% else %}
({% trans "no log message" %})
{% endif %}
</small>
</div>
</a>
<div class="progress progress-striped active" style="display: none; width: 40px; float: left; margin-top: 7px; margin-bottom: -7px;">
<div class="bar" style="width: 100%;"></div>
</div>
<div class="pull-right" style="vertical-align: middle; margin: 8px 8px;">
{% if revision == article.current_revision %}
<a href="#" class="btn btn-default disabled">
<span class="fa fa-lock fa-fw"></span>
{% trans "Preview this revision" %}
</a>
{% else %}
<button type="submit" class="btn btn-default" onclick="$('#previewModal').modal('show'); this.form.target='previewWindow'; this.form.r.value='{{ revision.id }}'; this.form.action='{% url 'wiki:preview_revision' article.id %}'; $('#previewModal .switch-to-revision').attr('href', '{% url 'wiki:change_revision' path=urlpath.path article_id=article.id revision_id=revision.id %}')">
<span class="fa fa-eye fa-fw"></span>
{% trans "Preview this revision" %}
</button>
{% endif %}
{% if article|can_write:user and not article.current_revision.locked %}
<input type="radio"{% if revision == article.current_revision %} disabled="true"{% endif %} style="margin: 0 10px;" value="{{ revision.id }}" name="revision_id" switch-button-href="{% url 'wiki:change_revision' path=urlpath.path revision_id=revision.id %}" merge-button-href="{% url 'wiki:merge_revision_preview' article_id=article.id revision_id=revision.id %}" merge-button-commit-href="{% url 'wiki:merge_revision' path=urlpath.path article_id=article.id revision_id=revision.id %}" />
{% endif %}
</div>
<div style="clear: both"></div>
</div>
<div id="collapse{{ revision.revision_number }}" class="panel-collapse collapse">
<div class="panel-body diff-container" style="padding: 0;">
<dl class="dl-horizontal">
<dt>{% trans "Auto log:" %}</dt>
<dd>{{ revision.automatic_log|default:"-"|linebreaksbr }}</dd>
</dl>
<table class="table table-condensed" style="margin: 0; border-collapse: collapse;">
<thead>
<tr>
<th class="linenumber">{% if revision.previous_revision %}#{{revision.previous_revision.revision_number}}{% endif %}</th>
<th class="linenumber">#{{revision.revision_number}}</th>
<th>{% trans "Change" %}</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
{% endfor %}
{% include "wiki/includes/pagination.html" %}
{% if is_paginated %}
{% include "base/paginator.html" %}
{% endif %}
{% if revisions.count > 1 and article|can_write:user and not article.current_revision.locked %}
<div class="form-group form-actions">
<div class="pull-right">
<button type="submit" name="preview" value="1" class="btn btn-default" onclick="$('#mergeModal').modal('show'); this.form.target='mergeWindow'; this.form.action=$('input[type=radio]:checked').attr('merge-button-href'); $('.merge-revision-commit').attr('href', $('input[type=radio]:checked').attr('merge-button-commit-href'))">
<span class="fa fa-random"></span>
{% trans "Merge selected with current..." %}
</button>
<button type="submit" name="save" value="1" class="btn btn-primary" onclick="this.form.target='_self'; this.form.action=$('input[type=radio]:checked').attr('switch-button-href')">
<span class="fa fa-flag"></span>
{% trans "Switch to selected version" %}
</button>
</div>
<div style="clear:both"></div>
</div>
{% endif %}
</div>
<input type="hidden" name="r" value="" />
<div class="modal fade wiki-modal" id="previewModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<iframe name="previewWindow" frameborder="0"></iframe>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-default btn-lg" data-dismiss="modal">
<span class="fa fa-arrow-circle-left"></span>
{% trans "Back to history view" %}
</a>
{% if article|can_write:user %}
<a href="#" class="btn btn-lg btn-primary switch-to-revision">
<span class="fa fa-flag"></span>
{% trans "Switch to this version" %}
</a>
{% else %}
<a href="#" class="btn btn-lg btn-primary disabled">
<span class="fa fa-lock"></span>
{% trans "Switch to this version" %}
</a>
{% endif %}
</div>
</div>
</div>
</div>
<div class="modal fade wiki-modal" id="mergeModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1>{% trans "Merge with current" %}</h1>
<p class="lead"><span class="fa fa-info-circle"></span> {% trans "When you merge a revision with the current, all data will be retained from both versions and merged at its approximate location from each revision." %} <strong>{% trans "After this, it's important to do a manual review." %}</strong></p>
</div>
<div class="modal-body">
<iframe name="mergeWindow" frameborder="0" style="min-height: 0;"></iframe>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-default btn-lg" data-dismiss="modal">
<span class="fa fa-arrow-circle-left"></span>
{% trans "Back to history view" %}
</a>
{% if article|can_write:user %}
<a href="#" class="btn btn-lg btn-primary merge-revision-commit">
<span class="fa fa-file"></span>
{% trans "Create new merged version" %}
</a>
{% else %}
<a href="#" class="btn btn-lg btn-primary disabled">
<span class="fa fa-lock"></span>
{% trans "Create new merged version" %}
</a>
{% endif %}
</div>
</div>
</div>
</div>
</form>
{% endblock %}
|