From be5f54c142c60193eb44ea63f3f3fc679e5e366c Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 13 Dec 2021 21:46:11 +0100 Subject: [PATCH] comments: build list --- .../AccompanyingCourse/comment_list.html.twig | 33 +++++++++++++++++++ .../translations/messages.fr.yml | 1 + 2 files changed, 34 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/comment_list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/comment_list.html.twig index a81721530..6f900dc05 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/comment_list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/comment_list.html.twig @@ -1,5 +1,27 @@ {% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %} +{% macro show_comment(comment, options) %} +
+
+
+ {% if options.pinned is defined %} + + {% endif %} + + {{ 'by'|trans }}{{ comment.creator }}{{ ', ' ~ 'on'|trans ~ ' ' ~ comment.createdAt|format_date('long') }}
+ {{ 'Last updated on'|trans ~ ' ' ~ comment.updatedAt|format_datetime('long', 'short') }} +
+
    +
  • +
  • +
+
+
+
{{ comment.content }}
+
+
+{% endmacro %} + {% block title %} {{ 'Accompanying Course Comment list'|trans }} {% endblock %} @@ -7,5 +29,16 @@ {% block content %}

{{ block('title') }}

+
+ + {% if accompanyingCourse.pinnedComment %} + {{ _self.show_comment(accompanyingCourse.pinnedComment, {'pinned': 'true'}) }} + {% endif %} + + {% for c in accompanyingCourse.comments %} + {{ _self.show_comment(c) }} + {% endfor %} + +
{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 152a66ee0..250890cd0 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -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