]> git.openstreetmap.org Git - osqa.git/blob - forum/skins/default/templates/question/comments.html
3c417fa4c84842a099de86feee2d1dcd5241f81e
[osqa.git] / forum / skins / default / templates / question / comments.html
1 {% load extra_tags %}\r
2 {% load i18n %}\r
3 \r
4 <div class="comments-container" id="comments-container-{{ post_type }}-{{ post.id }}">\r
5     {% for comment in comments %}\r
6         <table class="comment{% if not comment.top_scorer %} not_top_scorer{% endif %}" id="comment-{{comment.id}}">\r
7             <tr>\r
8                 <td rowspan="2" class="comment-score" id="comment-{{ comment.id }}-score">\r
9                     {% if comment.score %}{{ comment.score }}{% endif %}\r
10                 </td>\r
11                 <td class="comment-text" id="comment-{{comment.id}}-text">\r
12                     {{ comment.comment }}\r
13                 </td>\r
14             </tr>\r
15             <tr>\r
16                 <td class="comment-info" id="comment-{{comment.id}}-info">\r
17                     <a class="comment-user userinfo" href="{{comment.user.get_profile_url}}">{{comment.user}}</a>\r
18                     <span class="comment-age">({% diff_date comment.added_at %})</span>\r
19                     {% if comment.can_like %}\r
20                         <a id="comment-{{ comment.id }}-like" href="{% url like_comment id=comment.id %}"\r
21                          title="{% trans "I like this comment (click again to cancel)" %}" class="ajax-command comment-like{% if comment.likes %} on{% endif %}"\r
22                         rel="nofollow"> </a>\r
23                     {% endif %}\r
24                     {% if comment.can_edit %}\r
25                         <a id="comment-{{ comment.id }}-edit" href="#" title="{% trans "Edit comment" %}"\r
26                             class="comment-edit" rel="nofollow"> </a>\r
27                     {% endif %}\r
28                     {% if comment.can_delete %}\r
29                         <a id="comment-{{ comment.id }}-delete" href="{% url delete_comment id=comment.id %}" title="{% trans "Delete comment" %}"\r
30                             class="ajax-command comment-delete" rel="nofollow"> </a>\r
31                     {% endif %}\r
32                 </td>\r
33             </tr>\r
34         </table>\r
35     {% endfor %}\r
36 </div>\r
37 <div id="comment-tools-{{ post_type }}-{{ post.id }}" class="comment-tools">\r
38     <img src="/m/default/media/images/gray-up-arrow-h18px.png" />\r
39     {% ifnotequal showing total %}\r
40         <span class="comments-showing">\r
41             {% blocktrans %}showing {{ showing }} of {{ total }}{% endblocktrans %}\r
42         </span>\r
43         <a href="#" class="show-all-comments-link">{% trans "show all" %}</a>\r
44     {% endifnotequal %}\r
45     {% if can_comment %}\r
46         <a href="#" class="add-comment-link">{% trans "add new comment" %}</a>\r
47     {% endif %}\r
48 </div>\r
49 {% if can_comment %}\r
50 <div id="comment-{{ post_type }}-{{ post.id }}-form-container" class="comment-form-container">\r
51     <form id="comment-{{ post_type }}-{{ post.id }}-form" method="post" action="{% url comment post_type=post_type,id=post.id %}">\r
52         <div class="comment-form-widgets-container">\r
53             <textarea name="comment"></textarea>\r
54             <input type="submit" value="{% trans " add comment" %}" />\r
55         </div>\r
56         <span id="comment-{{ post_type }}-{{ post.id }}-chars-left" class="comment-chars-left">\r
57             {% blocktrans %}\r
58                 have <span class="comments-char-left-count">{{ max_length }}</span> characters left\r
59             {% endblocktrans %}\r
60         </span>\r
61         <script type="text/html" class="new-comment-skeleton" id="new-comment-skeleton-{{ post_type }}-{{ post.id }}">\r
62             <table class="comment" id="comment-%ID%" style="display: none">\r
63                 <tr>\r
64                     <td rowspan="2" class="comment-score" id="comment-%ID%-score"></td>\r
65                     <td class="comment-text" id="comment-%ID%-text">%COMMENT%</td>\r
66                 </tr>\r
67                 <tr>\r
68                     <td class="comment-info" id="comment-%ID%-info">\r
69                         <a class="comment-user" href="%PROFILE_URL%">%USERNAME%</a>\r
70                         <span class="comment-age">({% trans "just now" %})</span>\r
71                         <a id="comment-%ID%-edit" href="#"\r
72                             class="comment-edit" rel="nofollow"> </a>\r
73                         <a id="comment-%ID%-delete" href="%DELETE_URL%"\r
74                             class="ajax-command comment-delete" rel="nofollow"> </a>\r
75                     </td>\r
76                 </tr>\r
77             </table>\r
78         </script>\r
79     </form>\r
80 </div>\r
81 {% endif %}\r
82