|
|
|
|
@ -1,34 +1,35 @@
|
|
|
|
|
{% load blog_tags %}
|
|
|
|
|
<li class="comment even thread-even depth-{{ depth }} parent" id="comment-{{ comment_item.pk }}">
|
|
|
|
|
<div id="div-comment-{{ comment_item.pk }}" class="comment-body">
|
|
|
|
|
<div class="comment-author vcard">
|
|
|
|
|
```
|
|
|
|
|
{% load blog_tags %} {# 加载博客自定义标签 #}
|
|
|
|
|
<li class="comment even thread-even depth-{{ depth }} parent" id="comment-{{ comment_item.pk }}"> {# 评论列表项,包含深度和ID #}
|
|
|
|
|
<div id="div-comment-{{ comment_item.pk }}" class="comment-body"> {# 评论主体容器 #}
|
|
|
|
|
<div class="comment-author vcard"> {# 评论作者信息 #}
|
|
|
|
|
<img alt=""
|
|
|
|
|
src="{{ comment_item.author.email|gravatar_url:150 }}"
|
|
|
|
|
srcset="{{ comment_item.author.email|gravatar_url:150 }}"
|
|
|
|
|
src="{{ comment_item.author.email | gravatar_url:150 }}" {# 使用Gravatar显示头像 #}
|
|
|
|
|
srcset="{{ comment_item.author.email | gravatar_url:150 }}"
|
|
|
|
|
class="avatar avatar-96 photo" height="96" width="96">
|
|
|
|
|
<cite class="fn">
|
|
|
|
|
<cite class="fn"> {# 作者姓名 #}
|
|
|
|
|
<a rel="nofollow"
|
|
|
|
|
{% if comment_item.author.is_superuser %}
|
|
|
|
|
href="{{ comment_item.author.get_absolute_url }}"
|
|
|
|
|
{% else %}
|
|
|
|
|
href="#"
|
|
|
|
|
{% if comment_item.author.is_superuser %} {# 如果是超级用户 #}
|
|
|
|
|
href="{{ comment_item.author.get_absolute_url }}" {# 链接到作者页面 #}
|
|
|
|
|
{% else %} {# 如果不是超级用户 #}
|
|
|
|
|
href="#" {# 空链接 #}
|
|
|
|
|
{% endif %}
|
|
|
|
|
rel="external nofollow"
|
|
|
|
|
class="url">{{ comment_item.author.username }}
|
|
|
|
|
class="url">{{ comment_item.author.username }} {# 显示用户名 #}
|
|
|
|
|
</a>
|
|
|
|
|
</cite>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="comment-meta commentmetadata">
|
|
|
|
|
<div>{{ comment_item.creation_time }}</div>
|
|
|
|
|
<div>回复给:@{{ comment_item.author.parent_comment.username }}</div>
|
|
|
|
|
<div class="comment-meta commentmetadata"> {# 评论元数据 #}
|
|
|
|
|
<div>{{ comment_item.creation_time }}</div> {# 评论创建时间 #}
|
|
|
|
|
<div>回复给:@{{ comment_item.author.parent_comment.username }}</div> {# 回复对象 #}
|
|
|
|
|
</div>
|
|
|
|
|
<p>{{ comment_item.body|escape|comment_markdown }}</p>
|
|
|
|
|
<div class="reply"><a rel="nofollow" class="comment-reply-link"
|
|
|
|
|
<p>{{ comment_item.body | escape | comment_markdown }}</p> {# 评论内容,转义并Markdown渲染 #}
|
|
|
|
|
<div class="reply"><a rel="nofollow" class="comment-reply-link" {# 回复链接 #}
|
|
|
|
|
href="javascript:void(0)"
|
|
|
|
|
onclick="do_reply({{ comment_item.pk }})"
|
|
|
|
|
aria-label="回复给{{ comment_item.author.username }}">回复</a></div>
|
|
|
|
|
onclick="do_reply({{ comment_item.pk }})" {# 点击回复函数 #}
|
|
|
|
|
aria-label="回复给{{ comment_item.author.username }}">回复</a></div> {# 可访问性标签 #}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</li><!-- #comment-## -->
|
|
|
|
|
</li><!-- #comment-## --> {# 评论项结束 #}
|