{% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %} {% block title %} {{ 'Accompanying Course Comment list'|trans }} {% endblock %} {% import '@ChillPerson/AccompanyingCourse/Comment/macro_showItem.html.twig' as m %} {% macro recordAction(comment, isPinned) %} {% if isPinned is defined and isPinned == true %} {% else %}
  • {% endif %} {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_EDIT', comment) %}
  • {% endif %} {% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_DELETE', comment) %}
  • {% endif %} {% endmacro %} {% macro form_comment(type, form) %} {% if type == 'edit' %}
    {% endif %} {{ form_start(form) }} {{ form_errors(form) }} {{ form_widget(form.content) }} {{ form_end(form) }} {% if type == 'edit' %}
    {% endif %} {% endmacro %} {% block content %}

    {{ block('title') }}

    {% if accompanyingCourse.pinnedComment %} {% if commentEditId == accompanyingCourse.pinnedComment.id %} {{ _self.form_comment('edit', edit_form) }} {% else %} {{ m.show_comment(accompanyingCourse.pinnedComment, { 'pinned': true, 'recordAction': _self.recordAction(accompanyingCourse.pinnedComment, true) }) }} {% endif %} {% endif %} {% for comment in accompanyingCourse.comments %} {% if commentEditId == comment.id %} {{ _self.form_comment('edit', edit_form) }} {% else %} {{ m.show_comment(comment, { 'recordAction': _self.recordAction(comment) }) }} {% endif %} {% endfor %}
    {% if form is not null %}

    {{ 'Write a new comment'|trans }}

    {{ _self.form_comment('new', form) }}
    {% endif %}
    {% endblock %}