forked from FriendsOfSymfony/FOSCommentBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
comment_content.html.twig
72 lines (58 loc) · 3.98 KB
/
comment_content.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{#
This file is part of the FOSCommentBundle package.
(c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
#}
{% block fos_comment_comment %}
<div id="fos_comment_{{ comment.id }}" class="fos_comment_comment_show fos_comment_comment_depth_{{ depth }}" {% if parentId is defined %}data-parent="{{ parentId }}"{% endif %}>
<div class="fos_comment_comment_metas">
{% block fos_comment_comment_metas %}
{% block fos_comment_comment_metas_authorline %}
{% trans from 'FOSCommentBundle' %}fos_comment_comment_show_by{% endtrans %} <span class="fos_comment_comment_authorname">{{ comment.authorName }}</span> - {{ comment.createdAt|date }}
{% endblock fos_comment_comment_metas_authorline %}
{% block fos_comment_comment_metas_edit %}
{% if fos_comment_can_edit_comment(comment) %}
<button data-url="{{ url("fos_comment_edit_thread_comment", {"id": comment.thread.id, "commentId": comment.id}) }}" class="fos_comment_comment_edit_show_form">Edit</button>
{% endif %}
{% endblock fos_comment_comment_metas_edit %}
{% block fos_comment_comment_metas_voting %}
{% if fos_comment_can_vote(comment) %}
<div class="fos_comment_comment_voting">
<button data-url="{{ url("fos_comment_new_thread_comment_votes", {"id": comment.thread.id, "commentId": comment.id, "value": 1}) }}" class="fos_comment_comment_vote">{% trans from 'FOSCommentBundle' %}fos_comment_comment_show_voteup{% endtrans %}</button>
<button data-url="{{ url("fos_comment_new_thread_comment_votes", {"id": comment.thread.id, "commentId": comment.id, "value": -1}) }}" class="fos_comment_comment_vote">{% trans from 'FOSCommentBundle' %}fos_comment_comment_show_votedown{% endtrans %}</button>
<div class="fos_comment_comment_score" id="fos_comment_score_{{ comment.id }}">{% include "FOSCommentBundle:Thread:comment_votes.html.twig" with { 'commentScore': comment.score } %}</div>
</div>
{% endif %}
{% endblock fos_comment_comment_metas_voting %}
{% endblock fos_comment_comment_metas %}
</div>
<div class="fos_comment_comment_body">
{% block fos_comment_comment_body %}
{% if comment is fos_comment_raw %}
{{ comment.rawBody | raw }}
{% else %}
{{ comment.body | nl2br }}
{% endif %}
{% endblock fos_comment_comment_body %}
</div>
{% block fos_comment_comment_children %}
{% if view is not sameas('flat') %}
<div class="fos_comment_comment_replies">
{% if fos_comment_can_comment(comment) %}
<div class="fos_comment_comment_reply">
{% block fos_comment_comment_reply %}
<button data-url="{{ url('fos_comment_new_thread_comments', {"id": comment.thread.id}) }}" data-name="{{ comment.authorName }}" data-parent-id="{{ comment.id }}" class="fos_comment_comment_reply_show_form">{% trans from 'FOSCommentBundle' %}fos_comment_comment_show_reply{% endtrans %}</button>
{% endblock fos_comment_comment_reply %}
</div>
{% endif %}
{% if children is defined %}
{% include "FOSCommentBundle:Thread:comments.html.twig" with { "comments": children, "depth": depth + 1, "parentId": comment.id, "view": view } %}
{% endif %}
</div>
{% elseif view is sameas('flat') and children is defined %}
{% include "FOSCommentBundle:Thread:comments.html.twig" with { "comments": children, "depth": depth + 1, "parentId": comment.id, "view": view } %}
{% endif %}
{% endblock fos_comment_comment_children %}
</div>
{% endblock fos_comment_comment %}