Fixed: check for empty command

Use the the EmbeddableComment api for getting comment.
This commit is contained in:
Julien Fastré 2023-01-25 13:26:57 +01:00
parent 06238c8355
commit 5c413edb32
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 25 additions and 24 deletions

View File

@ -189,12 +189,11 @@
<span class="chill-no-data-statement">{{ 'No comment associated'|trans }}</span>
{% endif %}
</div>
{% set userId = app.user.id %}
{% if w.privateComment.comments|length > 0 and w.privateComment.comments[userId] %}
{% if w.privateComment.hasCommentForUser(app.user) %}
<div class="item-bloc no-altern{% if displayContent is defined %} {{ displayContent }}{% endif %}{% if itemBlocClass is defined %} {{ itemBlocClass }}{% endif %}">
<h3 class="chill-beige">Privé</h3>
<blockquote class="chill-user-quote private-quote">
{{ w.privateComment.comments[userId]|chill_markdown_to_html }}
{{ w.privateComment.commentForUser(app.user)|chill_markdown_to_html }}
</blockquote>
</div>
{% endif %}

View File

@ -123,7 +123,9 @@
</ul>
{% if displayContent is defined and displayContent == 'long' %}
<blockquote class="chill-user-quote">{{ e.comment|chill_entity_render_box }}</blockquote>
{% if e.comment is not empty %}
<blockquote class="chill-user-quote">{{ e.comment|chill_entity_render_box }}</blockquote>
{% endif %}
{% import "@ChillDocStore/Macro/macro.html.twig" as m %}
{% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %}