{#
    Template to render a comment

    OPTIONS
    * disable_markdown  bool
    * limit_lines       integer|null
    * metadata          bool

#}
{{ opening_box|raw }}
    {%- if options['limit_lines'] is not null -%}
        {% if comment.comment|split('\n')|length > options['limit_lines'] %}
            {% set content = comment.comment|split('\n')|slice(0, options['limit_lines'])|merge(['(more...)'|trans])|join('\n') %}
        {% else %}
            {% set content = comment.comment %}
        {% endif %}
    {%- else -%}
        {% set content = comment.comment %}
    {%- endif -%}

    <blockquote class="chill-user-quote">
        {% if options['disable_markdown'] %}
            {{ content|nl2br }}
        {% else %}
            {{ content|chill_markdown_to_html }}
        {% endif %}

        {% if options['metadata'] %}
            <div class="metadata">
                {% if comment.date is not empty %}
                    {{ 'Last updated on'|trans ~ ' ' }}
                    <span class="date">
                        {{ comment.date|format_datetime("medium", "short") }}
                    </span>
                {% endif %}
                {% if user is not empty %}
                    {% if comment.date is empty %}
                        {{ 'Last updated by'| trans }}
                    {% else %}
                        {{ 'by_user'|trans ~ ' ' }}
                    {% endif %}
                    <span class="user">
                        {{ user|chill_entity_render_box({'at_date': comment.date}) }}
                    </span>
                {% endif %}
            </div>
        {% endif %}
    </blockquote>
{{ closing_box|raw }}
