2016-09-15 13:18:14 +00:00
|
|
|
{% if grav.twig.enable_comments_plugin %}
|
2018-06-30 00:06:21 +00:00
|
|
|
{% set scope = scope ?: 'data.' %}
|
2019-01-04 00:13:23 +00:00
|
|
|
<section id="comments-section">
|
|
|
|
<h2>{{'PLUGIN_COMMENTS.COMMENTS'|t}}</h2>
|
2015-10-07 18:18:44 +00:00
|
|
|
|
2019-01-04 00:13:23 +00:00
|
|
|
{% if grav.twig.commenting_enabled %}
|
|
|
|
<a class="comment-add-new" href="#"><i class="fa fa-plus" title="{{'PLUGIN_COMMENTS.ADD_NEW'|t}}"></i> {{'PLUGIN_COMMENTS.ADD_NEW'|t}}</a>
|
2018-06-30 00:06:21 +00:00
|
|
|
{% endif %}
|
2015-11-10 15:25:18 +00:00
|
|
|
|
2019-01-04 00:13:23 +00:00
|
|
|
{% include 'partials/comments.form.html.twig' %}
|
2015-10-15 16:04:02 +00:00
|
|
|
|
2019-01-04 00:13:23 +00:00
|
|
|
<div id="comments" class="row comments">
|
|
|
|
{% if grav.twig.comments|length %}
|
|
|
|
{% set comments_visible = false %}
|
|
|
|
{% for comment in grav.twig.comments %}
|
|
|
|
{% if comment.approved == "true" %}
|
|
|
|
<div class="comment-wrapper">
|
|
|
|
{% set comments_visible = true %}
|
|
|
|
{% for level in range(0, comment.level|e) %}
|
|
|
|
{% if level == comment.level|e %}
|
|
|
|
<div id="thread-{{level}}" class="comment-thread-top comment-thread">
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div id="thread-{{level}}" class="comment-thread">
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
<div id="comment-{{comment.id}}" class="comment comment-level-{{comment.level|e}}" data-id="{{comment.id}}" itemtype="http://schema.org/UserComments">
|
|
|
|
<header class="comment-heading">
|
|
|
|
<img class="comment-avatar" src="https://www.gravatar.com/avatar/{{comment.email|trim|lower|md5}}?size=20&d=identicon" alt="user icon">
|
|
|
|
<span class="comment-meta">
|
|
|
|
{% if comment.site %}
|
|
|
|
<a href="{{comment.site}}">{{comment.author}}</a>
|
|
|
|
{% else %}
|
|
|
|
{{comment.author}}
|
|
|
|
{% endif %}
|
|
|
|
<a href="{{uri.url(true)}}#comment-{{comment.id}}" title="Link to this comment" itemprop="url">
|
2018-06-30 00:06:21 +00:00
|
|
|
<time class="comment-date" datetime="{{comment.date|e}}" itemprop="commentTime">
|
|
|
|
{{comment.date|nicetime(false)}}
|
|
|
|
</time>
|
|
|
|
</a>
|
2019-01-04 00:13:23 +00:00
|
|
|
</span>
|
2018-06-30 00:06:21 +00:00
|
|
|
</header>
|
2019-01-04 00:13:23 +00:00
|
|
|
<div class="comment-body">
|
|
|
|
<div class="comment-text" >
|
|
|
|
{{comment.text}}
|
|
|
|
</div>
|
|
|
|
{{nested}}
|
|
|
|
<div class="comment-footer">
|
|
|
|
<span class="comment-reply">
|
|
|
|
{% if grav.twig.commenting_enabled %}
|
|
|
|
<a class="comment-add-reply" href="#"><i class="fa fa-reply" title="{{'PLUGIN_COMMENTS.ADD_REPLY'|t}}"></i> {{'PLUGIN_COMMENTS.REPLY'|t}}</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if grav.user.access.admin.super %}
|
|
|
|
<a class="comment-delete" href="#"><i class="fa fa-trash" title="{{'PLUGIN_COMMENTS.DELETE_COMMENT'|t}}"></i> {{'PLUGIN_COMMENTS.DELETE'|t}}</a>
|
|
|
|
{% endif %}
|
|
|
|
</span>
|
|
|
|
</div>
|
2018-06-30 00:06:21 +00:00
|
|
|
</div>
|
2019-01-04 00:13:23 +00:00
|
|
|
</div>
|
2017-10-24 00:57:44 +00:00
|
|
|
</div>
|
2019-01-04 00:13:23 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2017-12-02 01:53:07 +00:00
|
|
|
|
2018-06-30 00:06:21 +00:00
|
|
|
{% if not comments_visible %}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
{{'PLUGIN_COMMENTS.COMMENTS_NONE'|t}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endif %}
|
2019-01-04 00:13:23 +00:00
|
|
|
</div>
|
|
|
|
</section>
|
2015-11-13 17:46:28 +00:00
|
|
|
{% endif %}
|