comments: build list

This commit is contained in:
Mathieu Jaumotte 2021-12-13 21:46:11 +01:00
parent d5290e4bdd
commit be5f54c142
2 changed files with 34 additions and 0 deletions

View File

@ -1,5 +1,27 @@
{% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %}
{% macro show_comment(comment, options) %}
<div class="item-bloc">
<div class="item-row">
<div>
{% if options.pinned is defined %}
<i class="fa fa-flag fa-fw" title="{{ 'pinned'|trans }}"></i>
{% endif %}
<a id="comment{{ comment.id }}" href="#comment{{ comment.id }}" class="fa fa-pencil-square-o fa-fw"></a>
{{ 'by'|trans }}<b>{{ comment.creator }}</b>{{ ', ' ~ 'on'|trans ~ ' ' ~ comment.createdAt|format_date('long') }}<br>
<i>{{ 'Last updated on'|trans ~ ' ' ~ comment.updatedAt|format_datetime('long', 'short') }}</i>
</div>
<ul class="record_actions">
<li><a class="btn btn-edit" title="{{ 'Edit'|trans }}" href=""></a></li>
<li><a class="btn btn-delete" title="{{ 'Delete'|trans }}" href=""></a></li>
</ul>
</div>
<div class="item-row separator">
<blockquote class="chill-user-quote col">{{ comment.content }}</blockquote>
</div>
</div>
{% endmacro %}
{% block title %}
{{ 'Accompanying Course Comment list'|trans }}
{% endblock %}
@ -7,5 +29,16 @@
{% block content %}
<div class="accompanyingcourse-comment-list">
<h1>{{ block('title') }}</h1>
<div class="flex-table">
{% if accompanyingCourse.pinnedComment %}
{{ _self.show_comment(accompanyingCourse.pinnedComment, {'pinned': 'true'}) }}
{% endif %}
{% for c in accompanyingCourse.comments %}
{{ _self.show_comment(c) }}
{% endfor %}
</div>
</div>
{% endblock %}

View File

@ -409,6 +409,7 @@ Locate by: Localiser auprès de
fix it: Compléter
Accompanying Course Comment: Commentaire
Accompanying Course Comment list: Commentaires du parcours
pinned: épinglé
# Household
Household: Ménage