]> git.openstreetmap.org Git - osqa.git/blob - forum/skins/default/templates/revisions.html
make sure that we pre-wrap the lines of code in the markdown code blocks
[osqa.git] / forum / skins / default / templates / revisions.html
1 {% extends "base_content.html" %}
2 {% load node_tags %}
3 {% load extra_tags %}
4 {% load i18n %}
5 {% load extra_filters %}
6 {% load humanize %}
7 {% block title %}{% spaceless %}{% trans "Revision history" %}{% endspaceless %}{% endblock %}
8 {% block forejs %}
9     <script type="text/javascript">
10
11         $(document).ready(function() {
12             rev_bodies = $('div.rev-body');
13             if(rev_bodies.length > 0)toggleRev(rev_bodies.length);
14             if(rev_bodies.length > 1)toggleRev(rev_bodies.length-1);
15
16             for(var index = 0; index < rev_bodies.length; index++) {
17                 rev_bodies.get(index);
18             }
19         });
20
21         function toggleRev(id) {
22             var rev_body = $('div#rev-body-' + id).get(0);
23             var rev_arrow = $('img#rev-arrow-' + id).get(0);
24             if (rev_body.style.display == "none") {
25                 rev_body.style.display = "";
26                 rev_arrow.src="{% media  "/media/images/expander-arrow-hide.gif" %}"
27             } else {
28                 rev_body.style.display = "none";
29                 rev_arrow.src="{% media  "/media/images/expander-arrow-show.gif" %}"
30             }
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.inst.revision }}" class="header {% ifequal post.author revision.inst.author %}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.inst.revision }}"
49                                                                       class="rev-arrow"
50                                                                       onclick="toggleRev({{ revision.inst.revision }})"
51                                                                       src="{% media  "/media/images/expander-arrow-show.gif" %}"
52                                                                       alt="{% trans "click to hide/show revision" %}"/>
53                     </td>
54                     <td width="30px" style="vertical-align:middle"><span class="revision-number" title="{% trans "revision" %} {{ revision.inst.revision }}">{{ revision.inst.revision }}</span></td>
55                     <td width="200px" style="vertical-align:middle">
56                         <div class="summary"><span>{{ revision.inst.summary }}</span></div>
57                     </td>
58                     <td align="right">
59                         <div class="revision-mark" >
60                             {% reviser_info revision.inst %}
61                         </div>
62                     </td>
63                 </tr>
64                     
65             </table>
66           </div>
67         </div>
68         <div id="rev-body-{{ revision.inst.revision }}" class="diff body rev-body" style="display:none">
69             {{ revision.diff|safe }}
70         </div>
71       </div>
72     {% endfor %}
73     </div>
74 </div>
75 {% endblock %}
76
77 {% block endjs %}
78 {% endblock %}