Merge pull request #213 from liangliangyy/dev

评论层级样式修改 close #212
且听风吟 7 years ago committed by GitHub
commit 3dbb65d3ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,44 @@
{% load blog_tags %}
<li class="comment even thread-even depth-{{ depth }} parent" id="comment-{{ comment_item.pk }}"
style="margin-left: {% widthratio depth 1 3 %}rem">
<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 }}"
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 %}
rel="external nofollow"
class="url">{{ comment_item.author.username }}
</a>
</cite>
<span class="says">说道</span>
</div>
<div class="comment-meta commentmetadata">
{{ comment_item.created_time }}
</div>
<p>{{ comment_item.body |escape|custom_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>
</div>
</li><!-- #comment-## -->
{% query article_comments parent_comment=comment_item as cc_comments %}
{% for cc in cc_comments %}
{% with comment_item=cc template_name="comments/tags/comment_item_tree.html" %}
{% with depth=depth|add:1 %}
{% include template_name %}
{% endwith %}
{% endwith %}
{% endfor %}

@ -11,28 +11,16 @@
{% if article_comments %}
{% cache 36000 article_comments article.id %}
<div id="commentlist-container" class="comment-tab" style="display: block;">
<ol class="commentlist">
{% query article_comments parent_comment=None as parent_comments %}
{% for comment in parent_comments %}
{% show_comment_item comment False %}
{% parse_commenttree article_comments comment as childcomments %}
{% if childcomments %}
<ul class="children">
{% for child in childcomments %}
{% show_comment_item child True %}
{% endfor %}
</ul><!-- .children -->
{% endif %}
{% for comment_item in parent_comments %}
{% with 0 as depth %}
{% include "comments/tags/comment_item_tree.html" %}
{% endwith %}
{% endfor %}
</ol><!--/.commentlist-->
</div>
{% endcache %}
{% endif %}

Loading…
Cancel
Save