forked from plhw57tbe/SoftwareMethodology
parent
5545a58da7
commit
e80c253a98
@ -1,34 +1,48 @@
|
||||
{% load blog_tags %}
|
||||
{% 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">
|
||||
{# 使用Gravatar显示头像 #}
|
||||
<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头像 #}
|
||||
class="avatar avatar-96 photo" height="96" width="96">
|
||||
{# 作者姓名 #}
|
||||
<cite class="fn">
|
||||
<a rel="nofollow"
|
||||
{% if comment_item.author.is_superuser %}
|
||||
href="{{ comment_item.author.get_absolute_url }}"
|
||||
{% else %}
|
||||
href="#"
|
||||
{% endif %}
|
||||
{% 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.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"
|
||||
href="javascript:void(0)"
|
||||
onclick="do_reply({{ comment_item.pk }})"
|
||||
aria-label="回复给{{ comment_item.author.username }}">回复</a></div>
|
||||
|
||||
{# 评论内容 #}
|
||||
<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>
|
||||
</div>
|
||||
|
||||
</li><!-- #comment-## -->
|
||||
Loading…
Reference in new issue