]> git.openstreetmap.org Git - osqa.git/blob - forum/skins/default/templates/revisions_answer.html
Initial commit
[osqa.git] / forum / skins / default / templates / revisions_answer.html
1 {% extends "base_content.html" %}
2 <!-- revisions_answer.html -->
3 {% load i18n %}
4 {% load extra_tags %}
5 {% load extra_filters %}
6 {% load humanize %}
7 {% block title %}{% spaceless %}{% trans "Revision history" %}{% endspaceless %}{% endblock %}
8 {% block forejs %}
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 
13         $().ready(function(){
14             $("#nav_questions").attr('className',"on");
15             $('div.revision div[id^=rev-header-]').bind('click', function(){
16                 var revId = this.id.substr(11);
17                 toggleRev(revId); 
18             
19             });
20             lanai.highlightSyntax();
21         });
22         
23         function toggleRev(id) {
24             var arrow = $("#rev-arrow-" + id);
25             var visible = arrow.attr("src").indexOf("hide") > -1;
26
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");
31         }
32         
33         </script>
34 {% endblock %}
35         
36 {% block content %}
37 <div id="main-bar" class="headNormal">
38     {% trans "Revision history" %} [<a href="{{ post.get_absolute_url }}">{% trans "back" %}</a>]
39 </div>
40 <div id="main-body" class="">
41     <div id="revisions">
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">
46             <table width="100%">
47                 <tr>
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" %}"/>
51                     </td>
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>
56                         {% endif %}
57                         {% if request.user|can_edit_post:post %}
58                         <a href="{% url edit_answer post.id %}?revision={{ revision.revision }}">{% trans "edit" %}</a>
59                         {% endif %}
60   
61                     </td>
62                     <td align="right">
63                         <div class="revision-mark" >
64                             {% post_contributor_info revision %}
65                         </div>
66                     </td>
67                 </tr>
68                     
69             </table>
70           </div>
71         </div>
72         <div id="rev-body-{{ revision.revision }}" class="answerbody">
73             {{ revision.diff|safe }}
74         </div>
75       </div>
76     {% endfor %}
77     </div>
78 </div>
79 {% endblock %}
80
81 {% block endjs %}
82 {% endblock %}
83 <!-- end revisions_answer.html -->