1 {% extends "base_content.html" %}
2 <!-- revisions_answer.html -->
5 {% load extra_filters %}
7 {% block title %}{% spaceless %}{% trans "Revision history" %}{% endspaceless %}{% endblock %}
9 <script type='text/javascript' src='{% media "/media/js/com.cnprog.editor.js" %}'></script>
10 <script type='text/javascript' src='{% media "/media/js/com.cnprog.post.js" %}'></script>
11 <script type="text/javascript">
12 //todo - take this out into .js file
14 $("#nav_questions").attr('className',"on");
15 $('div.revision div[id^=rev-header-]').bind('click', function(){
16 var revId = this.id.substr(11);
20 lanai.highlightSyntax();
23 function toggleRev(id) {
24 var arrow = $("#rev-arrow-" + id);
25 var visible = arrow.attr("src").indexOf("hide") > -1;
27 var path = $.i18n._('/') + "media/images/expander-arrow-" +
28 (visible ? "show" : "hide") + ".gif" + "?v={{settings.RESOURCE_REVISION}}";
29 arrow.attr("src", path);
30 $("#rev-body-" + id).slideToggle("fast");
37 <div id="main-bar" class="headNormal">
38 {% trans "Revision history" %} [<a href="{{ post.get_absolute_url }}">{% trans "back" %}</a>]
40 <div id="main-body" class="">
42 {% for revision in revisions %}
43 <div class="revision">
44 <div id="rev-header-{{ revision.revision }}" class="header {% ifequal post.author_id revision.author_id %}author{% endifequal %}">
45 <div class="header-controls">
48 <td width="20" style="vertical-align:middle"><img id="rev-arrow-{{ revision.revision }}"
49 src="{% media "/media/images/expander-arrow-show.gif" %}"
50 alt="{% trans "click to hide/show revision" %}"/>
52 <td width="30px" style="vertical-align:middle"><span class="revision-number" title="{% trans "revision" %} {{ revision.revision }}">{{ revision.revision }}</span></td>
53 <td width="200px" style="vertical-align:middle">
54 {% if revision.summary %}
55 <div class="summary"><span>{{ revision.summary }}</span></div>
57 {% if request.user|can_edit_post:post %}
58 <a href="{% url edit_answer post.id %}?revision={{ revision.revision }}">{% trans "edit" %}</a>
63 <div class="revision-mark" >
64 {% post_contributor_info revision %}
72 <div id="rev-body-{{ revision.revision }}" class="answerbody">
73 {{ revision.diff|safe }}
83 <!-- end revisions_answer.html -->