You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
cosmopet-architecture/wp-content/themes/cosmopet/views/blog/comments/comment-single.twig

63 lines
3.1 KiB

<div class="comment-block{% if depth > 1 %} answer-block{% endif %}" id="comment-{{ comment.comment_ID }}">
<div class="comment-user">
{{ fn('get_avatar', comment, 50) }}
<div class="comment-user_text">
<h6>{{ comment.comment_author }}</h6>
<span>{{ fn('get_comment_date', 'd F Y', comment) }}</span>
</div>
</div>
<p>{{ comment.comment_content }}</p>
<div class="comment-btns">
<button class="reply-to-comment"
data-comment-id="{{ comment.comment_ID }}"
data-post-id="{{ post.ID }}"
data-reply-to="{{ comment.comment_author|e }}">
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.5 3H3.25C2.00736 3 1 4.00736 1 5.25V5.25C1 6.49264 2.00736 7.5 3.25 7.5H3.5" stroke="#666666"/>
<path d="M7 0.5L9.5 3L7 5.5" stroke="#666666"/>
</svg>
{{ fn('pll_e', 'Ответить') }}
</button>
<button class="comment-like-btn{% if fn('is_user_liked_comment', comment.comment_ID) %} active{% endif %}"
data-comment-id="{{ comment.comment_ID }}">
<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z"
{% if fn('is_user_liked_comment', comment.comment_ID) %}
stroke="#ff0000" fill="rgba(255, 0, 0, 0.7)"
{% else %}
stroke="#666666"
{% endif %}
/>
</svg>
{{ fn('get_comment_likes_count', comment.comment_ID) }}
</button>
{{ fn('comment_reply_link', {
reply_text: fn('pll_e', 'Ответить'),
depth: depth,
max_depth: fn('get_option', 'thread_comments_depth'),
before: '<span style="display:none;">',
after: '</span>'
}, comment.comment_ID, post.ID) }}
</div>
<div class="reply-form-container" id="reply-form-{{ comment.comment_ID }}" style="display: none;"></div>
{% if comment.replies %}
<button class="answer-btn">
<svg width="15" height="10" viewBox="0 0 15 10" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14 1.41406L7.5 7.91406L1 1.41406" stroke="#76CE75" stroke-width="2" />
</svg>
{{ comment.replies|length }}
<span>
{{ comment.replies|length == 1 ? fn('pll_e', 'ответ') : fn('pll_e', 'ответа') }}
</span>
</button>
{% for reply in comment.replies %}
{% include 'blog/comments/comment-single.twig' with { comment: reply, depth: depth + 1 } %}
{% endfor %}
{% endif %}
</div>