comments from disuccion module

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{% comment_tree_for_object object as comments %}
<div id="comments"><h2>{% trans "Comments" %}</h2>
{% for comment in comments %}
<div
style="margin-left:{% widthratio comment.level 30 100 %}%"
class="blogcomment {% cycle odd,even %}"
id="c{{ comment.id }}">
<span class="author">{% link comment.user %}</span>
<span class="comment-time"><a href="#c{{ comment.id }}">{{ comment.pub_date|date }} {{ comment.pub_date|time }}</a></span>
<div class="text">{{ comment.body_html|safe }}</div>
{% if object.comments_open %}
<a class="reply-link"
id="reply-link-{{ comment.id }}"
onclick="return replyto({{ comment.id }})"
href="?reply_to={{ comment.id }}">{% trans "reply" %}</a>
{% endif %}
{% ifequal user comment.user %}
<a class="edit-comment"
id="edit-comment-{{ comment.id }}"
onclick="return edit_comment({{ comment.id }}, '{% url comment_edit comment.id %}');"
href="#">{% trans "edit" %}</a>
<a class="cancel-edit"
id="cancel-edit-{{ comment.id }}"
onclick="return cancel_edit({{ comment.id }});"
href="#">{% trans "cancel" %}</a>
<input type="submit" value="submit" class="edit-submit" id="edit-submit-{{ comment.id }}"
onclick="return submit_edit({{ comment.id }}, '{% url comment_edit comment.id %}');" />
{% endifequal %}
{% if user.is_staff %}
<a class="delete-comment"
id="delete-comment-{{ comment.id }}"
onclick="return delete_comment({{ comment.id }}, '{% url comment_delete comment.id %}');"
href="#">{% trans "delete" %}</a>
{% endif %}
{% if object.comments_open %}{% ifequal reply_to comment.id %}
{% include "blog/comment_form.html" %}
{% endifequal %}{% endif %}
</div>