]> git.openstreetmap.org Git - osqa.git/blob - forum/skins/default/templates/revisions_question.html
Initial commit
[osqa.git] / 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' src='{% media  "/media/js/com.cnprog.editor.js" %}'></script>
11         <script type='text/javascript' src='{% media  "/media/js/com.cnprog.post.js" %}'></script>
12         <script type="text/javascript">
13         //todo - take this out into .js file 
14         $().ready(function(){
15             $("#nav_questions").attr('className',"on");
16             $('div.revision div[id^=rev-header-]').bind('click', function(){
17                 var revId = this.id.substr(11);
18                 toggleRev(revId); 
19             
20             });
21             lanai.highlightSyntax();
22         });
23         
24         function toggleRev(id) {
25             var arrow = $("#rev-arrow-" + id);
26             var visible = arrow.attr("src").indexOf("hide") > -1;
27
28             var path = $.i18n._('/') + "media/images/expander-arrow-" + 
29                         (visible ? "show" : "hide") + ".gif" + "?v={{settings.RESOURCE_REVISION}}";
30             arrow.attr("src", path);
31             $("#rev-body-" + id).slideToggle("fast");
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_question 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="diff body">
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_question.html -->