]> git.openstreetmap.org Git - osqa.git/blob - osqa/forum/skins/default/templates/revisions_question.html
0cda6d45938c93d8cc1ac43eb6a22e81f9b4e821
[osqa.git] / osqa / forum / skins / default / templates / revisions_question.html
1 {% extends "base_content.html" %}
2 <!-- revisions_question.html -->
3 <!--somehow very similar to revisions_answer.html-->
4 {% load extra_tags %}
5 {% load i18n %}
6 {% load extra_filters %}
7 {% load humanize %}
8 {% block title %}{% spaceless %}{% trans "Revision history" %}{% endspaceless %}{% endblock %}
9 {% block forejs %}
10         <script type="text/javascript">
11         //todo - take this out into .js file 
12         $().ready(function(){
13             $("#nav_questions").attr('className',"on");
14             $('div.revision div[id^=rev-header-]').bind('click', function(){
15                 var revId = this.id.substr(11);
16                 toggleRev(revId); 
17             
18             });
19             lanai.highlightSyntax();
20         });
21         
22         function toggleRev(id) {
23             var arrow = $("#rev-arrow-" + id);
24             var visible = arrow.attr("src").indexOf("hide") > -1;
25
26             var path = $.i18n._('/') + "media/images/expander-arrow-" + 
27                         (visible ? "show" : "hide") + ".gif" + "?v={{settings.RESOURCE_REVISION}}";
28             arrow.attr("src", path);
29             $("#rev-body-" + id).slideToggle("fast");
30         }
31         </script>
32 {% endblock %}
33         
34 {% block content %}
35 <div id="main-bar" class="headNormal">
36     {% trans "Revision history" %}[<a href="{{ post.get_absolute_url }}">{% trans "back" %}</a>]
37 </div>
38 <div id="main-body" class="">
39     <div id="revisions">
40     {% for revision in revisions %}
41       <div class="revision">
42         <div id="rev-header-{{ revision.revision }}" class="header {% ifequal post.author_id revision.author_id %}author{% endifequal %}">
43           <div class="header-controls">
44             <table width="100%">
45                 <tr>
46                     <td width="20" style="vertical-align:middle"><img id="rev-arrow-{{ revision.revision }}" 
47                                                                 src="{% media  "/media/images/expander-arrow-show.gif" %}"
48                                                                 alt="{% trans "click to hide/show revision" %}"/>
49                     </td>
50                     <td width="30px" style="vertical-align:middle"><span class="revision-number" title="{% trans "revision" %} {{ revision.revision }}">{{ revision.revision }}</span></td>
51                     <td width="200px" style="vertical-align:middle">
52                         {% if revision.summary %}
53                         <div class="summary"><span>{{ revision.summary }}</span></div>
54                         {% endif %}
55                         {% if request.user|can_edit_post:post %}
56                         <a href="{% url edit_question post.id %}?revision={{ revision.revision }}">{% trans "edit" %}</a>
57                         {% endif %}
58   
59                     </td>
60                     <td align="right">
61                         <div class="revision-mark" >
62                             {% post_contributor_info revision %}
63                         </div>
64                     </td>
65                 </tr>
66                     
67             </table>
68           </div>
69         </div>
70         <div id="rev-body-{{ revision.revision }}" class="diff body">
71             {{ revision.diff|safe }}
72         </div>
73       </div>
74     {% endfor %}
75     </div>
76 </div>
77 {% endblock %}
78
79 {% block endjs %}
80 {% endblock %}
81 <!-- end revisions_question.html -->